Fix abs not to use powerpc instructions on -mcpu=common
authorMichael Meissner <meissner@gcc.gnu.org>
Wed, 3 May 1995 18:49:09 +0000 (18:49 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 3 May 1995 18:49:09 +0000 (18:49 +0000)
From-SVN: r9569

gcc/config/rs6000/rs6000.md

index a7c28a482ffb4ec6da789dc7aebb12368e4986c8..629eeeca575c958f605aa0ce1eede4d10437cf16 100644 (file)
        (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
    (clobber (match_scratch:SI 2 "=&r,&r"))]
   "!TARGET_POWER"
-  "{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%2,%0"
+  "*
+{
+  return (TARGET_POWERPC)
+    ? \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%2,%0\"
+    : \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;{sf|subfc} %0,%2,%0\";
+}"
   [(set_attr "length" "12")])
 
 (define_split
        (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
    (clobber (match_scratch:SI 2 "=&r,&r"))]
   "!TARGET_POWER"
-  "{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%0,%2"
+  "*
+{
+  return (TARGET_POWERPC)
+    ? \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%0,%2\"
+    : \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;{sf|subfc} %0,%0,%2\";
+}"
   [(set_attr "length" "12")])
 
 (define_split