comparison 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
comparison
equal deleted inserted replaced
132:60b728ec77c1 145:f3de1255b035
8073 ins_encode(REX_reg_mem_wide(dst, src), 8073 ins_encode(REX_reg_mem_wide(dst, src),
8074 OpcSE(imm), reg_mem(dst, src), Con8or32(imm)); 8074 OpcSE(imm), reg_mem(dst, src), Con8or32(imm));
8075 ins_pipe(ialu_reg_mem_alu0); 8075 ins_pipe(ialu_reg_mem_alu0);
8076 %} 8076 %}
8077 8077
8078 instruct mulHiL_rReg(rdx_RegL dst, no_rax_RegL src, rax_RegL rax, rFlagsReg cr)
8079 %{
8080 match(Set dst (MulHiL src rax));
8081 effect(USE_KILL rax, KILL cr);
8082
8083 ins_cost(300);
8084 format %{ "imulq RDX:RAX, RAX, $src\t# mulhi" %}
8085 opcode(0xF7, 0x5); /* Opcode F7 /5 */
8086 ins_encode(REX_reg_wide(src), OpcP, reg_opc(src));
8087 ins_pipe(ialu_reg_reg_alu0);
8088 %}
8089
8078 instruct divI_rReg(rax_RegI rax, rdx_RegI rdx, no_rax_rdx_RegI div, 8090 instruct divI_rReg(rax_RegI rax, rdx_RegI rdx, no_rax_rdx_RegI div,
8079 rFlagsReg cr) 8091 rFlagsReg cr)
8080 %{ 8092 %{
8081 match(Set rax (DivI rax div)); 8093 match(Set rax (DivI rax div));
8082 effect(KILL rdx, KILL cr); 8094 effect(KILL rdx, KILL cr);