Mercurial > hg > truffle
diff src/cpu/x86/vm/x86_64.ad @ 145:f3de1255b035
6603011: RFE: Optimize long division
Summary: Transform long division by constant into multiply
Reviewed-by: never, kvn
author | rasbold |
---|---|
date | Wed, 07 May 2008 08:06:46 -0700 |
parents | b130b98db9cf |
children | 885ed790ecf0 |
line wrap: on
line diff
--- a/src/cpu/x86/vm/x86_64.ad Tue Apr 29 19:45:22 2008 -0700 +++ b/src/cpu/x86/vm/x86_64.ad Wed May 07 08:06:46 2008 -0700 @@ -8075,6 +8075,18 @@ ins_pipe(ialu_reg_mem_alu0); %} +instruct mulHiL_rReg(rdx_RegL dst, no_rax_RegL src, rax_RegL rax, rFlagsReg cr) +%{ + match(Set dst (MulHiL src rax)); + effect(USE_KILL rax, KILL cr); + + ins_cost(300); + format %{ "imulq RDX:RAX, RAX, $src\t# mulhi" %} + opcode(0xF7, 0x5); /* Opcode F7 /5 */ + ins_encode(REX_reg_wide(src), OpcP, reg_opc(src)); + ins_pipe(ialu_reg_reg_alu0); +%} + instruct divI_rReg(rax_RegI rax, rdx_RegI rdx, no_rax_rdx_RegI div, rFlagsReg cr) %{