]> gcc.gnu.org Git - gcc.git/commitdiff
mips.c (movdi_operand): Direct referances to symbols that arn't mips16 consts in...
authorGavin Koch <gavin@cygnus.com>
Thu, 12 Feb 1998 08:37:06 +0000 (08:37 +0000)
committerGavin Romig-Koch <gavin@gcc.gnu.org>
Thu, 12 Feb 1998 08:37:06 +0000 (08:37 +0000)
* mips/mips.c (movdi_operand): Direct referances to symbols
that arn't mips16 consts in mips16 mode arn't valid operands.
* mips/mips.c (mips_move_2words): Add gprel handling.

From-SVN: r17867

gcc/ChangeLog
gcc/config/mips/mips.c

index f72266e006a71f02b48bc0161b5df4a0ccc13498..e4a07cb2a67b42a0a2a84b0240c3903991ad1e34 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 12 11:34:55 1998  Gavin Koch  <gavin@cygnus.com>
+
+       * mips/mips.c (movdi_operand): Direct referances to symbols
+       that arn't mips16 consts in mips16 mode arn't valid operands.
+
+       * mips/mips.c (mips_move_2words): Add gprel handling.
+
 Thu Feb 12 11:18:37 1998  Gavin Koch  <gavin@cygnus.com>
 
        * mips.md (extendsidi2): Allow extension to/from a non-mips16 
index 072fb860f960f4b49a87df634954c1ef61419356..b7774b3f9c5148dec30a6eab65031223229cbd87 100644 (file)
@@ -985,7 +985,10 @@ movdi_operand (op, mode)
          || immediate_operand (XEXP (op, 0), SImode)))
     return 1;
 
-  return general_operand (op, mode);
+  return (general_operand (op, mode)
+         && ! (TARGET_MIPS16
+               && GET_CODE (op) == SYMBOL_REF
+               && ! mips16_constant (op, mode, 1, 0)));
 }
 
 /* Like register_operand, but when in 64 bit mode also accept a sign
@@ -2316,9 +2319,7 @@ mips_move_2words (operands, insn)
            }
        }
 
-      else if (code1 == LABEL_REF
-              || code1 == SYMBOL_REF
-              || code1 == CONST)
+      else if (code1 == LABEL_REF)
        {
          if (TARGET_STATS)
            mips_count_memory_refs (op1, 2);
@@ -2332,6 +2333,45 @@ mips_move_2words (operands, insn)
          else
            ret = "dla\t%0,%a1";
        }
+      else if (code1 == SYMBOL_REF
+              || code1 == CONST)
+       {
+         if (TARGET_MIPS16
+             && code1 == CONST
+             && GET_CODE (XEXP (op1, 0)) == REG
+             && REGNO (XEXP (op1, 0)) == GP_REG_FIRST + 28)
+           {
+             /* This case arises on the mips16; see
+                 mips16_gp_pseudo_reg.  */
+             ret = "move\t%0,%+";
+           }
+         else if (TARGET_MIPS16
+                  && code1 == SYMBOL_REF
+                  && SYMBOL_REF_FLAG (op1)
+                  && (XSTR (op1, 0)[0] != '*'
+                      || strncmp (XSTR (op1, 0) + 1,
+                                  LOCAL_LABEL_PREFIX,
+                                  sizeof LOCAL_LABEL_PREFIX - 1) != 0))
+           {
+             /* This can occur when reloading the address of a GP
+                 relative symbol on the mips16.  */
+             ret = "move\t%0,%+\n\taddu\t%0,%%gprel(%a1)";
+           }
+         else
+           {
+             if (TARGET_STATS)
+               mips_count_memory_refs (op1, 2);
+
+             if (GET_CODE (operands[1]) == SIGN_EXTEND)
+               /* We deliberately remove the 'a' from '%1', so that we don't
+                  have to add SIGN_EXTEND support to print_operand_address.
+                  print_operand will just call print_operand_address in this
+                  case, so there is no problem.  */
+               ret = "la\t%0,%1";
+             else
+               ret = "dla\t%0,%a1";
+           }
+       }
     }
 
   else if (code0 == MEM)
This page took 0.0953619999999999 seconds and 5 git commands to generate.