diff mbox

[5/5] rs6000: Do not allow TImode with -m32 -mpowerpc64

Message ID 687b2e40d388708e5b7604b1fcc1ce7e4b127b5b.1421282067.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool Jan. 15, 2015, 1:14 a.m. UTC
This fixes 141 FAILs.

-mpowerpc64 does not change the ABI, but default_scalar_mode_supported_p
does not know that, and allows TImode for -m32 -mpowerpc64.

This fixes it.  Okay for mainline?


2015-01-14  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	* config/rs6000/rs6000.c (rs6000_scalar_mode_supported_p): Disallow
	TImode for TARGET_32BIT.

---
 gcc/config/rs6000/rs6000.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

David Edelsohn Jan. 15, 2015, 4:06 p.m. UTC | #1
On Wed, Jan 14, 2015 at 8:14 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> This fixes 141 FAILs.
>
> -mpowerpc64 does not change the ABI, but default_scalar_mode_supported_p
> does not know that, and allows TImode for -m32 -mpowerpc64.
>
> This fixes it.  Okay for mainline?
>
>
> 2015-01-14  Segher Boessenkool  <segher@kernel.crashing.org>
>
> gcc/
>         * config/rs6000/rs6000.c (rs6000_scalar_mode_supported_p): Disallow
>         TImode for TARGET_32BIT.

Okay.

Would you please add a comment that efficient TImode arithmetic
requires carry to explain the TARGET_32BIT relationship?

We can think about providing TImode logical operations in 32 bit, in
the long run.

Thanks, David
Segher Boessenkool Jan. 16, 2015, 4:55 p.m. UTC | #2
On Thu, Jan 15, 2015 at 11:06:38AM -0500, David Edelsohn wrote:
> On Wed, Jan 14, 2015 at 8:14 PM, Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
> > This fixes 141 FAILs.
> >
> > -mpowerpc64 does not change the ABI, but default_scalar_mode_supported_p
> > does not know that, and allows TImode for -m32 -mpowerpc64.

> Would you please add a comment that efficient TImode arithmetic
> requires carry to explain the TARGET_32BIT relationship?

I expanded the comment to:

  /* -m32 does not support TImode.  This is the default, from
     default_scalar_mode_supported_p.  For -m32 -mpowerpc64 we want the
     same ABI as for -m32.  But default_scalar_mode_supported_p allows
     integer modes of precision 2 * BITS_PER_WORD, which matches TImode
     for -mpowerpc64.  */

because the reasons why we do or do not suppoort TImode with -m32 are
pretty much irrelevant here.  Hope that's okay.

> We can think about providing TImode logical operations in 32 bit, in
> the long run.

Generic code would handle that just fine already, AFAICS.  We just do
not allow TImode at all (like most (all?) other 32-bit targets).


Segher
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 6c91f3c..8fa9a22 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -31960,6 +31960,10 @@  rs6000_eh_return_filter_mode (void)
 static bool
 rs6000_scalar_mode_supported_p (machine_mode mode)
 {
+  /* For -m32 -mpowerpc64 we want the same ABI as for -m32.  */
+  if (TARGET_32BIT && mode == TImode)
+    return false;
+
   if (DECIMAL_FLOAT_MODE_P (mode))
     return default_decimal_float_supported_p ();
   else