*** empty log message ***
authorMichael Meissner <meissner@gcc.gnu.org>
Wed, 8 Apr 1992 02:49:42 +0000 (02:49 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 8 Apr 1992 02:49:42 +0000 (02:49 +0000)
From-SVN: r702

gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mips/mips.md
gcc/halfpic.h

index 068abf19c5edf50826f50b992b171c2cb860bc27..821caaf80d1434115512a4729920eea680fdf72a 100644 (file)
@@ -590,34 +590,6 @@ simple_memory_operand (op, mode)
   return FALSE;
 }
 
-/* Return true if the address is suitable for function call.  */
-
-int
-call_memory_operand (op, mode)
-     rtx op;
-     enum machine_mode mode;
-{
-  rtx addr;
-  enum rtx_code code;
-
-  if (GET_CODE (op) != MEM)
-    return FALSE;
-
-  addr = XEXP (op, 0);
-  code = GET_CODE (addr);
-
-  if (GET_MODE (addr) != FUNCTION_MODE)
-    return FALSE;
-
-  if (code == REG || code == SUBREG)
-    return TRUE;
-
-  if (CONSTANT_ADDRESS_P (addr))
-    return TRUE;
-
-  return FALSE;
-}
-
 /* Return true if the code of this rtx pattern is EQ or NE.  */
 
 int
index 25b783ebfd56bcc4e52a85c6492cfb44d192d231..2d05266397bd2006262b0b6b6f381bbc980aa319 100644 (file)
@@ -105,7 +105,6 @@ extern struct rtx_def *mips_load_reg4;      /* 4th reg to check for load delay */
 extern void            abort_with_insn ();
 extern int             arith32_operand ();
 extern int             arith_operand ();
-extern int             call_memory_operand ();
 extern int             cmp_op ();
 extern int             cmp2_op ();
 extern unsigned long   compute_frame_size ();
@@ -1992,7 +1991,7 @@ __enable_execute_stack (addr)                                             \
    addition to `const_int' and `const_double' expressions.  */
 
 #define CONSTANT_ADDRESS_P(X)                                          \
-  (CONSTANT_P (X) && (!HALF_PIC_P () || HALF_PIC_ADDRESS_P (X)))
+  (CONSTANT_P (X) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X)))
 
 
 /* Nonzero if the constant value X is a legitimate general operand.
@@ -2449,7 +2448,6 @@ while (0)
   {"md_register_operand",      { REG }},                               \
   {"mips_const_double_ok",     { CONST_DOUBLE }},                      \
   {"simple_memory_operand",    { MEM, SUBREG }},                       \
-  {"call_memory_operand",      { MEM, SUBREG }},                       \
   {"equality_op",              { EQ, NE }},                            \
   {"cmp_op",                   { EQ, NE, GT, GE, GTU, GEU, LT, LE,     \
                                  LTU, LEU }},                          \
index bf6afdc75781ee8c42f04cfcf0e319a0377e0afd..97b571e984ccd1968715128d864bfe55d14257fe 100644 (file)
@@ -3540,7 +3540,7 @@ move\\t%0,%z4\\n\\
 ;; calls.c now passes a third argument, make saber happy
 
 (define_expand "call"
-  [(parallel [(call (match_operand 0 "call_memory_operand" "m")
+  [(parallel [(call (match_operand 0 "memory_operand" "m")
                    (match_operand 1 "" "i"))
              (clobber (match_operand 2 "" ""))])]      ;; overwrite op2 with $31
   ""
@@ -3551,12 +3551,12 @@ move\\t%0,%z4\\n\\
   operands[2] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
 
   addr = XEXP (operands[0], 0);
-  if (! call_memory_operand (addr, VOIDmode))
+  if (GET_CODE (addr) != REG && !CONSTANT_ADDRESS_P (addr))
     XEXP (operands[0], 0) = force_reg (FUNCTION_MODE, addr);
 }")
 
 (define_insn "call_internal"
-  [(call (match_operand 0 "call_memory_operand" "m")
+  [(call (match_operand 0 "memory_operand" "m")
         (match_operand 1 "" "i"))
    (clobber (match_operand:SI 2 "register_operand" "=d"))]
   ""
@@ -3582,7 +3582,7 @@ move\\t%0,%z4\\n\\
 
 (define_expand "call_value"
   [(parallel [(set (match_operand 0 "register_operand" "=df")
-                  (call (match_operand 1 "call_memory_operand" "m")
+                  (call (match_operand 1 "memory_operand" "m")
                         (match_operand 2 "" "i")))
              (clobber (match_operand 3 "" ""))])]      ;; overwrite op3 with $31
   ""
@@ -3593,13 +3593,13 @@ move\\t%0,%z4\\n\\
   operands[3] = gen_rtx (REG, SImode, GP_REG_FIRST + 31);
 
   addr = XEXP (operands[1], 0);
-  if (! call_memory_operand (addr, VOIDmode))
+  if (GET_CODE (addr) != REG && !CONSTANT_ADDRESS_P (addr))
     XEXP (operands[1], 0) = force_reg (FUNCTION_MODE, addr);
 }")
 
 (define_insn "call_value_internal"
   [(set (match_operand 0 "register_operand" "=df")
-        (call (match_operand 1 "call_memory_operand" "m")
+        (call (match_operand 1 "memory_operand" "m")
               (match_operand 2 "" "i")))
    (clobber (match_operand:SI 3 "register_operand" "=d"))]
   ""
index 3dd309145e6195709e4f8427f563b7180cfa9766..0b8a61c76d86da6d04613e63f5f78da38208326a 100644 (file)
@@ -17,10 +17,12 @@ You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-extern int flag_half_pic;              /* Global half-pic flag.  */
+extern int  flag_half_pic;             /* Global half-pic flag.  */
 extern void half_pic_encode ();                /* encode whether half-pic */
 extern void half_pic_init ();          /* half_pic initialization */
-extern int half_pic_address_p ();      /* true if an address is half-pic */
+extern void half_pic_finish ();                /* half_pic termination */
+extern int  half_pic_address_p ();     /* true if an address is half-pic */
+extern struct rtx_def *half_pic_ptr ();        /* return RTX for half-pic pointer */
 
 /* Macros to provide access to the half-pic stuff (so they can easily
    be stubbed out.  */
@@ -28,4 +30,11 @@ extern int half_pic_address_p ();    /* true if an address is half-pic */
 #define HALF_PIC_P()           (flag_half_pic)
 #define HALF_PIC_ENCODE(DECL)  half_pic_encode (DECL)
 #define HALF_PIC_INIT()                half_pic_init ()
-#define HALF_PIC_ADDRESS_P(X)  (flag_half_pic && half_pic_address_p (X))
+#define HALF_PIC_FINISH(STREAM)        half_pic_finish (STREAM)
+#define HALF_PIC_ADDRESS_P(X)  half_pic_address_p (X)
+#define HALF_PIC_PTR(X)                half_pic_ptr (X)
+
+/* Prefix for half-pic names */
+#ifndef HALF_PIC_PREFIX
+#define        HALF_PIC_PREFIX "__pic_"
+#endif