]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Sep 2007 22:21:57 +0000 (22:21 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Sep 2007 22:21:57 +0000 (22:21 +0000)
* config/mips/mips.c (build_mips16_call_stub): Tidy.  Fix second
GPR for DCmode on 64-bit targets.  Remove redundant fallback.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128608 138bc75d-0d04-0410-961f-82ee72b054a4

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

index f336b12422722d1407343fec9454d4e9a74e416a..b550aa24cd55948ae09d19094417dc81c0e19934 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-19  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * config/mips/mips.c (build_mips16_call_stub): Tidy.  Fix second
+       GPR for DCmode on 64-bit targets.  Remove redundant fallback.
+
 2007-09-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        * cfgexpand.c (dump_stack_var_partition): Use the correct
index 6a4a1d90ff3b19c10943aaba7dda9f2c885d956e..7f959f41a21859b5b52cb61e3153ab60dfbc1551 100644 (file)
@@ -10045,50 +10045,30 @@ build_mips16_call_stub (rtx retval, rtx fn, rtx arg_size, int fp_code)
          fprintf (asm_out_file, "\tjal\t%s\n", fnname);
          /* As above, we can't fill the delay slot.  */
          fprintf (asm_out_file, "\tnop\n");
-         if (GET_MODE (retval) == SFmode)
-           fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
-                    reg_names[GP_REG_FIRST + 2], reg_names[FP_REG_FIRST + 0]);
-         else if (GET_MODE (retval) == SCmode)
-           {
-             fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
-                      reg_names[GP_REG_FIRST + 2],
-                      reg_names[FP_REG_FIRST + 0]);
+         switch (GET_MODE (retval))
+           {
+           case SCmode:
              fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
                       reg_names[GP_REG_FIRST + 3],
                       reg_names[FP_REG_FIRST + MAX_FPRS_PER_FMT]);
-           }
-         else if (GET_MODE (retval) == DFmode
-                  || GET_MODE (retval) == V2SFmode)
-           {
-             mips16_fpret_double (GP_REG_FIRST + 2, FP_REG_FIRST + 0);
-           }
-         else if (GET_MODE (retval) == DCmode)
-           {
-             mips16_fpret_double (GP_REG_FIRST + 2,
-                                  FP_REG_FIRST + 0);
-             mips16_fpret_double (GP_REG_FIRST + 4,
+             /* Fall though.  */
+           case SFmode:
+             fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
+                      reg_names[GP_REG_FIRST + 2],
+                      reg_names[FP_REG_FIRST + 0]);
+             break;
+
+           case DCmode:
+             mips16_fpret_double (GP_REG_FIRST + 2 + (8 / UNITS_PER_WORD),
                                   FP_REG_FIRST + MAX_FPRS_PER_FMT);
-           }
-         else
-           {
-             if (TARGET_BIG_ENDIAN)
-               {
-                 fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
-                          reg_names[GP_REG_FIRST + 2],
-                          reg_names[FP_REG_FIRST + 1]);
-                 fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
-                          reg_names[GP_REG_FIRST + 3],
-                          reg_names[FP_REG_FIRST + 0]);
-               }
-             else
-               {
-                 fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
-                          reg_names[GP_REG_FIRST + 2],
-                          reg_names[FP_REG_FIRST + 0]);
-                 fprintf (asm_out_file, "\tmfc1\t%s,%s\n",
-                          reg_names[GP_REG_FIRST + 3],
-                          reg_names[FP_REG_FIRST + 1]);
-               }
+             /* Fall though.  */
+           case DFmode:
+           case V2SFmode:
+             mips16_fpret_double (GP_REG_FIRST + 2, FP_REG_FIRST + 0);
+             break;
+
+           default:
+             gcc_unreachable ();
            }
          fprintf (asm_out_file, "\tj\t%s\n", reg_names[GP_REG_FIRST + 18]);
          /* As above, we can't fill the delay slot.  */