aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-12-10 06:03:23 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-12-10 06:03:23 -0500
commit85644414f92af929ab88c7a06e6d131df09a3e3c (patch)
tree1dc6a1c4d62b7da8a48c5e491466b108a6e8469e
parent34aaacec0ef88f10710110dcfdb294b7a2d40336 (diff)
downloadgcc-85644414f92af929ab88c7a06e6d131df09a3e3c.zip
gcc-85644414f92af929ab88c7a06e6d131df09a3e3c.tar.gz
gcc-85644414f92af929ab88c7a06e6d131df09a3e3c.tar.bz2
(modsi3): Rework to operate correctly for both POWER and PowerPC.
From-SVN: r6198
-rw-r--r--gcc/config/rs6000/rs6000.md20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 27156f9..55a09c5 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -763,24 +763,24 @@
}")
(define_expand "modsi3"
- [(set (match_dup 3)
- (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
- (match_operand:SI 2 "reg_or_cint_operand" "")))
- (parallel [(set (match_dup 4) (ashift:SI (match_dup 3) (match_dup 5)))
- (clobber (scratch:SI))])
- (set (match_operand:SI 0 "gpc_reg_operand" "")
- (minus:SI (match_dup 1) (match_dup 4)))]
+ [(use (match_operand:SI 0 "gpc_reg_operand" ""))
+ (use (match_operand:SI 1 "gpc_reg_operand" ""))
+ (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
""
"
{
int i = exact_log2 (INTVAL (operands[2]));
+ rtx temp1 = gen_reg_rtx (SImode);
+ rtx temp2 = gen_reg_rtx (SImode);
if (GET_CODE (operands[2]) != CONST_INT || i < 0)
FAIL;
- operands[3] = gen_reg_rtx (SImode);
- operands[4] = gen_reg_rtx (SImode);
- operands[5] = gen_rtx (CONST_INT, VOIDmode, i);
+ emit_insn (gen_divsi3 (temp1, operands[1], operands[2]));
+ emit_insn (gen_ashlsi3 (temp2, temp1, GEN_INT (i)));
+ emit_insn (gen_subsi3 (operands[0], operands[1], temp2));
+ DONE;
+
}")
(define_insn ""