--- old/src/hotspot/cpu/x86/x86_64.ad 2019-07-10 10:10:09.412790806 +0200 +++ new/src/hotspot/cpu/x86/x86_64.ad 2019-07-10 10:10:09.144790810 +0200 @@ -12006,6 +12006,17 @@ ins_pipe(ialu_cr_reg_mem); %} +// Fold array properties check +instruct testI_mem_imm(rFlagsReg cr, memory mem, immI con, immI0 zero) +%{ + match(Set cr (CmpI (AndI (CastN2I (LoadNKlass mem)) con) zero)); + + format %{ "testl $mem, $con" %} + opcode(0xF7, 0x00); + ins_encode(REX_mem(mem), OpcP, RM_opc_mem(0x00, mem), Con32(con)); + ins_pipe(ialu_mem_imm); +%} + // Unsigned compare Instructions; really, same as signed except they // produce an rFlagsRegU instead of rFlagsReg. instruct compU_rReg(rFlagsRegU cr, rRegI op1, rRegI op2) @@ -12310,6 +12321,17 @@ format %{ "testq $src, $mem" %} opcode(0x85); + ins_encode(REX_reg_mem_wide(src, mem), OpcP, reg_mem(src, mem)); + ins_pipe(ialu_cr_reg_mem); +%} + +// Fold array properties check +instruct testL_reg_mem3(rFlagsReg cr, memory mem, rRegL src, immL0 zero) +%{ + match(Set cr (CmpL (AndL (CastP2X (LoadKlass mem)) src) zero)); + + format %{ "testq $src, $mem" %} + opcode(0x85); ins_encode(REX_reg_mem_wide(src, mem), OpcP, reg_mem(src, mem)); ins_pipe(ialu_cr_reg_mem); %}