]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/
authorRichard Sandiford <rsandifo@nildram.co.uk>
Sun, 21 Oct 2007 10:05:43 +0000 (10:05 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 21 Oct 2007 10:05:43 +0000 (10:05 +0000)
* config/mips/mips.c (mips_set_mips16_mode) Say sorry for hard-float
MIPS16 code unless using o32 or o64.

gcc/testsuite/
* gcc.target/mips/mips.exp (setup_mips_tests): Set mips_mips16.
(dg-mips-options): Skip tests that specify an ABI other than o32
and o64 if generating MIPS16 hard-float code.

From-SVN: r129530

gcc/ChangeLog
gcc/config/mips/mips.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/mips.exp

index ab5dc76b9c51e38ae9d4434f101a5f3c37964693..b2356a6eb04452d42131b45c4c767a4524abae9a 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-21  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * config/mips/mips.c (mips_set_mips16_mode) Say sorry for hard-float
+       MIPS16 code unless using o32 or o64.  
+
 2007-10-21  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * config/mips/mips.c (mips_cannot_change_mode_class): Don't check
index 92d85afdafb445e3f6a72d0cdcf6bd86c6b4e358..9a839c4384006f01870e57c0fdd8ea8eb75ef6bb 100644 (file)
@@ -11632,6 +11632,9 @@ mips_set_mips16_mode (int mips16_p)
 
       if (flag_pic || TARGET_ABICALLS)
        sorry ("MIPS16 PIC");
+
+      if (TARGET_HARD_FLOAT_ABI && !TARGET_OLDABI)
+       sorry ("hard-float MIPS16 code for ABIs other than o32 and o64");
     }
   else
     {
index 4ed9bce2034b8601fc89fac5db5352349add4e35..a0b4c2e1f7157846aa4c9eb6a32ddfa4f800f1f0 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-21  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * gcc.target/mips/mips.exp (setup_mips_tests): Set mips_mips16.
+       (dg-mips-options): Skip tests that specify an ABI other than o32
+       and o64 if generating MIPS16 hard-float code.
+
 2007-10-21  Ira Rosen  <irar@il.ibm.com>
             Revital Eres  <eres@il.ibm.com>
 
index 7fcf8277da67d3b39a5afb1f9c85e91895fb6114..7a542065376b6ac67e8edf0b526de1f69afcec9d 100644 (file)
@@ -31,6 +31,7 @@ load_lib gcc-dg.exp
 #    $mips_isa:                 the ISA level specified by __mips
 #    $mips_isa_rev:     the ISA revision specified by __mips_isa_rev
 #    $mips_arch:        the architecture specified by _MIPS_ARCH
+#    $mips_mips16:      true if MIPS16 output is selected
 #    $mips_gp:          the number of bytes in a general register
 #    $mips_fp:          the number of bytes in a floating-point register
 #    $mips_float:       "hard" or "soft"
@@ -48,6 +49,7 @@ proc setup_mips_tests {} {
     global mips_isa
     global mips_isa_rev
     global mips_arch
+    global mips_mips16
     global mips_gp
     global mips_fp
     global mips_float
@@ -75,6 +77,9 @@ proc setup_mips_tests {} {
        int isa_rev = 1;
        #endif
        const char *arch = _MIPS_ARCH;
+       #ifdef __mips16
+       int mips16 = 1;
+       #endif
        #ifdef __mips64
        int gp = 64;
        #else
@@ -105,6 +110,7 @@ proc setup_mips_tests {} {
     regexp {isa = ([^;]*)} $output dummy mips_isa
     regexp {isa_rev = ([^;]*)} $output dummy mips_isa_rev
     regexp {arch = "([^"]*)} $output dummy mips_arch
+    set mips_mips16 [regexp {mips16 = 1} $output]
     regexp {gp = ([^;]*)} $output dummy mips_gp
     regexp {fp = ([^;]*)} $output dummy mips_fp
     regexp {float = "([^"]*)} $output dummy mips_float
@@ -145,7 +151,9 @@ proc setup_mips_tests {} {
 #
 #    -mabi=*
 #      Force a particular ABI.  Skip the test if the multilib flags
-#      force a specific ABI or a different register size.
+#      force a specific ABI or a different register size.  If testing
+#      MIPS16 multilibs, try to force -msoft-float for ABIs other than
+#      o32 and o64, and skip the test if this is not possible.
 #
 #    -march=*
 #    -mips*
@@ -183,6 +191,7 @@ proc dg-mips-options {args} {
     global mips_isa
     global mips_isa_rev
     global mips_arch
+    global mips_mips16
     global mips_gp
     global mips_fp
     global mips_float
@@ -205,6 +214,15 @@ proc dg-mips-options {args} {
        if {[string match -mpaired-single $flag]
            && [lsearch $flags -mfp*] < 0} {
            append flags " -mfp64"
+       } elseif {[regexp -- {^-mabi=(.*)} $flag dummy abi]
+                 && $mips_mips16
+                 && $abi != "32"
+                 && $abi != "o64"} {
+           if {[lsearch $flags -mhard-float] >= 0} {
+               set matches 0
+           } else {
+               append flags " -msoft-float"
+           }
        }
     }
     foreach flag $flags {