aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-06-15 20:40:39 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-06-15 20:40:39 -0400
commitb6b12107a9dd00bfd182214f55b923685ab4e9fb (patch)
treea25c329be4cd630ff92d51be15689a487bbae298
parentf63184aca66eaab4eee2369604f70dfc15caa516 (diff)
downloadgcc-b6b12107a9dd00bfd182214f55b923685ab4e9fb.zip
gcc-b6b12107a9dd00bfd182214f55b923685ab4e9fb.tar.gz
gcc-b6b12107a9dd00bfd182214f55b923685ab4e9fb.tar.bz2
(divsi3): Fix divide by 2^N with compare RTL.
From-SVN: r7498
-rw-r--r--gcc/config/rs6000/rs6000.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 3bff980..ee9b8d6 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1254,8 +1254,9 @@
(define_insn ""
[(set (match_operand:CC 0 "cc_reg_operand" "=x")
- (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:SI 2 "const_int_operand" "N")))
+ (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:SI 2 "const_int_operand" "N"))
+ (const_int 0)))
(clobber (match_scratch:SI 3 "=r"))]
"exact_log2 (INTVAL (operands[2])) >= 0"
"{srai|srawi} %3,%1,%p2\;{aze.|addze.} %3,%3"
@@ -1264,8 +1265,9 @@
(define_insn ""
[(set (match_operand:CC 3 "cc_reg_operand" "=x")
- (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:SI 2 "const_int_operand" "N")))
+ (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:SI 2 "const_int_operand" "N"))
+ (const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(div:SI (match_dup 1) (match_dup 2)))]
"exact_log2 (INTVAL (operands[2])) >= 0"