From: Richard Sandiford Date: Sun, 21 Oct 2007 10:05:43 +0000 (+0000) Subject: gcc/ X-Git-Tag: releases/gcc-4.3.0~1895 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d375fd5e624cae69a5ee67519b645cc062f6ae8b;p=thirdparty%2Fgcc.git gcc/ * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ab5dc76b9c51..b2356a6eb044 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-10-21 Richard Sandiford + + * 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 * config/mips/mips.c (mips_cannot_change_mode_class): Don't check diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 92d85afdafb4..9a839c438400 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -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 { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4ed9bce2034b..a0b4c2e1f715 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-10-21 Richard Sandiford + + * 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 Revital Eres diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp index 7fcf8277da67..7a542065376b 100644 --- a/gcc/testsuite/gcc.target/mips/mips.exp +++ b/gcc/testsuite/gcc.target/mips/mips.exp @@ -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 {