aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-09-19 15:42:00 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1992-09-19 15:42:00 -0400
commit95ac8e67bcb7a8a4454c7cf2e48ee1cbd639992b (patch)
tree9fdb998d89f3b2fe518746ed42e687c065564da8 /gcc
parentdf3d94ed38439480dca837415ccd2181d982a23c (diff)
downloadgcc-95ac8e67bcb7a8a4454c7cf2e48ee1cbd639992b.zip
gcc-95ac8e67bcb7a8a4454c7cf2e48ee1cbd639992b.tar.gz
gcc-95ac8e67bcb7a8a4454c7cf2e48ee1cbd639992b.tar.bz2
(smax, smin, umax, umin): Add define_splits.
From-SVN: r2169
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/rs6000/rs6000.md29
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 90947d1..9da114a 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -271,7 +271,8 @@
;; For SMIN, SMAX, UMIN, and UMAX, we use DEFINE_EXPAND's that involve a doz[i]
;; instruction and some auxiliary computations. Then we just have a single
-;; DEFINE_INSN for doz[i].
+;; DEFINE_INSN for doz[i] and the define_splits to make them if made by
+;; combine.
(define_expand "sminsi3"
[(set (match_dup 3)
@@ -285,6 +286,19 @@
"
{ operands[3] = gen_reg_rtx (SImode); }")
+(define_split
+ [(set (match_operand:SI 0 "gpc_reg_operand" "")
+ (smin:SI (match_operand:SI 1 "gpc_reg_operand" "")
+ (match_operand:SI 2 "reg_or_short_operand" "")))
+ (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
+ ""
+ [(set (match_dup 3)
+ (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
+ (const_int 0)
+ (minus:SI (match_dup 2) (match_dup 1))))
+ (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 3)))]
+ "")
+
(define_expand "smaxsi3"
[(set (match_dup 3)
(if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
@@ -297,6 +311,19 @@
"
{ operands[3] = gen_reg_rtx (SImode); }")
+(define_split
+ [(set (match_operand:SI 0 "gpc_reg_operand" "")
+ (smax:SI (match_operand:SI 1 "gpc_reg_operand" "")
+ (match_operand:SI 2 "reg_or_short_operand" "")))
+ (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
+ ""
+ [(set (match_dup 3)
+ (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
+ (const_int 0)
+ (minus:SI (match_dup 2) (match_dup 1))))
+ (set (match_dup 0) (plus:SI (match_dup 3) (match_dup 1)))]
+ "")
+
(define_expand "uminsi3"
[(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
(const_int -2147483648)))