aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1999-01-16 07:20:21 -0700
committerJeff Law <law@gcc.gnu.org>1999-01-16 07:20:21 -0700
commit854b494a9ef17692e2daabf8fa0c478161becd41 (patch)
tree1478417804bf129c77b6cb619e26614fcb3606c0 /gcc
parent4fbf29af0241943f2649c27e052e116006f46954 (diff)
downloadgcc-854b494a9ef17692e2daabf8fa0c478161becd41.zip
gcc-854b494a9ef17692e2daabf8fa0c478161becd41.tar.gz
gcc-854b494a9ef17692e2daabf8fa0c478161becd41.tar.bz2
pa.md (shadd): Create shadd insns, even if the result of the shift is needed without the addition.
0 * pa.md (shadd): Create shadd insns, even if the result of the shift is needed without the addition. From-SVN: r24700
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/pa/pa.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index c502a26..ada7553 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -3627,6 +3627,42 @@
[(set_attr "type" "binary")
(set_attr "length" "4")])
+;; This anonymous pattern and splitter wins because it reduces the latency
+;; of the shadd sequence without increasing the latency of the shift.
+;;
+;; We want to make sure and split up the operations for the scheduler since
+;; these instructions can (and should) schedule independently.
+;;
+;; It would be clearer if combine used the same operator for both expressions,
+;; it's somewhat confusing to have a mult in ine operation and an ashift
+;; in the other.
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r")
+ (match_operand:SI 3 "shadd_operand" ""))
+ (match_operand:SI 1 "register_operand" "r")))
+ (set (match_operand:SI 4 "register_operand" "=r")
+ (ashift:SI (match_dup 2)
+ (match_operand:SI 5 "const_int_operand" "i")))]
+ "INTVAL (operands[5]) == exact_log2 (INTVAL (operands[3]))"
+ "#"
+ [(set_attr "type" "binary")
+ (set_attr "length" "8")])
+
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r")
+ (match_operand:SI 3 "shadd_operand" ""))
+ (match_operand:SI 1 "register_operand" "r")))
+ (set (match_operand:SI 4 "register_operand" "=r")
+ (ashift:SI (match_dup 2)
+ (match_operand:SI 5 "const_int_operand" "i")))]
+ "INTVAL (operands[5]) == exact_log2 (INTVAL (operands[3]))"
+ [(set (match_dup 4) (ashift:SI (match_dup 2) (match_dup 5)))
+ (set (match_dup 0) (plus:SI (mult:SI (match_dup 2) (match_dup 3))
+ (match_dup 1)))]
+ "")
+
;; This variant of the above insn can occur if the first operand
;; is the frame pointer. This is a kludge, but there doesn't
;; seem to be a way around it. Only recognize it while reloading.