From 192f2d33a186d7de36534c6695b4b61c0dfbee31 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 3 Jul 2008 12:14:16 +0000 Subject: [PATCH] i386.c (contains_aligned_value_p): Return true for TCmode. gcc/ 2008-07-03 H.J. Lu * config/i386/i386.c (contains_aligned_value_p): Return true for TCmode. (ix86_data_alignment): Align TCmode to 128bits. (ix86_local_alignment): Likewise. testsuite/ 2008-07-03 H.J. Lu Uros Bizjak * gcc.target/i386/float128-1.c: New. Co-Authored-By: Uros Bizjak From-SVN: r137416 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 9 +++++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/float128-1.c | 24 ++++++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/float128-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ad8bbd045b7..1bd9de68ce7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-07-03 H.J. Lu + + * config/i386/i386.c (contains_aligned_value_p): Return true + for TCmode. + (ix86_data_alignment): Align TCmode to 128bits. + (ix86_local_alignment): Likewise. + 2008-07-03 Andrew Haley PR bootstrap/33304 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 58c3dba1e8c..a0edacaaaba 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4746,7 +4746,8 @@ contains_aligned_value_p (tree type) enum machine_mode mode = TYPE_MODE (type); if (((TARGET_SSE && SSE_REG_MODE_P (mode)) || mode == TDmode - || mode == TFmode) + || mode == TFmode + || mode == TCmode) && (!TYPE_USER_ALIGN (type) || TYPE_ALIGN (type) > 128)) return true; if (TYPE_ALIGN (type) < 128) @@ -17103,7 +17104,8 @@ ix86_data_alignment (tree type, int align) if (TYPE_MODE (type) == DCmode && align < 64) return 64; - if (TYPE_MODE (type) == XCmode && align < 128) + if ((TYPE_MODE (type) == XCmode + || TYPE_MODE (type) == TCmode) && align < 128) return 128; } else if ((TREE_CODE (type) == RECORD_TYPE @@ -17169,7 +17171,8 @@ ix86_local_alignment (tree type, enum machine_mode mode, { if (TYPE_MODE (type) == DCmode && align < 64) return 64; - if (TYPE_MODE (type) == XCmode && align < 128) + if ((TYPE_MODE (type) == XCmode + || TYPE_MODE (type) == TCmode) && align < 128) return 128; } else if ((TREE_CODE (type) == RECORD_TYPE diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc23a06e70c..a511bfd2bed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-03 H.J. Lu + Uros Bizjak + + * gcc.target/i386/float128-1.c: New. + 2008-07-03 Andrew Haley PR preprocessor/33305 diff --git a/gcc/testsuite/gcc.target/i386/float128-1.c b/gcc/testsuite/gcc.target/i386/float128-1.c new file mode 100644 index 00000000000..9c6d22745f0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/float128-1.c @@ -0,0 +1,24 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-options "-O2 -msse2" } */ + +#include "sse2-check.h" + +extern void abort (void); + +typedef _Complex float __attribute__((mode(TC))) _Complex128; + +_Complex128 __attribute__ ((noinline)) +foo (_Complex128 x, _Complex128 y) +{ + return x * y; +} + +static void +sse2_test (void) +{ + _Complex128 a = 1.3q + 3.4qi, b = 5.6q + 7.8qi, c; + + c = foo (a, b); + if (__real__(c) == 0.0q || __imag__ (c) == 0.0q) + abort (); +} -- 2.30.2