diff options
author | Michael Meissner <meissner@linux.ibm.com> | 2023-04-10 22:46:34 -0400 |
---|---|---|
committer | Michael Meissner <meissner@linux.ibm.com> | 2023-04-10 22:53:01 -0400 |
commit | 908d9c7e6ed4be95d39b7b01056dda365f379947 (patch) | |
tree | 18566a6672dac8109adbd3a9f54ed6c82edd06ae /gcc/testsuite/gcc.target | |
parent | 03fd8a076b6cfada5950e22a9fbac11e5ddf4cd6 (diff) | |
download | gcc-908d9c7e6ed4be95d39b7b01056dda365f379947.zip gcc-908d9c7e6ed4be95d39b7b01056dda365f379947.tar.gz gcc-908d9c7e6ed4be95d39b7b01056dda365f379947.tar.bz2 |
Backport from master
2023-04-10 Michael Meissner <meissner@linux.ibm.com>
gcc/
PR target/109067
* config/rs6000/rs6000.cc (create_complex_muldiv): Delete.
(init_float128_ieee): Delete code to switch complex multiply and divide
for long double. Backport from master, 3/20/2023.
(complex_multiply_builtin_code): New helper function.
(complex_divide_builtin_code): Likewise.
(rs6000_mangle_decl_assembler_name): Add support for mangling the name
of complex 128-bit multiply and divide built-in functions.
gcc/testsuite/
PR target/109067
* gcc.target/powerpc/divic3-1.c: New test. Backport from master,
3/20/2023.
* gcc.target/powerpc/divic3-2.c: Likewise.
* gcc.target/powerpc/mulic3-1.c: Likewise.
* gcc.target/powerpc/mulic3-2.c: Likewise.
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/divic3-1.c | 21 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/divic3-2.c | 25 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/mulic3-1.c | 21 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/mulic3-2.c | 25 |
4 files changed, 92 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/divic3-1.c b/gcc/testsuite/gcc.target/powerpc/divic3-1.c new file mode 100644 index 0000000..31dac82 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/divic3-1.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ppc_float128_sw } */ +/* { dg-options "-O2 -mabi=ieeelongdouble -Wno-psabi" } */ + +/* When GCC is configured with an older library that does not support IEEE + 128-bit, it issues a warning if you change the long double type. We use + -Wno-psabi to silence this warning. Since this is a code generation test, + it does not matter if the library has full IEEE 128-bit support. */ + +/* Check that complex divide generates the right call for __ibm128 when long + double is IEEE 128-bit floating point. */ + +typedef _Complex long double c_ibm128_t __attribute__((mode(__IC__))); + +void +divide (c_ibm128_t *p, c_ibm128_t *q, c_ibm128_t *r) +{ + *p = *q / *r; +} + +/* { dg-final { scan-assembler {\mbl .*__divtc3\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/divic3-2.c b/gcc/testsuite/gcc.target/powerpc/divic3-2.c new file mode 100644 index 0000000..1a5900e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/divic3-2.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ppc_float128_sw } */ +/* { dg-require-effective-target longdouble128 } */ +/* { dg-options "-O2 -mabi=ibmlongdouble -Wno-psabi" } */ + +/* When GCC is configured with an older library that does not support IEEE + 128-bit, it issues a warning if you change the long double type. We use + -Wno-psabi to silence this warning. Since this is a code generation test, + it does not matter if the library has full IEEE 128-bit support. + + We also need to require that the default long double is 128-bits, otherwise + the TC/TF modes might not be available. */ + +/* Check that complex divide generates the right call for __ibm128 when long + double is IBM 128-bit floating point. */ + +typedef _Complex long double c_ibm128_t __attribute__((mode(__TC__))); + +void +divide (c_ibm128_t *p, c_ibm128_t *q, c_ibm128_t *r) +{ + *p = *q / *r; +} + +/* { dg-final { scan-assembler {\mbl .*__divtc3\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/mulic3-1.c b/gcc/testsuite/gcc.target/powerpc/mulic3-1.c new file mode 100644 index 0000000..664f711 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/mulic3-1.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ppc_float128_sw } */ +/* { dg-options "-O2 -mabi=ieeelongdouble -Wno-psabi" } */ + +/* When GCC is configured with an older library that does not support IEEE + 128-bit, it issues a warning if you change the long double type. We use + -Wno-psabi to silence this warning. Since this is a code generation test, + it does not matter if the library has full IEEE 128-bit support. */ + +/* Check that complex multiply generates the right call for __ibm128 when long + double is IEEE 128-bit floating point. */ + +typedef _Complex long double c_ibm128_t __attribute__((mode(__IC__))); + +void +multiply (c_ibm128_t *p, c_ibm128_t *q, c_ibm128_t *r) +{ + *p = *q * *r; +} + +/* { dg-final { scan-assembler {\mbl .*__multc3\M} } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/mulic3-2.c b/gcc/testsuite/gcc.target/powerpc/mulic3-2.c new file mode 100644 index 0000000..c2c12dc --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/mulic3-2.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ppc_float128_sw } */ +/* { dg-require-effective-target longdouble128 } */ +/* { dg-options "-O2 -mabi=ibmlongdouble -Wno-psabi" } */ + +/* When GCC is configured with an older library that does not support IEEE + 128-bit, it issues a warning if you change the long double type. We use + -Wno-psabi to silence this warning. Since this is a code generation test, + it does not matter if the library has full IEEE 128-bit support. + + We also need to require that the default long double is 128-bits, otherwise + the TC/TF modes might not be available. */ + +/* Check that complex multiply generates the right call for __ibm128 when long + double is IBM 128-bit floating point. */ + +typedef _Complex long double c_ibm128_t __attribute__((mode(__TC__))); + +void +multiply (c_ibm128_t *p, c_ibm128_t *q, c_ibm128_t *r) +{ + *p = *q * *r; +} + +/* { dg-final { scan-assembler {\mbl .*__multc3\M} } } */ |