# HG changeset patch # User rkennke # Date 1547035613 -3600 # Wed Jan 09 13:06:53 2019 +0100 # Node ID adbf14ba49c64239885f58c19b25be5f432ec65c # Parent 3cdf4d5148a8990f5c251ac3f26fddefe8bad9c0 8216392: Enable cmovP_mem and cmovP_memU instructions diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -7035,32 +7035,27 @@ %} %} -// DISABLED: Requires the ADLC to emit a bottom_type call that -// correctly meets the two pointer arguments; one is an incoming -// register but the other is a memory operand. ALSO appears to -// be buggy with implicit null checks. -// -//// Conditional move -//instruct cmovP_mem(cmpOp cop, rFlagsReg cr, rRegP dst, memory src) -//%{ -// match(Set dst (CMoveP (Binary cop cr) (Binary dst (LoadP src)))); -// ins_cost(250); -// format %{ "CMOV$cop $dst,$src\t# ptr" %} -// opcode(0x0F,0x40); -// ins_encode( enc_cmov(cop), reg_mem( dst, src ) ); -// ins_pipe( pipe_cmov_mem ); -//%} -// -//// Conditional move -//instruct cmovP_memU(cmpOpU cop, rFlagsRegU cr, rRegP dst, memory src) -//%{ -// match(Set dst (CMoveP (Binary cop cr) (Binary dst (LoadP src)))); -// ins_cost(250); -// format %{ "CMOV$cop $dst,$src\t# ptr" %} -// opcode(0x0F,0x40); -// ins_encode( enc_cmov(cop), reg_mem( dst, src ) ); -// ins_pipe( pipe_cmov_mem ); -//%} +// Conditional move +instruct cmovP_mem(cmpOp cop, rFlagsReg cr, rRegP dst, memory src) +%{ + match(Set dst (CMoveP (Binary cop cr) (Binary dst (LoadP src)))); + ins_cost(250); + format %{ "CMOV$cop $dst,$src\t# ptr" %} + opcode(0x0F,0x40); + ins_encode(REX_reg_reg_wide(dst, src), enc_cmov(cop), reg_mem( dst, src ) ); + ins_pipe( pipe_cmov_mem ); +%} + +// Conditional move +instruct cmovP_memU(cmpOpU cop, rFlagsRegU cr, rRegP dst, memory src) +%{ + match(Set dst (CMoveP (Binary cop cr) (Binary dst (LoadP src)))); + ins_cost(250); + format %{ "CMOV$cop $dst,$src\t# ptr" %} + opcode(0x0F,0x40); + ins_encode(REX_reg_reg_wide(dst, src), enc_cmov(cop), reg_mem( dst, src ) ); + ins_pipe( pipe_cmov_mem ); +%} instruct cmovL_reg(cmpOp cop, rFlagsReg cr, rRegL dst, rRegL src) %{