From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68835 invoked by alias); 1 May 2015 14:31:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 66862 invoked by uid 89); 1 May 2015 14:31:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 May 2015 14:31:30 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-26.uk.mimecast.lan; Fri, 01 May 2015 15:31:27 +0100 Received: from [10.2.207.50] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 1 May 2015 15:31:27 +0100 Message-ID: <55438E3F.8050205@arm.com> Date: Fri, 01 May 2015 14:31:00 -0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Ramana Radhakrishnan , Richard Earnshaw Subject: [PATCH][ARM] Add debug dumping of cost table fields X-MC-Unique: 4K8TLXVQRWicTfkjG0yAfg-1 Content-Type: multipart/mixed; boundary="------------050906070104010409070708" X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00054.txt.bz2 This is a multi-part message in MIME format. --------------050906070104010409070708 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 778 Hi all, This patch adds a macro to wrap cost field accesses into a helpful debug du= mp, saying which field is being accessed at what line and with what values. This helped me track down cases where the costs were doing the wrong thing by allowing me to see which path in arm_new_rtx_costs was taken. For example, the combine log might now contain: Trying 2 -> 6: Successfully matched this instruction: (set (reg:SI 115 [ D.5348 ]) (neg:SI (reg:SI 0 r0 [ a ]))) using extra_cost->alu.arith with cost 0 from line 10506 which can be useful in debugging the rtx costs. Bootstrapped and tested on arm. Ok for trunk? Thanks, Kyrill 2015-05-01 Kyrylo Tkachov * config/arm/arm.c (DBG_COST): New macro. (arm_new_rtx_costs): Use above. --------------050906070104010409070708 Content-Type: text/x-patch; name=arm-debug-cost-fields.patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="arm-debug-cost-fields.patch" Content-length: 35111 commit 554c118dd2c232a62e2e504f9af3bfcb417ce7c3 Author: Kyrylo Tkachov Date: Thu Apr 2 13:37:20 2015 +0100 [ARM] Add debug dumping of cost table fields. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 4abd38a..a460d76 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -9684,6 +9684,11 @@ arm_unspec_cost (rtx x, enum rtx_code /* outer_code = */, bool speed_p, int *cost) } \ while (0); =20 + +#define DBG_COST(F) ((dump_file && (dump_flags & TDF_DETAILS) \ + ? fprintf (dump_file, "using "#F" with cost %d from line %d\n", \ + (F), __LINE__) : 0), (F)) + /* RTX costs. Make an estimate of the cost of executing the operation X, which is contained with an operation with code OUTER_CODE. SPEED_P indicates whether the cost desired is the performance cost, @@ -9784,7 +9789,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, + arm_address_cost (XEXP (x, 0), mode, ADDR_SPACE_GENERIC, speed_p)); #else - *cost +=3D extra_cost->ldst.load; + *cost +=3D DBG_COST (extra_cost->ldst.load); #endif return true; =20 @@ -9812,11 +9817,11 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { HOST_WIDE_INT nregs =3D XVECLEN (x, 0); HOST_WIDE_INT regs_per_insn_1st =3D is_ldm - ? extra_cost->ldst.ldm_regs_per_insn_1st - : extra_cost->ldst.stm_regs_per_insn_1st; + ? DBG_COST (extra_cost->ldst.ldm_regs_per_insn_1st) + : DBG_COST (extra_cost->ldst.stm_regs_per_insn_1st); HOST_WIDE_INT regs_per_insn_sub =3D is_ldm - ? extra_cost->ldst.ldm_regs_per_insn_subsequent - : extra_cost->ldst.stm_regs_per_insn_subsequent; + ? DBG_COST (extra_cost->ldst.ldm_regs_per_insn_subsequent) + : DBG_COST (extra_cost->ldst.stm_regs_per_insn_subsequent); =20 *cost +=3D regs_per_insn_1st + COSTS_N_INSNS (((MAX (nregs - regs_per_insn_1st, 0)) @@ -9833,9 +9838,10 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum r= tx_code outer_code, if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) =3D=3D MODE_FLOAT && (mode =3D=3D SFmode || !TARGET_VFP_SINGLE)) *cost +=3D COSTS_N_INSNS (speed_p - ? extra_cost->fp[mode !=3D SFmode].div : 0); + ? DBG_COST (extra_cost->fp[mode !=3D SFmode].div) : 0); else if (mode =3D=3D SImode && TARGET_IDIV) - *cost +=3D COSTS_N_INSNS (speed_p ? extra_cost->mult[0].idiv : 0); + *cost +=3D COSTS_N_INSNS (speed_p ? DBG_COST (extra_cost->mult[0].idiv) + : 0); else *cost =3D LIBCALL_COST (2); return false; /* All arguments must be in registers. */ @@ -9851,7 +9857,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, *cost +=3D (COSTS_N_INSNS (1) + rtx_cost (XEXP (x, 0), code, 0, speed_p)); if (speed_p) - *cost +=3D extra_cost->alu.shift_reg; + *cost +=3D DBG_COST (extra_cost->alu.shift_reg); return true; } /* Fall through */ @@ -9864,7 +9870,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, *cost +=3D (COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), code, 0, speed_p)); if (speed_p) - *cost +=3D 2 * extra_cost->alu.shift; + *cost +=3D DBG_COST (2 * extra_cost->alu.shift); return true; } else if (mode =3D=3D SImode) @@ -9872,7 +9878,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); /* Slightly disparage register shifts at -Os, but not by much. */ if (!CONST_INT_P (XEXP (x, 1))) - *cost +=3D (speed_p ? extra_cost->alu.shift_reg : 1 + *cost +=3D (speed_p ? DBG_COST (extra_cost->alu.shift_reg) : 1 + rtx_cost (XEXP (x, 1), code, 1, speed_p)); return true; } @@ -9885,7 +9891,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, /* Slightly disparage register shifts at -Os, but not by much. */ if (!CONST_INT_P (XEXP (x, 1))) - *cost +=3D (speed_p ? extra_cost->alu.shift_reg : 1 + *cost +=3D (speed_p ? DBG_COST (extra_cost->alu.shift_reg) : 1 + rtx_cost (XEXP (x, 1), code, 1, speed_p)); } else if (code =3D=3D LSHIFTRT || code =3D=3D ASHIFTRT) @@ -9894,7 +9900,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, { /* Can use SBFX/UBFX. */ if (speed_p) - *cost +=3D extra_cost->alu.bfx; + *cost +=3D DBG_COST (extra_cost->alu.bfx); *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); } else @@ -9904,10 +9910,10 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (speed_p) { if (CONST_INT_P (XEXP (x, 1))) - *cost +=3D 2 * extra_cost->alu.shift; + *cost +=3D 2 * DBG_COST (extra_cost->alu.shift); else - *cost +=3D (extra_cost->alu.shift - + extra_cost->alu.shift_reg); + *cost +=3D (DBG_COST (extra_cost->alu.shift) + + DBG_COST (extra_cost->alu.shift_reg)); } else /* Slightly disparage register shifts. */ @@ -9921,12 +9927,12 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (speed_p) { if (CONST_INT_P (XEXP (x, 1))) - *cost +=3D (2 * extra_cost->alu.shift - + extra_cost->alu.log_shift); + *cost +=3D (DBG_COST (2 * extra_cost->alu.shift) + + DBG_COST (extra_cost->alu.log_shift)); else - *cost +=3D (extra_cost->alu.shift - + extra_cost->alu.shift_reg - + extra_cost->alu.log_shift_reg); + *cost +=3D (DBG_COST (extra_cost->alu.shift) + + DBG_COST (extra_cost->alu.shift_reg) + + DBG_COST (extra_cost->alu.log_shift_reg)); } } return true; @@ -9941,7 +9947,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, if (mode =3D=3D SImode) { if (speed_p) - *cost +=3D extra_cost->alu.rev; + *cost +=3D DBG_COST (extra_cost->alu.rev); =20 return false; } @@ -9956,8 +9962,8 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, =20 if (speed_p) { - *cost +=3D 6 * extra_cost->alu.shift; - *cost +=3D 3 * extra_cost->alu.logical; + *cost +=3D DBG_COST (6 * extra_cost->alu.shift); + *cost +=3D DBG_COST (3 * extra_cost->alu.logical); } } else @@ -9966,9 +9972,9 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, =20 if (speed_p) { - *cost +=3D 2 * extra_cost->alu.shift; - *cost +=3D extra_cost->alu.arith_shift; - *cost +=3D 2 * extra_cost->alu.logical; + *cost +=3D DBG_COST (2 * extra_cost->alu.shift); + *cost +=3D DBG_COST (extra_cost->alu.arith_shift); + *cost +=3D DBG_COST (2 * extra_cost->alu.logical); } } return true; @@ -9985,7 +9991,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rt= x_code outer_code, rtx mul_op0, mul_op1, sub_op; =20 if (speed_p) - *cost +=3D extra_cost->fp[mode !=3D SFmode].mult_addsub; + *cost +=3D DBG_COST (extra_cost->fp[mode !=3D SFmode].mult_addsub); =20 if (GET_CODE (XEXP (x, 0)) =3D=3D MULT) { @@ -10013,7 +10019,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, } =20 if (speed_p) - *cost +=3D extra_cost->fp[mode !=3D SFmode].addsub; + *cost +=3D DBG_COST (extra_cost->fp[mode !=3D SFmode].addsub); return false; } =20 @@ -10037,11 +10043,11 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, if (shift_by_reg !=3D NULL) { if (speed_p) - *cost +=3D extra_cost->alu.arith_shift_reg; + *cost +=3D DBG_COST (extra_cost->alu.arith_shift_reg); *cost +=3D rtx_cost (shift_by_reg, code, 0, speed_p); } else if (speed_p) - *cost +=3D extra_cost->alu.arith_shift; + *cost +=3D DBG_COST (extra_cost->alu.arith_shift); =20 *cost +=3D (rtx_cost (shift_op, code, 0, speed_p) + rtx_cost (non_shift_op, code, 0, speed_p)); @@ -10053,7 +10059,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { /* MLS. */ if (speed_p) - *cost +=3D extra_cost->mult[0].add; + *cost +=3D DBG_COST (extra_cost->mult[0].add); *cost +=3D (rtx_cost (XEXP (x, 0), MINUS, 0, speed_p) + rtx_cost (XEXP (XEXP (x, 1), 0), MULT, 0, speed_p) + rtx_cost (XEXP (XEXP (x, 1), 1), MULT, 1, speed_p)); @@ -10067,12 +10073,12 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, NULL_RTX, 1, 0); *cost =3D COSTS_N_INSNS (insns); if (speed_p) - *cost +=3D insns * extra_cost->alu.arith; + *cost +=3D insns * DBG_COST (extra_cost->alu.arith); *cost +=3D rtx_cost (XEXP (x, 1), code, 1, speed_p); return true; } else if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); =20 return false; } @@ -10092,7 +10098,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, /* Slightly disparage, as we might need to widen the result. */ *cost +=3D 1; if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); =20 if (CONST_INT_P (XEXP (x, 0))) { @@ -10112,7 +10118,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, rtx op1 =3D XEXP (x, 1); =20 if (speed_p) - *cost +=3D 2 * extra_cost->alu.arith; + *cost +=3D DBG_COST (2 * extra_cost->alu.arith); =20 if (GET_CODE (op1) =3D=3D ZERO_EXTEND) *cost +=3D rtx_cost (XEXP (op1, 0), ZERO_EXTEND, 0, speed_p); @@ -10125,7 +10131,8 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, else if (GET_CODE (XEXP (x, 0)) =3D=3D SIGN_EXTEND) { if (speed_p) - *cost +=3D extra_cost->alu.arith + extra_cost->alu.arith_shift; + *cost +=3D DBG_COST (extra_cost->alu.arith + + extra_cost->alu.arith_shift); *cost +=3D (rtx_cost (XEXP (XEXP (x, 0), 0), SIGN_EXTEND, 0, speed_p) + rtx_cost (XEXP (x, 1), MINUS, 1, speed_p)); @@ -10135,10 +10142,10 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, || GET_CODE (XEXP (x, 1)) =3D=3D SIGN_EXTEND) { if (speed_p) - *cost +=3D (extra_cost->alu.arith + *cost +=3D (DBG_COST (extra_cost->alu.arith) + (GET_CODE (XEXP (x, 1)) =3D=3D ZERO_EXTEND - ? extra_cost->alu.arith - : extra_cost->alu.arith_shift)); + ? DBG_COST (extra_cost->alu.arith) + : DBG_COST (extra_cost->alu.arith_shift))); *cost +=3D (rtx_cost (XEXP (x, 0), MINUS, 0, speed_p) + rtx_cost (XEXP (XEXP (x, 1), 0), GET_CODE (XEXP (x, 1)), 0, speed_p)); @@ -10146,7 +10153,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, } =20 if (speed_p) - *cost +=3D 2 * extra_cost->alu.arith; + *cost +=3D DBG_COST (2 * extra_cost->alu.arith); return false; } =20 @@ -10164,7 +10171,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, rtx mul_op0, mul_op1, add_op; =20 if (speed_p) - *cost +=3D extra_cost->fp[mode !=3D SFmode].mult_addsub; + *cost +=3D DBG_COST (extra_cost->fp[mode !=3D SFmode].mult_addsub); =20 mul_op0 =3D XEXP (XEXP (x, 0), 0); mul_op1 =3D XEXP (XEXP (x, 0), 1); @@ -10178,7 +10185,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, } =20 if (speed_p) - *cost +=3D extra_cost->fp[mode !=3D SFmode].addsub; + *cost +=3D DBG_COST (extra_cost->fp[mode !=3D SFmode].addsub); return false; } else if (GET_MODE_CLASS (mode) =3D=3D MODE_FLOAT) @@ -10206,7 +10213,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, NULL_RTX, 1, 0); *cost =3D COSTS_N_INSNS (insns); if (speed_p) - *cost +=3D insns * extra_cost->alu.arith; + *cost +=3D insns * DBG_COST (extra_cost->alu.arith); /* Slightly penalize a narrow operation as the result may need widening. */ *cost +=3D 1 + rtx_cost (XEXP (x, 0), PLUS, 0, speed_p); @@ -10217,7 +10224,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, need widening. */ *cost +=3D 1; if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); =20 return false; } @@ -10232,7 +10239,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { /* UXTA[BH] or SXTA[BH]. */ if (speed_p) - *cost +=3D extra_cost->alu.extend_arith; + *cost +=3D DBG_COST (extra_cost->alu.extend_arith); *cost +=3D (rtx_cost (XEXP (XEXP (x, 0), 0), ZERO_EXTEND, 0, speed_p) + rtx_cost (XEXP (x, 1), PLUS, 0, speed_p)); @@ -10246,11 +10253,11 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, if (shift_reg) { if (speed_p) - *cost +=3D extra_cost->alu.arith_shift_reg; + *cost +=3D DBG_COST (extra_cost->alu.arith_shift_reg); *cost +=3D rtx_cost (shift_reg, ASHIFT, 1, speed_p); } else if (speed_p) - *cost +=3D extra_cost->alu.arith_shift; + *cost +=3D DBG_COST (extra_cost->alu.arith_shift); =20 *cost +=3D (rtx_cost (shift_op, ASHIFT, 0, speed_p) + rtx_cost (XEXP (x, 1), PLUS, 1, speed_p)); @@ -10277,7 +10284,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { /* SMLA[BT][BT]. */ if (speed_p) - *cost +=3D extra_cost->mult[0].extend_add; + *cost +=3D DBG_COST (extra_cost->mult[0].extend_add); *cost +=3D (rtx_cost (XEXP (XEXP (mul_op, 0), 0), SIGN_EXTEND, 0, speed_p) + rtx_cost (XEXP (XEXP (mul_op, 1), 0), @@ -10300,12 +10307,12 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, NULL_RTX, 1, 0); *cost =3D COSTS_N_INSNS (insns); if (speed_p) - *cost +=3D insns * extra_cost->alu.arith; + *cost +=3D insns * DBG_COST (extra_cost->alu.arith); *cost +=3D rtx_cost (XEXP (x, 0), PLUS, 0, speed_p); return true; } else if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); =20 return false; } @@ -10320,7 +10327,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, && GET_CODE (XEXP (XEXP (x, 0), 1)) =3D=3D SIGN_EXTEND))) { if (speed_p) - *cost +=3D extra_cost->mult[1].extend_add; + *cost +=3D DBG_COST (extra_cost->mult[1].extend_add); *cost +=3D (rtx_cost (XEXP (XEXP (XEXP (x, 0), 0), 0), ZERO_EXTEND, 0, speed_p) + rtx_cost (XEXP (XEXP (XEXP (x, 0), 1), 0), @@ -10335,10 +10342,10 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, || GET_CODE (XEXP (x, 0)) =3D=3D SIGN_EXTEND) { if (speed_p) - *cost +=3D (extra_cost->alu.arith + *cost +=3D (DBG_COST (extra_cost->alu.arith) + (GET_CODE (XEXP (x, 0)) =3D=3D ZERO_EXTEND - ? extra_cost->alu.arith - : extra_cost->alu.arith_shift)); + ? DBG_COST (extra_cost->alu.arith) + : DBG_COST (extra_cost->alu.arith_shift))); =20 *cost +=3D (rtx_cost (XEXP (XEXP (x, 0), 0), ZERO_EXTEND, 0, speed_p) @@ -10347,7 +10354,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, } =20 if (speed_p) - *cost +=3D 2 * extra_cost->alu.arith; + *cost +=3D DBG_COST (2 * extra_cost->alu.arith); return false; } =20 @@ -10362,7 +10369,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, *cost +=3D rtx_cost (inner, BSWAP, 0 , speed_p); =20 if (speed_p) - *cost +=3D extra_cost->alu.rev; + *cost +=3D DBG_COST (extra_cost->alu.rev); =20 return true; } @@ -10387,11 +10394,11 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, if (shift_reg) { if (speed_p) - *cost +=3D extra_cost->alu.log_shift_reg; + *cost +=3D DBG_COST (extra_cost->alu.log_shift_reg); *cost +=3D rtx_cost (shift_reg, ASHIFT, 1, speed_p); } else if (speed_p) - *cost +=3D extra_cost->alu.log_shift; + *cost +=3D DBG_COST (extra_cost->alu.log_shift); =20 *cost +=3D (rtx_cost (shift_op, ASHIFT, 0, speed_p) + rtx_cost (XEXP (x, 1), code, 1, speed_p)); @@ -10406,13 +10413,13 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, =20 *cost =3D COSTS_N_INSNS (insns); if (speed_p) - *cost +=3D insns * extra_cost->alu.logical; + *cost +=3D insns * DBG_COST (extra_cost->alu.logical); *cost +=3D rtx_cost (op0, code, 0, speed_p); return true; } =20 if (speed_p) - *cost +=3D extra_cost->alu.logical; + *cost +=3D DBG_COST (extra_cost->alu.logical); *cost +=3D (rtx_cost (op0, code, 0, speed_p) + rtx_cost (XEXP (x, 1), code, 1, speed_p)); return true; @@ -10433,7 +10440,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (GET_CODE (op0) =3D=3D ZERO_EXTEND) { if (speed_p) - *cost +=3D 2 * extra_cost->alu.logical; + *cost +=3D DBG_COST (2 * extra_cost->alu.logical); =20 *cost +=3D (rtx_cost (XEXP (op0, 0), ZERO_EXTEND, 0, speed_p) + rtx_cost (XEXP (x, 1), code, 0, speed_p)); @@ -10442,7 +10449,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, else if (GET_CODE (op0) =3D=3D SIGN_EXTEND) { if (speed_p) - *cost +=3D extra_cost->alu.logical + extra_cost->alu.log_shift; + *cost +=3D DBG_COST (extra_cost->alu.logical + extra_cost->alu.log_shift= ); =20 *cost +=3D (rtx_cost (XEXP (op0, 0), SIGN_EXTEND, 0, speed_p) + rtx_cost (XEXP (x, 1), code, 0, speed_p)); @@ -10450,7 +10457,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, } =20 if (speed_p) - *cost +=3D 2 * extra_cost->alu.logical; + *cost +=3D DBG_COST (2 * extra_cost->alu.logical); =20 return true; } @@ -10469,7 +10476,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, op0 =3D XEXP (op0, 0); =20 if (speed_p) - *cost +=3D extra_cost->fp[mode !=3D SFmode].mult; + *cost +=3D DBG_COST (extra_cost->fp[mode !=3D SFmode].mult); =20 *cost +=3D (rtx_cost (op0, MULT, 0, speed_p) + rtx_cost (XEXP (x, 1), MULT, 1, speed_p)); @@ -10500,13 +10507,13 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, { /* SMUL[TB][TB]. */ if (speed_p) - *cost +=3D extra_cost->mult[0].extend; + *cost +=3D DBG_COST (extra_cost->mult[0].extend); *cost +=3D (rtx_cost (XEXP (x, 0), SIGN_EXTEND, 0, speed_p) + rtx_cost (XEXP (x, 1), SIGN_EXTEND, 0, speed_p)); return true; } if (speed_p) - *cost +=3D extra_cost->mult[0].simple; + *cost +=3D DBG_COST (extra_cost->mult[0].simple); return false; } =20 @@ -10519,7 +10526,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, && GET_CODE (XEXP (x, 1)) =3D=3D SIGN_EXTEND))) { if (speed_p) - *cost +=3D extra_cost->mult[1].extend; + *cost +=3D DBG_COST (extra_cost->mult[1].extend); *cost +=3D (rtx_cost (XEXP (XEXP (x, 0), 0), ZERO_EXTEND, 0, speed_p) + rtx_cost (XEXP (XEXP (x, 1), 0), @@ -10540,7 +10547,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, && (mode =3D=3D SFmode || !TARGET_VFP_SINGLE)) { if (speed_p) - *cost +=3D extra_cost->fp[mode !=3D SFmode].neg; + *cost +=3D DBG_COST (extra_cost->fp[mode !=3D SFmode].neg); =20 return false; } @@ -10557,8 +10564,8 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, *cost +=3D COSTS_N_INSNS (1); /* Assume the non-flag-changing variant. */ if (speed_p) - *cost +=3D (extra_cost->alu.log_shift - + extra_cost->alu.arith_shift); + *cost +=3D (DBG_COST (extra_cost->alu.log_shift) + + DBG_COST (extra_cost->alu.arith_shift)); *cost +=3D rtx_cost (XEXP (XEXP (x, 0), 0), ABS, 0, speed_p); return true; } @@ -10580,13 +10587,13 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, + rtx_cost (XEXP (XEXP (x, 0), 1), COMPARE, 1, speed_p)); if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); } return true; } =20 if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); return false; } =20 @@ -10596,7 +10603,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, /* Slightly disparage, as we might need an extend operation. */ *cost +=3D 1; if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); return false; } =20 @@ -10604,7 +10611,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D 2 * extra_cost->alu.arith; + *cost +=3D 2 * DBG_COST (extra_cost->alu.arith); return false; } =20 @@ -10625,17 +10632,17 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, if (shift_reg !=3D NULL) { if (speed_p) - *cost +=3D extra_cost->alu.log_shift_reg; + *cost +=3D DBG_COST (extra_cost->alu.log_shift_reg); *cost +=3D rtx_cost (shift_reg, ASHIFT, 1, speed_p); } else if (speed_p) - *cost +=3D extra_cost->alu.log_shift; + *cost +=3D DBG_COST (extra_cost->alu.log_shift); *cost +=3D rtx_cost (shift_op, ASHIFT, 0, speed_p); return true; } =20 if (speed_p) - *cost +=3D extra_cost->alu.logical; + *cost +=3D DBG_COST (extra_cost->alu.logical); return false; } if (mode =3D=3D DImode) @@ -10672,9 +10679,9 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (speed_p) { if (extra_cost->alu.non_exec_costs_exec) - *cost +=3D op1cost + op2cost + extra_cost->alu.non_exec; + *cost +=3D op1cost + op2cost + DBG_COST (extra_cost->alu.non_exec); else - *cost +=3D MAX (op1cost, op2cost) + extra_cost->alu.non_exec; + *cost +=3D MAX (op1cost, op2cost) + DBG_COST (extra_cost->alu.non_exec= ); } else *cost +=3D op1cost + op2cost; @@ -10697,7 +10704,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, && (op0mode =3D=3D SFmode || !TARGET_VFP_SINGLE)) { if (speed_p) - *cost +=3D extra_cost->fp[op0mode !=3D SFmode].compare; + *cost +=3D DBG_COST (extra_cost->fp[op0mode !=3D SFmode].compare); =20 if (XEXP (x, 1) =3D=3D CONST0_RTX (op0mode)) { @@ -10718,7 +10725,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D 2 * extra_cost->alu.arith; + *cost +=3D DBG_COST (2 * extra_cost->alu.arith); return false; } =20 @@ -10739,14 +10746,14 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, if (speed_p && GET_CODE (XEXP (x, 0)) =3D=3D MULT && !power_of_two_operand (XEXP (XEXP (x, 0), 1), mode)) - *cost +=3D extra_cost->mult[0].flag_setting; + *cost +=3D DBG_COST (extra_cost->mult[0].flag_setting); =20 if (speed_p && GET_CODE (XEXP (x, 0)) =3D=3D PLUS && GET_CODE (XEXP (XEXP (x, 0), 0)) =3D=3D MULT && !power_of_two_operand (XEXP (XEXP (XEXP (x, 0), 0), 1), mode)) - *cost +=3D extra_cost->mult[0].flag_setting; + *cost +=3D DBG_COST (extra_cost->mult[0].flag_setting); return true; } =20 @@ -10758,17 +10765,17 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, { *cost +=3D rtx_cost (shift_reg, ASHIFT, 1, speed_p); if (speed_p) - *cost +=3D extra_cost->alu.arith_shift_reg; + *cost +=3D DBG_COST (extra_cost->alu.arith_shift_reg); } else if (speed_p) - *cost +=3D extra_cost->alu.arith_shift; + *cost +=3D DBG_COST (extra_cost->alu.arith_shift); *cost +=3D (rtx_cost (shift_op, ASHIFT, 0, speed_p) + rtx_cost (XEXP (x, 1), COMPARE, 1, speed_p)); return true; } =20 if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); if (CONST_INT_P (XEXP (x, 1)) && const_ok_for_op (INTVAL (XEXP (x, 1)), COMPARE)) { @@ -10820,7 +10827,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, case LT: /* LSR Rd, Rn, #31. */ if (speed_p) - *cost +=3D extra_cost->alu.shift; + *cost +=3D DBG_COST (extra_cost->alu.shift); break; =20 case EQ: @@ -10838,7 +10845,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, ADC Rd, Rn, T1. */ *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D extra_cost->alu.arith_shift; + *cost +=3D DBG_COST (extra_cost->alu.arith_shift); break; =20 case GT: @@ -10846,8 +10853,8 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, LSR Rd, Rd, #31. */ *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D (extra_cost->alu.arith_shift - + extra_cost->alu.shift); + *cost +=3D (DBG_COST (extra_cost->alu.arith_shift) + + DBG_COST (extra_cost->alu.shift)); break; =20 case GE: @@ -10855,7 +10862,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, ADD Rd, Rn, #1. */ *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D extra_cost->alu.shift; + *cost +=3D DBG_COST (extra_cost->alu.shift); break; =20 default: @@ -10898,7 +10905,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, && (mode =3D=3D SFmode || !TARGET_VFP_SINGLE)) { if (speed_p) - *cost +=3D extra_cost->fp[mode !=3D SFmode].neg; + *cost +=3D DBG_COST (extra_cost->fp[mode !=3D SFmode].neg); =20 return false; } @@ -10911,7 +10918,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (mode =3D=3D SImode) { if (speed_p) - *cost +=3D extra_cost->alu.log_shift + extra_cost->alu.arith_shift; + *cost +=3D DBG_COST (extra_cost->alu.log_shift + extra_cost->alu.arit= h_shift); return false; } /* Vector mode? */ @@ -10931,12 +10938,12 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, return true; =20 if (GET_MODE (XEXP (x, 0)) =3D=3D SImode) - *cost +=3D extra_cost->ldst.load; + *cost +=3D DBG_COST (extra_cost->ldst.load); else - *cost +=3D extra_cost->ldst.load_sign_extend; + *cost +=3D DBG_COST (extra_cost->ldst.load_sign_extend); =20 if (mode =3D=3D DImode) - *cost +=3D extra_cost->alu.shift; + *cost +=3D DBG_COST (extra_cost->alu.shift); =20 return true; } @@ -10947,7 +10954,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, /* We have SXTB/SXTH. */ *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); if (speed_p) - *cost +=3D extra_cost->alu.extend; + *cost +=3D DBG_COST (extra_cost->alu.extend); } else if (GET_MODE (XEXP (x, 0)) !=3D SImode) { @@ -10955,7 +10962,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, *cost +=3D COSTS_N_INSNS (1); *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); if (speed_p) - *cost +=3D 2 * extra_cost->alu.shift; + *cost +=3D DBG_COST (2 * extra_cost->alu.shift); } =20 /* Widening beyond 32-bits requires one more insn. */ @@ -10963,7 +10970,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D extra_cost->alu.shift; + *cost +=3D DBG_COST (extra_cost->alu.shift); } =20 return true; @@ -10991,14 +10998,14 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, AND, and we don't really model 16-bit vs 32-bit insns here. */ if (speed_p) - *cost +=3D extra_cost->alu.logical; + *cost +=3D DBG_COST (extra_cost->alu.logical); } else if (GET_MODE (XEXP (x, 0)) !=3D SImode && arm_arch6) { /* We have UXTB/UXTH. */ *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); if (speed_p) - *cost +=3D extra_cost->alu.extend; + *cost +=3D DBG_COST (extra_cost->alu.extend); } else if (GET_MODE (XEXP (x, 0)) !=3D SImode) { @@ -11009,7 +11016,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, *cost +=3D COSTS_N_INSNS (1); *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); if (speed_p) - *cost +=3D 2 * extra_cost->alu.shift; + *cost +=3D DBG_COST (2 * extra_cost->alu.shift); } =20 /* Widening beyond 32-bits requires one more insn. */ @@ -11070,7 +11077,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (arm_arch_thumb2 && !flag_pic) *cost +=3D COSTS_N_INSNS (1); else - *cost +=3D extra_cost->ldst.load; + *cost +=3D DBG_COST (extra_cost->ldst.load); } else *cost +=3D COSTS_N_INSNS (1); @@ -11079,7 +11086,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, { *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D extra_cost->alu.arith; + *cost +=3D DBG_COST (extra_cost->alu.arith); } =20 return true; @@ -11096,16 +11103,16 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, if (vfp3_const_double_rtx (x)) { if (speed_p) - *cost +=3D extra_cost->fp[mode =3D=3D DFmode].fpconst; + *cost +=3D DBG_COST (extra_cost->fp[mode =3D=3D DFmode].fpconst); return true; } =20 if (speed_p) { if (mode =3D=3D DFmode) - *cost +=3D extra_cost->ldst.loadd; + *cost +=3D DBG_COST (extra_cost->ldst.loadd); else - *cost +=3D extra_cost->ldst.loadf; + *cost +=3D DBG_COST (extra_cost->ldst.loadf); } else *cost +=3D COSTS_N_INSNS (1 + (mode =3D=3D DFmode)); @@ -11136,14 +11143,14 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, =20 case CLZ: if (speed_p) - *cost +=3D extra_cost->alu.clz; + *cost +=3D DBG_COST (extra_cost->alu.clz); return false; =20 case SMIN: if (XEXP (x, 1) =3D=3D const0_rtx) { if (speed_p) - *cost +=3D extra_cost->alu.log_shift; + *cost +=3D DBG_COST (extra_cost->alu.log_shift); *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); return true; } @@ -11166,7 +11173,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, =3D=3D ZERO_EXTEND)))) { if (speed_p) - *cost +=3D extra_cost->mult[1].extend; + *cost +=3D DBG_COST (extra_cost->mult[1].extend); *cost +=3D (rtx_cost (XEXP (XEXP (XEXP (x, 0), 0), 0), ZERO_EXTEND, 0, speed_p) + rtx_cost (XEXP (XEXP (XEXP (x, 0), 0), 1), ZERO_EXTEND, @@ -11195,14 +11202,14 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enu= m rtx_code outer_code, && CONST_INT_P (XEXP (x, 2))) { if (speed_p) - *cost +=3D extra_cost->alu.bfx; + *cost +=3D DBG_COST (extra_cost->alu.bfx); *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); return true; } /* Without UBFX/SBFX, need to resort to shift operations. */ *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D 2 * extra_cost->alu.shift; + *cost +=3D DBG_COST (2 * extra_cost->alu.shift); *cost +=3D rtx_cost (XEXP (x, 0), ASHIFT, 0, speed_p); return true; =20 @@ -11210,7 +11217,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (TARGET_HARD_FLOAT) { if (speed_p) - *cost +=3D extra_cost->fp[mode =3D=3D DFmode].widen; + *cost +=3D DBG_COST (extra_cost->fp[mode =3D=3D DFmode].widen); if (!TARGET_FPU_ARMV8 && GET_MODE (XEXP (x, 0)) =3D=3D HFmode) { @@ -11218,7 +11225,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, widening to SFmode. */ *cost +=3D COSTS_N_INSNS (1); if (speed_p) - *cost +=3D extra_cost->fp[0].widen; + *cost +=3D DBG_COST (extra_cost->fp[0].widen); } *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); return true; @@ -11231,7 +11238,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (TARGET_HARD_FLOAT) { if (speed_p) - *cost +=3D extra_cost->fp[mode =3D=3D DFmode].narrow; + *cost +=3D DBG_COST (extra_cost->fp[mode =3D=3D DFmode].narrow); *cost +=3D rtx_cost (XEXP (x, 0), code, 0, speed_p); return true; /* Vector modes? */ @@ -11260,7 +11267,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, *cost +=3D rtx_cost (op2, FMA, 2, speed_p); =20 if (speed_p) - *cost +=3D extra_cost->fp[mode =3D=3DDFmode].fma; + *cost +=3D DBG_COST (extra_cost->fp[mode =3D=3DDFmode].fma); =20 return true; } @@ -11275,7 +11282,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, if (GET_MODE_CLASS (mode) =3D=3D MODE_INT) { if (speed_p) - *cost +=3D extra_cost->fp[GET_MODE (XEXP (x, 0)) =3D=3D DFmode].toint; + *cost +=3D DBG_COST (extra_cost->fp[GET_MODE (XEXP (x, 0)) =3D=3D DFmode= ].toint); /* Strip of the 'cost' of rounding towards zero. */ if (GET_CODE (XEXP (x, 0)) =3D=3D FIX) *cost +=3D rtx_cost (XEXP (XEXP (x, 0), 0), code, 0, speed_p); @@ -11289,7 +11296,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, && TARGET_FPU_ARMV8) { if (speed_p) - *cost +=3D extra_cost->fp[mode =3D=3D DFmode].roundint; + *cost +=3D DBG_COST (extra_cost->fp[mode =3D=3D DFmode].roundint); return false; } /* Vector costs? */ @@ -11304,7 +11311,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum = rtx_code outer_code, /* ??? Increase the cost to deal with transferring from CORE -> FP registers? */ if (speed_p) - *cost +=3D extra_cost->fp[mode =3D=3D DFmode].fromint; + *cost +=3D DBG_COST (extra_cost->fp[mode =3D=3D DFmode].fromint); return false; } *cost =3D LIBCALL_COST (1); --------------050906070104010409070708--