aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-10-12 17:14:42 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-10-12 17:14:42 +0000
commitc271ba771118b065187992424ccb86091a4e55a9 (patch)
tree4e44d8868ea25f87b0037dec5b15628c61a1c0f3 /gcc
parent22de4c3dfcc0d6443a131f3c13e24258eab37dd5 (diff)
downloadgcc-c271ba771118b065187992424ccb86091a4e55a9.zip
gcc-c271ba771118b065187992424ccb86091a4e55a9.tar.gz
gcc-c271ba771118b065187992424ccb86091a4e55a9.tar.bz2
re PR rtl-optimization/17931 (andl and testb are not combined)
PR rtl-optimization/17931 * config/i386/i386.c (ix86_rtx_costs): Handle COMPARE with ZERO_EXTRACT in it. From-SVN: r88943
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.c15
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d91d260..6ac3aa1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR rtl-optimization/17931
+ * config/i386/i386.c (ix86_rtx_costs): Handle COMPARE with
+ ZERO_EXTRACT in it.
+
2004-10-12 Richard Earnshaw <rearnsha@arm.com>
* arm.c (arm_print_operand): Use output_operand_lossage where possible
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 540d390..ba51586 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -14326,6 +14326,21 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
*total = COSTS_N_INSNS (ix86_cost->add);
return false;
+ case COMPARE:
+ if (GET_CODE (XEXP (x, 0)) == ZERO_EXTRACT
+ && XEXP (XEXP (x, 0), 1) == const1_rtx
+ && GET_CODE (XEXP (XEXP (x, 0), 2)) == CONST_INT
+ && XEXP (x, 1) == const0_rtx)
+ {
+ /* This kind of construct is implemented using test[bwl].
+ Treat it as if we had an AND. */
+ *total = (COSTS_N_INSNS (ix86_cost->add)
+ + rtx_cost (XEXP (XEXP (x, 0), 0), outer_code)
+ + rtx_cost (const1_rtx, outer_code));
+ return true;
+ }
+ return false;
+
case FLOAT_EXTEND:
if (!TARGET_SSE_MATH || !VALID_SSE_REG_MODE (mode))
*total = 0;