summaryrefslogtreecommitdiff
path: root/gcc/config/mn10300
diff options
context:
space:
mode:
authorhiller <hiller@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-29 02:32:46 +0000
committerhiller <hiller@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-29 02:32:46 +0000
commit26f0753fad09f8b29e47e60a19508a304b5d3154 (patch)
tree62b821db395e83b74400dea719d7f47b4f80b576 /gcc/config/mn10300
parent9461b3505a0e61471edec0ff577f3be5c1fba395 (diff)
downloadgcc-26f0753fad09f8b29e47e60a19508a304b5d3154.tar.gz
2001-03-28 Matthew Hiller <hiller@redhat.com>
* config/mn10300/mn10300.md (cmpsi): Fix first alternative's output template. * MAINTAINERS: Added self. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40956 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mn10300')
-rw-r--r--gcc/config/mn10300/mn10300.md16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index 564a4c95d34..bf913b23b72 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -709,15 +709,23 @@
"* return output_tst (operands[0], insn);"
[(set_attr "cc" "set_znv")])
+;; Ordinarily, the cmp instruction will set the Z bit of cc0 to 1 if
+;; its operands hold equal values, but the operands of a cmp
+;; instruction must be distinct registers. In the case where we'd
+;; like to compare a register to itself, we can achieve this effect
+;; with a btst 0,d0 instead. (This will not alter the contents of d0
+;; but will have the proper effect on cc0. Using d0 is arbitrary; any
+;; data register would work.)
+
(define_insn "cmpsi"
[(set (cc0)
- (compare (match_operand:SI 0 "register_operand" "!*d*a*x,dax")
- (match_operand:SI 1 "nonmemory_operand" "!*0,daxi")))]
+ (compare (match_operand:SI 0 "register_operand" "*d*a*x,dax")
+ (match_operand:SI 1 "nonmemory_operand" "*0,daxi")))]
""
"@
- add 0,%0
+ btst 0,d0
cmp %1,%0"
- [(set_attr "cc" "invert,compare")])
+ [(set_attr "cc" "compare,compare")])
;; ----------------------------------------------------------------------
;; ADD INSTRUCTIONS