aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Essick <essick@ddna.labs.mot.com>2000-08-18 21:11:23 +0000
committerNick Clifton <nickc@gcc.gnu.org>2000-08-18 21:11:23 +0000
commit477d303f84bcf6da0c51c2aea9fbe213d04803d1 (patch)
tree25614ba13be37ceb968c37226e5bcc8833028044
parent7d2950e52384ed32ca712f28460645d8ca35c97f (diff)
downloadgcc-477d303f84bcf6da0c51c2aea9fbe213d04803d1.zip
gcc-477d303f84bcf6da0c51c2aea9fbe213d04803d1.tar.gz
gcc-477d303f84bcf6da0c51c2aea9fbe213d04803d1.tar.bz2
Only allow allow rotations by a constant amount.
Do not generate ROTL instruction. From-SVN: r35797
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mcore/mcore.md26
2 files changed, 23 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2b97062..53183a0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-18 Ray Essick <essick@ddna.labs.mot.com> & Nick Clifton <nickc@redhat.com>
+
+ * config/mcore/mcore.md (rotlsi3): Allow allow rotations by a
+ constant amount. Do not generate ROTL instruction.
+
Fri Aug 18 16:22:20 2000 Alexandre Oliva <aoliva@redhat.com>
* config/sh/elf.h: Do not include sh/sh.h.
diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md
index 6c64561..fa659a3 100644
--- a/gcc/config/mcore/mcore.md
+++ b/gcc/config/mcore/mcore.md
@@ -505,15 +505,25 @@
;; Shifts and rotates
;; -------------------------------------------------------------------------
-;;; ??? The reg case may never match.
-(define_insn "rotlsi3"
- [(set (match_operand:SI 0 "mcore_arith_reg_operand" "=r,r")
- (rotate:SI (match_operand:SI 1 "mcore_arith_reg_operand" "0,0")
- (match_operand:SI 2 "mcore_arith_K_operand_not_0" "r,K")))]
+;; Only allow these if the shift count is a convenient constant.
+(define_expand "rotlsi3"
+ [(set (match_operand:SI 0 "mcore_arith_reg_operand" "")
+ (rotate:SI (match_operand:SI 1 "mcore_arith_reg_operand" "")
+ (match_operand:SI 2 "nonmemory_operand" "")))]
+ ""
+ "if (! mcore_literal_K_operand (operands[2], SImode))
+ FAIL;
+ ")
+
+;; We can only do constant rotates, which is what this pattern provides.
+;; The combiner will put it together for us when we do:
+;; (x << N) | (x >> (32 - N))
+(define_insn ""
+ [(set (match_operand:SI 0 "mcore_arith_reg_operand" "=r")
+ (rotate:SI (match_operand:SI 1 "mcore_arith_reg_operand" "0")
+ (match_operand:SI 2 "mcore_literal_K_operand" "K")))]
""
- "@
- rotl %0,%2
- rotli %0,%2"
+ "rotli %0,%2"
[(set_attr "type" "shift")])
(define_insn "ashlsi3"