--- old/src/cpu/x86/vm/c1_LinearScan_x86.hpp 2015-04-06 14:40:48.071507500 -0700 +++ new/src/cpu/x86/vm/c1_LinearScan_x86.hpp 2015-04-06 14:40:47.881488500 -0700 @@ -85,8 +85,14 @@ tty->print_cr("killing XMMs for trig"); } #endif + int num_caller_save_xmm_regs = FrameMap::nof_caller_save_xmm_regs; +#if _LP64 + if (UseAVX < 3) { + num_caller_save_xmm_regs = num_caller_save_xmm_regs / 2; + } +#endif int op_id = op->id(); - for (int xmm = 0; xmm < FrameMap::nof_caller_save_xmm_regs; xmm++) { + for (int xmm = 0; xmm < num_caller_save_xmm_regs; xmm++) { LIR_Opr opr = FrameMap::caller_save_xmm_reg_at(xmm); add_temp(reg_num(opr), op_id, noUse, T_ILLEGAL); } @@ -100,6 +106,10 @@ // Implementation of LinearScanWalker inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { + int last_xmm_reg = pd_last_xmm_reg; + if (UseAVX < 3) { + last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1; + } if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) { assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); _first_reg = pd_first_byte_reg; @@ -107,7 +117,7 @@ return true; } else if ((UseSSE >= 1 && cur->type() == T_FLOAT) || (UseSSE >= 2 && cur->type() == T_DOUBLE)) { _first_reg = pd_first_xmm_reg; - _last_reg = pd_last_xmm_reg; + _last_reg = last_xmm_reg; return true; }