--- old/src/hotspot/cpu/x86/x86_32.ad 2020-04-02 18:03:49.552854103 -0700 +++ new/src/hotspot/cpu/x86/x86_32.ad 2020-04-02 18:03:49.388854103 -0700 @@ -3322,7 +3322,7 @@ %} // Constant for test vs zero -operand immI0() %{ +operand immI_0() %{ predicate(n->get_int() == 0); match(ConI); @@ -3332,7 +3332,7 @@ %} // Constant for increment -operand immI1() %{ +operand immI_1() %{ predicate(n->get_int() == 1); match(ConI); @@ -3369,6 +3369,16 @@ interface(CONST_INTER); %} +operand immU8() +%{ + predicate((0 <= n->get_int()) && (n->get_int() <= 255)); + match(ConI); + + op_cost(5); + format %{ %} + interface(CONST_INTER); +%} + operand immI16() %{ predicate((-32768 <= n->get_int()) && (n->get_int() <= 32767)); match(ConI); @@ -3417,8 +3427,8 @@ interface(CONST_INTER); %} -operand immI_1() %{ - predicate( n->get_int() == 1 ); +operand immI_2() %{ + predicate( n->get_int() == 2 ); match(ConI); op_cost(0); @@ -3426,8 +3436,8 @@ interface(CONST_INTER); %} -operand immI_2() %{ - predicate( n->get_int() == 2 ); +operand immI_3() %{ + predicate( n->get_int() == 3 ); match(ConI); op_cost(0); @@ -3435,8 +3445,19 @@ interface(CONST_INTER); %} -operand immI_3() %{ - predicate( n->get_int() == 3 ); +operand immI_4() +%{ + predicate(n->get_int() == 4); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + +operand immI_8() +%{ + predicate(n->get_int() == 8); match(ConI); op_cost(0); @@ -3813,6 +3834,18 @@ interface(REG_INTER); %} +operand rRegP() %{ + constraint(ALLOC_IN_RC(int_reg)); + match(RegP); + match(eAXRegP); + match(eBXRegP); + match(eCXRegP); + match(eDIRegP); + + format %{ %} + interface(REG_INTER); +%} + // On windows95, EBP is not safe to use for implicit null tests. operand eRegP_no_EBP() %{ constraint(ALLOC_IN_RC(int_reg_no_ebp)); @@ -3946,6 +3979,15 @@ %} // Flags register, used as output of compare instructions +operand rFlagsReg() %{ + constraint(ALLOC_IN_RC(int_flags)); + match(RegFlags); + + format %{ "EFLAGS" %} + interface(REG_INTER); +%} + +// Flags register, used as output of compare instructions operand eFlagsReg() %{ constraint(ALLOC_IN_RC(int_flags)); match(RegFlags); @@ -4075,6 +4117,14 @@ interface(REG_INTER); %} +operand legRegF() %{ + predicate( UseSSE>=1 ); + constraint(ALLOC_IN_RC(float_reg_legacy)); + match(RegF); + format %{ %} + interface(REG_INTER); +%} + // Float register operands operand vlRegF() %{ constraint(ALLOC_IN_RC(float_reg_vl)); @@ -4094,6 +4144,14 @@ %} // Double register operands +operand legRegD() %{ + predicate( UseSSE>=2 ); + constraint(ALLOC_IN_RC(double_reg_legacy)); + match(RegD); + format %{ %} + interface(REG_INTER); +%} + operand vlRegD() %{ constraint(ALLOC_IN_RC(double_reg_vl)); match(RegD); @@ -5844,6 +5902,46 @@ ins_pipe( ialu_reg_mem ); %} +// Load Float +instruct MoveF2LEG(legRegF dst, regF src) %{ + match(Set dst src); + format %{ "movss $dst,$src\t# if src != dst load float (4 bytes)" %} + ins_encode %{ + __ movflt($dst$$XMMRegister, $src$$XMMRegister); + %} + ins_pipe( fpu_reg_reg ); +%} + +// Load Float +instruct MoveLEG2F(regF dst, legRegF src) %{ + match(Set dst src); + format %{ "movss $dst,$src\t# if src != dst load float (4 bytes)" %} + ins_encode %{ + __ movflt($dst$$XMMRegister, $src$$XMMRegister); + %} + ins_pipe( fpu_reg_reg ); +%} + +// Load Double +instruct MoveD2LEG(legRegD dst, regD src) %{ + match(Set dst src); + format %{ "movsd $dst,$src\t# if src != dst load double (8 bytes)" %} + ins_encode %{ + __ movdbl($dst$$XMMRegister, $src$$XMMRegister); + %} + ins_pipe( fpu_reg_reg ); +%} + +// Load Double +instruct MoveLEG2D(regD dst, legRegD src) %{ + match(Set dst src); + format %{ "movsd $dst,$src\t# if src != dst load double (8 bytes)" %} + ins_encode %{ + __ movdbl($dst$$XMMRegister, $src$$XMMRegister); + %} + ins_pipe( fpu_reg_reg ); +%} + // Load Double instruct loadDPR(regDPR dst, memory mem) %{ predicate(UseSSE<=1); @@ -5969,7 +6067,7 @@ %} // Load Constant zero -instruct loadConI0(rRegI dst, immI0 src, eFlagsReg cr) %{ +instruct loadConI0(rRegI dst, immI_0 src, eFlagsReg cr) %{ match(Set dst src); effect(KILL cr); @@ -7081,7 +7179,7 @@ ins_pipe( ialu_reg ); %} -instruct incI_eReg(rRegI dst, immI1 src, eFlagsReg cr) %{ +instruct incI_eReg(rRegI dst, immI_1 src, eFlagsReg cr) %{ predicate(UseIncDec); match(Set dst (AddI dst src)); effect(KILL cr); @@ -7181,7 +7279,7 @@ ins_pipe( ialu_mem_imm ); %} -instruct incI_mem(memory dst, immI1 src, eFlagsReg cr) %{ +instruct incI_mem(memory dst, immI_1 src, eFlagsReg cr) %{ match(Set dst (StoreI dst (AddI (LoadI dst) src))); effect(KILL cr); @@ -7559,7 +7657,7 @@ %} // Subtract from a pointer -instruct subP_eReg(eRegP dst, rRegI src, immI0 zero, eFlagsReg cr) %{ +instruct subP_eReg(eRegP dst, rRegI src, immI_0 zero, eFlagsReg cr) %{ match(Set dst (AddP dst (SubI zero src))); effect(KILL cr); @@ -7570,7 +7668,7 @@ ins_pipe( ialu_reg_reg ); %} -instruct negI_eReg(rRegI dst, immI0 zero, eFlagsReg cr) %{ +instruct negI_eReg(rRegI dst, immI_0 zero, eFlagsReg cr) %{ match(Set dst (SubI zero dst)); effect(KILL cr); @@ -8024,7 +8122,7 @@ // Integer Shift Instructions // Shift Left by one -instruct shlI_eReg_1(rRegI dst, immI1 shift, eFlagsReg cr) %{ +instruct shlI_eReg_1(rRegI dst, immI_1 shift, eFlagsReg cr) %{ match(Set dst (LShiftI dst shift)); effect(KILL cr); @@ -8060,7 +8158,7 @@ %} // Arithmetic shift right by one -instruct sarI_eReg_1(rRegI dst, immI1 shift, eFlagsReg cr) %{ +instruct sarI_eReg_1(rRegI dst, immI_1 shift, eFlagsReg cr) %{ match(Set dst (RShiftI dst shift)); effect(KILL cr); @@ -8072,7 +8170,7 @@ %} // Arithmetic shift right by one -instruct sarI_mem_1(memory dst, immI1 shift, eFlagsReg cr) %{ +instruct sarI_mem_1(memory dst, immI_1 shift, eFlagsReg cr) %{ match(Set dst (StoreI dst (RShiftI (LoadI dst) shift))); effect(KILL cr); format %{ "SAR $dst,$shift" %} @@ -8117,7 +8215,7 @@ %} // Logical shift right by one -instruct shrI_eReg_1(rRegI dst, immI1 shift, eFlagsReg cr) %{ +instruct shrI_eReg_1(rRegI dst, immI_1 shift, eFlagsReg cr) %{ match(Set dst (URShiftI dst shift)); effect(KILL cr); @@ -8273,7 +8371,7 @@ ins_pipe(ialu_reg_mem); %} -instruct blsiI_rReg_rReg(rRegI dst, rRegI src, immI0 imm_zero, eFlagsReg cr) %{ +instruct blsiI_rReg_rReg(rRegI dst, rRegI src, immI_0 imm_zero, eFlagsReg cr) %{ match(Set dst (AndI (SubI imm_zero src) src)); predicate(UseBMI1Instructions); effect(KILL cr); @@ -8286,7 +8384,7 @@ ins_pipe(ialu_reg); %} -instruct blsiI_rReg_mem(rRegI dst, memory src, immI0 imm_zero, eFlagsReg cr) %{ +instruct blsiI_rReg_mem(rRegI dst, memory src, immI_0 imm_zero, eFlagsReg cr) %{ match(Set dst (AndI (SubI imm_zero (LoadI src) ) (LoadI src) )); predicate(UseBMI1Instructions); effect(KILL cr); @@ -8438,7 +8536,7 @@ // ROL/ROR // ROL expand -instruct rolI_eReg_imm1(rRegI dst, immI1 shift, eFlagsReg cr) %{ +instruct rolI_eReg_imm1(rRegI dst, immI_1 shift, eFlagsReg cr) %{ effect(USE_DEF dst, USE shift, KILL cr); format %{ "ROL $dst, $shift" %} @@ -8467,7 +8565,7 @@ // end of ROL expand // ROL 32bit by one once -instruct rolI_eReg_i1(rRegI dst, immI1 lshift, immI_M1 rshift, eFlagsReg cr) %{ +instruct rolI_eReg_i1(rRegI dst, immI_1 lshift, immI_M1 rshift, eFlagsReg cr) %{ match(Set dst ( OrI (LShiftI dst lshift) (URShiftI dst rshift))); expand %{ @@ -8486,7 +8584,7 @@ %} // ROL 32bit var by var once -instruct rolI_eReg_Var_C0(ncxRegI dst, eCXRegI shift, immI0 zero, eFlagsReg cr) %{ +instruct rolI_eReg_Var_C0(ncxRegI dst, eCXRegI shift, immI_0 zero, eFlagsReg cr) %{ match(Set dst ( OrI (LShiftI dst shift) (URShiftI dst (SubI zero shift)))); expand %{ @@ -8504,7 +8602,7 @@ %} // ROR expand -instruct rorI_eReg_imm1(rRegI dst, immI1 shift, eFlagsReg cr) %{ +instruct rorI_eReg_imm1(rRegI dst, immI_1 shift, eFlagsReg cr) %{ effect(USE_DEF dst, USE shift, KILL cr); format %{ "ROR $dst, $shift" %} @@ -8533,7 +8631,7 @@ // end of ROR expand // ROR right once -instruct rorI_eReg_i1(rRegI dst, immI1 rshift, immI_M1 lshift, eFlagsReg cr) %{ +instruct rorI_eReg_i1(rRegI dst, immI_1 rshift, immI_M1 lshift, eFlagsReg cr) %{ match(Set dst ( OrI (URShiftI dst rshift) (LShiftI dst lshift))); expand %{ @@ -8552,7 +8650,7 @@ %} // ROR 32bit var by var once -instruct rorI_eReg_Var_C0(ncxRegI dst, eCXRegI shift, immI0 zero, eFlagsReg cr) %{ +instruct rorI_eReg_Var_C0(ncxRegI dst, eCXRegI shift, immI_0 zero, eFlagsReg cr) %{ match(Set dst ( OrI (URShiftI dst shift) (LShiftI dst (SubI zero shift)))); expand %{ @@ -8720,7 +8818,7 @@ ins_pipe(pipe_slow); %} -instruct cmpLTMask0(rRegI dst, immI0 zero, eFlagsReg cr) %{ +instruct cmpLTMask0(rRegI dst, immI_0 zero, eFlagsReg cr) %{ match(Set dst (CmpLTMask dst zero)); effect(DEF dst, KILL cr); ins_cost(100); @@ -8834,7 +8932,7 @@ ins_pipe(ialu_reg_reg); %} -instruct overflowNegI_rReg(eFlagsReg cr, immI0 zero, eAXRegI op2) +instruct overflowNegI_rReg(eFlagsReg cr, immI_0 zero, eAXRegI op2) %{ match(Set cr (OverflowSubI zero op2)); effect(DEF cr, USE_KILL op2); @@ -11972,7 +12070,7 @@ ins_pipe( ialu_cr_reg_mem ); %} -instruct testI_reg( eFlagsReg cr, rRegI src, immI0 zero ) %{ +instruct testI_reg( eFlagsReg cr, rRegI src, immI_0 zero ) %{ match(Set cr (CmpI src zero)); effect( DEF cr, USE src ); @@ -11982,7 +12080,7 @@ ins_pipe( ialu_cr_reg_imm ); %} -instruct testI_reg_imm( eFlagsReg cr, rRegI src, immI con, immI0 zero ) %{ +instruct testI_reg_imm( eFlagsReg cr, rRegI src, immI con, immI_0 zero ) %{ match(Set cr (CmpI (AndI src con) zero)); format %{ "TEST $src,$con" %} @@ -11991,7 +12089,7 @@ ins_pipe( ialu_cr_reg_imm ); %} -instruct testI_reg_mem( eFlagsReg cr, rRegI src, memory mem, immI0 zero ) %{ +instruct testI_reg_mem( eFlagsReg cr, rRegI src, memory mem, immI_0 zero ) %{ match(Set cr (CmpI (AndI src mem) zero)); format %{ "TEST $src,$mem" %} @@ -12041,7 +12139,7 @@ // ins_encode( OpcP, RegMem( op1, op2) ); //%} -instruct testU_reg( eFlagsRegU cr, rRegI src, immI0 zero ) %{ +instruct testU_reg( eFlagsRegU cr, rRegI src, immI_0 zero ) %{ match(Set cr (CmpU src zero)); format %{ "TESTu $src,$src" %} @@ -12118,7 +12216,7 @@ // Cisc-spilled version of testP_reg // This will generate a signed flags result. This should be ok // since any compare to a zero should be eq/neq. -instruct testP_Reg_mem( eFlagsReg cr, memory op, immI0 zero ) %{ +instruct testP_Reg_mem( eFlagsReg cr, memory op, immI_0 zero ) %{ match(Set cr (CmpP (LoadP op) zero)); format %{ "TEST $op,0xFFFFFFFF" %} @@ -13489,7 +13587,7 @@ // match(Set dst (CopyI src)); // %} // -// instruct incI_eReg(rRegI dst, immI1 src, eFlagsReg cr) %{ +// instruct incI_eReg(rRegI dst, immI_1 src, eFlagsReg cr) %{ // match(Set dst (AddI dst src)); // effect(KILL cr); // %}