aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2011-06-22 15:29:43 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2011-06-22 08:29:43 -0700
commit3b4c46d71190ead2f7fdde4d04103f4e838ced68 (patch)
tree2628566a9ecc6a9553aeb308765b83d66da9f49a
parent4399cf590fbac5aa65ff0e44e8e5dade5741773f (diff)
downloadgcc-3b4c46d71190ead2f7fdde4d04103f4e838ced68.zip
gcc-3b4c46d71190ead2f7fdde4d04103f4e838ced68.tar.gz
gcc-3b4c46d71190ead2f7fdde4d04103f4e838ced68.tar.bz2
Check TARGET_PARTIAL_REG_STALL in imul to lea peepholes.
2011-06-22 H.J. Lu <hongjiu.lu@intel.com> PR target/49497 * config/i386/i386.md (*lea_general_2): Always allow SImode. (*lea_general_2_zext): Likewise. (imul to lea peepholes): Use const359_operand and check TARGET_PARTIAL_REG_STALL. * config/i386/predicates.md (const359_operand): New. From-SVN: r175295
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/i386/i386.md22
-rw-r--r--gcc/config/i386/predicates.md8
3 files changed, 30 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 125a9b2..b643f7c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2011-06-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/49497
+ * config/i386/i386.md (*lea_general_2): Always allow SImode.
+ (*lea_general_2_zext): Likewise.
+ (imul to lea peepholes): Use const359_operand and check
+ TARGET_PARTIAL_REG_STALL.
+
+ * config/i386/predicates.md (const359_operand): New.
+
2011-06-22 Michael Matz <matz@suse.de>
* cgraphunit.c (assemble_thunk): Use correct return type.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 204cb4f..2b1da4c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -6287,7 +6287,9 @@
(match_operand 3 "nonmemory_operand" "ri")))]
"(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && (!TARGET_PARTIAL_REG_STALL
+ || GET_MODE (operands[0]) == SImode
+ || optimize_function_for_size_p (cfun))
&& GET_MODE (operands[0]) == GET_MODE (operands[1])
&& (GET_MODE (operands[0]) == GET_MODE (operands[3])
|| GET_MODE (operands[3]) == VOIDmode)"
@@ -6338,7 +6340,9 @@
(match_operand 4 "immediate_operand" "i")))]
"(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && (!TARGET_PARTIAL_REG_STALL
+ || GET_MODE (operands[0]) == SImode
+ || optimize_function_for_size_p (cfun))
&& GET_MODE (operands[0]) == GET_MODE (operands[1])
&& GET_MODE (operands[0]) == GET_MODE (operands[3])"
"#"
@@ -17199,11 +17203,11 @@
[(parallel
[(set (match_operand:SWI48 0 "register_operand" "")
(mult:SWI48 (match_operand:SWI48 1 "register_operand" "")
- (match_operand:SWI48 2 "const_int_operand" "")))
+ (match_operand:SWI48 2 "const359_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
- "INTVAL (operands[2]) == 3
- || INTVAL (operands[2]) == 5
- || INTVAL (operands[2]) == 9"
+ "!TARGET_PARTIAL_REG_STALL
+ || <MODE>mode == SImode
+ || optimize_function_for_size_p (cfun)"
[(set (match_dup 0)
(plus:SWI48 (mult:SWI48 (match_dup 1) (match_dup 2))
(match_dup 1)))]
@@ -17213,12 +17217,10 @@
[(parallel
[(set (match_operand:SWI48 0 "register_operand" "")
(mult:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "")
- (match_operand:SWI48 2 "const_int_operand" "")))
+ (match_operand:SWI48 2 "const359_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
"optimize_insn_for_speed_p ()
- && (INTVAL (operands[2]) == 3
- || INTVAL (operands[2]) == 5
- || INTVAL (operands[2]) == 9)"
+ && (!TARGET_PARTIAL_REG_STALL || <MODE>mode == SImode)"
[(set (match_dup 0) (match_dup 1))
(set (match_dup 0)
(plus:SWI48 (mult:SWI48 (match_dup 0) (match_dup 2))
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 358d04f..2c75147 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -606,6 +606,14 @@
return i == 2 || i == 4 || i == 8;
})
+;; Match 3, 5, or 9. Used for leal multiplicands.
+(define_predicate "const359_operand"
+ (match_code "const_int")
+{
+ HOST_WIDE_INT i = INTVAL (op);
+ return i == 3 || i == 5 || i == 9;
+})
+
;; Match 0 or 1.
(define_predicate "const_0_to_1_operand"
(and (match_code "const_int")