mn10300.md (cmpsi): Fix first alternative's output template.
authorMatthew Hiller <hiller@redhat.com>
Thu, 29 Mar 2001 02:32:46 +0000 (02:32 +0000)
committerMatthew Hiller <hiller@gcc.gnu.org>
Thu, 29 Mar 2001 02:32:46 +0000 (02:32 +0000)
2001-03-28  Matthew Hiller  <hiller@redhat.com>

* config/mn10300/mn10300.md (cmpsi): Fix first alternative's
output template.

* MAINTAINERS: Added self.

From-SVN: r40956

MAINTAINERS
gcc/ChangeLog
gcc/config/mn10300/mn10300.md

index 27cb3a61a0154661cd3615a3e4f3f396ec723c8b..49b1cfcabfcc74d20726546084133051e9c0a920 100644 (file)
@@ -124,6 +124,7 @@ Anthony Green                                       green@redhat.com
 Stu Grossman                                   grossman@redhat.com
 Andrew Haley                                   aph@redhat.com
 Aldy Hernandez                                 aldyh@redhat.com
+Matthew Hiller                                 hiller@redhat.com
 Kazu Hirata                                    kazu@hxi.com
 Manfred Hollstein                              mhollstein@redhat.com
 Jan Hubicka                                    hubicka@freesoft.cz
index f9edd3df4277563a7fb75d09595be4e064a7bebe..cc07a8b43003a12d48aeae0448d6be7b5ddc574d 100644 (file)
@@ -1,3 +1,10 @@
+2001-03-28  Matthew Hiller  <hiller@redhat.com>
+
+       * config/mn10300/mn10300.md (cmpsi): Fix first alternative's
+       output template.
+
+       * MAINTAINERS: Added self.
+       
 2001-03-28  Richard Henderson  <rth@redhat.com>
 
        * Makefile.in (cs-tconfig.h): Depend on CONFIG_H, not GCONFIG_H.
index 564a4c95d34c1627c2ed76aee53bf3bc0051d720..bf913b23b72e84ea79cbb0c41465acf1860c6106 100644 (file)
   "* 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")])
 \f
 ;; ----------------------------------------------------------------------
 ;; ADD INSTRUCTIONS