Allow 64bit Leas (2 shifts and 1 add)
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 8 Oct 2010 21:28:23 +0000 (21:28 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Fri, 8 Oct 2010 21:28:23 +0000 (21:28 +0000)
[r28085]

ir/be/ia32/ia32_architecture.c

index 1b08816..0c00c89 100644 (file)
@@ -464,7 +464,8 @@ int ia32_evaluate_insn(insn_kind kind, const ir_mode *mode, ir_tarval *tv)
                /* lea is only supported for 32 bit */
                if (get_mode_size_bits(mode) <= 32)
                        return arch_costs->lea_cost;
-               return 0x10000;
+               /* in 64bit mode, the Lea cost are at wort 2 shifts and one add */
+               return 2 * arch_costs->add_cost + 2 * (2 * arch_costs->const_shf_cost);
        case ADD:
        case SUB:
                if (get_mode_size_bits(mode) <= 32)