This patch adds a test to make sure __float128 are passed and returned like vector objects, and not as IBM extended double did.
This is the last subpatch of patch #7. I have bootstrapped the compiler with all 16 subpatches installed, and there were no regressions. Is it ok to install in the trunk? 2015-10-22 Michael Meissner <meiss...@linux.vnet.ibm.com> * gcc.target/powerpc/float128-call.c: New test for -mfloat128 on PowerPC. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
Index: gcc/testsuite/gcc.target/powerpc/float128-call.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/float128-call.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/float128-call.c (revision 0) @@ -0,0 +1,27 @@ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */ +/* { dg-options "-O2 -mcpu=power7 -mfloat128 -mno-regnames" } */ + +#ifndef __FLOAT128__ +#error "-mfloat128 is not supported." +#endif + +#ifdef __LONG_DOUBLE_IEEE128__ +#define TYPE long double +#define ONE 1.0L + +#else +#define TYPE __float128 +#define ONE 1.0Q +#endif + +/* Test to make sure vector registers are used for passing IEEE 128-bit + floating point values and returning them. Also make sure the 'q' suffix is + handled. */ +TYPE one (void) { return ONE; } +void store (TYPE a, TYPE *p) { *p = a; } + +/* { dg-final { scan-assembler "lxvd2x 34" } } */ +/* { dg-final { scan-assembler "stxvd2x 34" } } */