(lwa_operand): New predicate.
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 30 Nov 1994 23:22:07 +0000 (18:22 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 30 Nov 1994 23:22:07 +0000 (18:22 -0500)
From-SVN: r8588

gcc/config/rs6000/rs6000.c

index 5d6f9c952ecd312e92da9354bce902190d3e5317..d02a475187952cdeca75a7d589dc3b71c76c7f00 100644 (file)
@@ -468,6 +468,26 @@ reg_or_mem_operand (op, mode)
   return gpc_reg_operand (op, mode) || memory_operand (op, mode);
 }
 
+/* Return 1 if the operand is a general register or memory operand without
+   pre-inc or pre_dec which produces invalid form of PowerPC lwa
+   instruction.  */
+
+int
+lwa_operand (op, mode)
+     register rtx op;
+     register enum machine_mode mode;
+{
+  rtx inner = op;
+
+  if (reload_completed && GET_CODE (inner) == SUBREG)
+    inner = SUBREG_REG (inner);
+    
+  return gpc_reg_operand (inner, mode)
+    || (memory_operand (inner, mode)
+       && GET_CODE (XEXP (inner, 0)) != PRE_INC
+       && GET_CODE (XEXP (inner, 0)) != PRE_DEC);
+}
+
 /* Return 1 if the operand, used inside a MEM, is a valid first argument
    to CALL.  This is a SYMBOL_REF or a pseudo-register, which will be
    forced to lr.  */