]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix IEEE 128-bit min/max test.
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 30 Jun 2021 18:54:48 +0000 (14:54 -0400)
committerMichael Meissner <meissner@linux.ibm.com>
Wed, 30 Jun 2021 18:54:48 +0000 (14:54 -0400)
This patch fixes the float128-minmax.c test so that it can accommodate the
generation of xsmincqp and xsmaxcqp instructions on power10.  I changed the
effective target from 'float128' to 'ppc_float128_hw', since this needs the
IEEE 128-bit float hardware support.  Changing to use 'ppc_float128_hw' allows
the 'lp64' test to be dropped.  The 'lp64' test originally was needed because
big endian 32-bit code cannot enable the IEEE 128-bit floating point
instructions.

gcc/testsuite/
2021-06-30  Michael Meissner  <meissner@linux.ibm.com>

* gcc.target/powerpc/float128-minmax.c: Adjust expected code for
power10.
* lib/target-supports.exp (check_effective_target_has_arch_pwr10):
New.

gcc/testsuite/gcc.target/powerpc/float128-minmax.c
gcc/testsuite/lib/target-supports.exp

index fe397518f2f534501bc3e8026f1daa5f3ae1e2b7..ef8f729d9c288f5c1c9c7172756f2530b91c4580 100644 (file)
@@ -1,6 +1,4 @@
-/* { dg-do compile { target lp64 } } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
-/* { dg-require-effective-target float128 } */
+/* { dg-require-effective-target ppc_float128_hw } */
 /* { dg-options "-mpower9-vector -O2 -ffast-math" } */
 
 #ifndef TYPE
@@ -12,5 +10,8 @@
 TYPE f128_min (TYPE a, TYPE b) { return __builtin_fminf128 (a, b); }
 TYPE f128_max (TYPE a, TYPE b) { return __builtin_fmaxf128 (a, b); }
 
-/* { dg-final { scan-assembler     {\mxscmpuqp\M} } } */
-/* { dg-final { scan-assembler-not {\mbl\M}       } } */
+/* Adjust code power10 which has native min/max instructions.  */
+/* { dg-final { scan-assembler-times {\mxscmpuqp\M} 2 { target { ! has_arch_pwr10 } } } } */
+/* { dg-final { scan-assembler-times {\mxsmincqp\M} 1 { target has_arch_pwr10 } } } */
+/* { dg-final { scan-assembler-times {\mxsmaxcqp\M} 1 { target has_arch_pwr10 } } } */
+/* { dg-final { scan-assembler-not {\mbl\M} } } */
index 7f78c5593ac4394fa5ca058e41517d7e7c98bd06..789723fb287e1529896936ed8b9efbec00e00fe6 100644 (file)
@@ -6127,6 +6127,16 @@ proc check_effective_target_has_arch_pwr9 { } {
        }]
 }
 
+proc check_effective_target_has_arch_pwr10 { } {
+       return [check_no_compiler_messages arch_pwr10 assembly {
+               #ifndef _ARCH_PWR10
+               #error does not have power10 support.
+               #else
+               /* "has power10 support" */
+               #endif
+       }]
+}
+
 # Return 1 if this is a PowerPC target supporting -mcpu=power10.
 # Limit this to 64-bit linux systems for now until other targets support
 # power10.