diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-21 14:32:26 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-21 14:32:26 -0700 |
commit | a5b5cabc91c38710adbe5c8a2b53882abe994441 (patch) | |
tree | 66b099a6ebc2076ef353afa90d9703824d023812 /gcc/testsuite | |
parent | a0791d0ed4f147ef347e83f4aedc7ad03f1a2008 (diff) | |
parent | 09e18d113b3c3dae896ac1a8ad1e0087adbb153b (diff) | |
download | gcc-a5b5cabc91c38710adbe5c8a2b53882abe994441.zip gcc-a5b5cabc91c38710adbe5c8a2b53882abe994441.tar.gz gcc-a5b5cabc91c38710adbe5c8a2b53882abe994441.tar.bz2 |
Merge from trunk revision 09e18d113b3c3dae896ac1a8ad1e0087adbb153b.
Diffstat (limited to 'gcc/testsuite')
138 files changed, 5743 insertions, 141 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1c8d4ba..aca4514 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,426 @@ +2021-09-20 Andrew MacLeod <amacleod@redhat.com> + + * gcc.dg/tree-ssa/evrp-ignore.c: New. + +2021-09-20 Matthias Kretz <m.kretz@gsi.de> + + * gcc.dg/associative-math-1.c: New test. + * gcc.dg/associative-math-2.c: New test. + * gcc.dg/no-signed-zeros-1.c: New test. + * gcc.dg/no-signed-zeros-2.c: New test. + * gcc.dg/no-trapping-math-1.c: New test. + * gcc.dg/no-trapping-math-2.c: New test. + * gcc.dg/reciprocal-math-1.c: New test. + * gcc.dg/reciprocal-math-2.c: New test. + * gcc.dg/rounding-math-1.c: New test. + * gcc.dg/rounding-math-2.c: New test. + +2021-09-20 Tobias Burnus <tobias@codesourcery.com> + + * gfortran.dg/gomp/order-5.f90: New test. + * gfortran.dg/gomp/order-6.f90: New test. + * gfortran.dg/gomp/order-7.f90: New test. + * gfortran.dg/gomp/order-8.f90: New test. + * gfortran.dg/gomp/order-9.f90: New test. + +2021-09-20 Christophe Lyon <christophe.lyon@foss.st.com> + Torbjörn SVENSSON <torbjorn.svensson@st.com> + + * lib/prune.exp (prune_gcc_output): Remove .exe suffix from + toolchain executables names. + +2021-09-20 Thomas Schwinge <thomas@codesourcery.com> + + * gcc.dg/plugin/diagnostic-test-string-literals-1.c: Adjust + expected error diagnostics. + +2021-09-20 Richard Biener <rguenther@suse.de> + + PR tree-optimization/65206 + * gcc.dg/torture/20210916.c: New testcase. + * gcc.dg/vect/pr65206.c: Likewise. + +2021-09-19 Martin Sebor <msebor@redhat.com> + + PR middle-end/102403 + * gcc.dg/uninit-pr102403.c: New test. + * gcc.dg/uninit-pr102403-c2.c: New test. + +2021-09-19 Martin Sebor <msebor@redhat.com> + + PR middle-end/102243 + * g++.dg/warn/Wplacement-new-size-10.C: New test. + +2021-09-19 Jeff Law <jeffreyalaw@gmail.com> + + * gfortran.dg/goacc/privatization-1-compute.f90: Make test names + unique. + * gfortran.dg/goacc/routine-external-level-of-parallelism-2.f: + Likewise. + +2021-09-19 Iain Sandoe <iain@sandoe.co.uk> + + * jit.dg/jit.exp (fixed_local_execute): Amend the match and + exit conditions to cater for more platforms. + +2021-09-19 Roger Sayle <roger@nextmovesoftware.com> + + PR middle-end/88173 + * c-c++-common/pr57371-4.c: Tweak/correct test case for QNaNs. + * g++.dg/pr88173-1.C: New test case. + * g++.dg/pr88173-2.C: New test case. + +2021-09-18 Jakub Jelinek <jakub@redhat.com> + + * c-c++-common/gomp/order-1.c (f2): Add tests for distribute + with order clause. + (f3): Remove. + * c-c++-common/gomp/order-2.c: Don't expect error for distribute + with order clause. + * c-c++-common/gomp/order-5.c: New test. + * c-c++-common/gomp/order-6.c: New test. + * c-c++-common/gomp/clause-dups-1.c (f1): Add tests for + duplicated order clause. + (f9): New function. + * c-c++-common/gomp/clauses-1.c (baz, bar): Don't mix copyin and + order(concurrent) clauses on the same composite construct combined + with distribute, instead split it into two tests, one without + copyin and one without order(concurrent). Add order(concurrent) + clauses to {,{,target} teams} distribute. + * g++.dg/gomp/attrs-1.C (baz, bar): Likewise. + * g++.dg/gomp/attrs-2.C (baz, bar): Likewise. + +2021-09-18 Jakub Jelinek <jakub@redhat.com> + + * c-c++-common/gomp/default-2.c: New test. + * c-c++-common/gomp/default-3.c: New test. + * g++.dg/gomp/default-1.C: New test. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-vfmaddXXXsh-1a.c: New test. + * gcc.target/i386/avx512fp16-vfmaddXXXsh-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vfmsubXXXsh-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vfmsubXXXsh-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmaddXXXsh-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmaddXXXsh-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmsubXXXsh-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmsubXXXsh-1b.c: Ditto. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test for new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + +2021-09-18 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/avx512fp16-xorsign-1.c: New test. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-neg-1a.c: New test. + * gcc.target/i386/avx512fp16-neg-1b.c: Ditto. + * gcc.target/i386/avx512fp16-scalar-bitwise-1a.c: Ditto. + * gcc.target/i386/avx512fp16-scalar-bitwise-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vector-bitwise-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vector-bitwise-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-neg-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-neg-1b.c: Ditto. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-vfmaddXXXph-1a.c: New test. + * gcc.target/i386/avx512fp16-vfmaddXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vfmsubXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vfmsubXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmaddXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmaddXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmsubXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vfnmsubXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmaddXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmaddXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmsubXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmsubXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1b.c: Ditto. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test fot new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-vfmaddsubXXXph-1a.c: New test. + * gcc.target/i386/avx512fp16-vfmaddsubXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vfmsubaddXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vfmsubaddXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1b.c: Ditto. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test for new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + +2021-09-18 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-broadcast-1.c: New test. + * gcc.target/i386/avx512fp16-broadcast-2.c: New test. + +2021-09-18 Jason Merrill <jason@redhat.com> + + * g++.dg/template/dtor5.C: Adjust expected error. + * g++.dg/cpp23/lookup2.C: New test. + * g++.dg/template/dtor11.C: New test. + +2021-09-17 Harald Anlauf <anlauf@gmx.de> + + PR fortran/102366 + * gfortran.dg/pr102366.f90: New test. + +2021-09-17 qing zhao <qing.zhao@oracle.com> + + * gcc.target/i386/auto-init-1.c: Restrict the testing only for + -march=x86-64 and -mtune=generic. Add -fno-stack-protector. + * gcc.target/i386/auto-init-2.c: Restrict the testing only for + -march=x86-64 and -mtune=generic -msse. + * gcc.target/i386/auto-init-3.c: Likewise. + * gcc.target/i386/auto-init-4.c: Likewise. + * gcc.target/i386/auto-init-5.c: Different pattern match for lp64 and + ia32. + * gcc.target/i386/auto-init-6.c: Restrict the testing only for + -march=x86-64 and -mtune-generic -msse. Add -fno-stack-protector. + * gcc.target/i386/auto-init-7.c: Likewise. + * gcc.target/i386/auto-init-8.c: Restrict the testing only for + -march=x86-64 and -mtune=generic -msse.. + * gcc.target/i386/auto-init-padding-1.c: Likewise. + * gcc.target/i386/auto-init-padding-10.c: Likewise. + * gcc.target/i386/auto-init-padding-11.c: Likewise. + * gcc.target/i386/auto-init-padding-12.c: Likewise. + * gcc.target/i386/auto-init-padding-2.c: Likewise. + * gcc.target/i386/auto-init-padding-3.c: Restrict the testing only for + -march=x86-64. Different pattern match for lp64 and ia32. + * gcc.target/i386/auto-init-padding-4.c: Restrict the testing only for + -march=x86-64 and -mtune-generic -msse. + * gcc.target/i386/auto-init-padding-5.c: Likewise. + * gcc.target/i386/auto-init-padding-6.c: Likewise. + * gcc.target/i386/auto-init-padding-7.c: Restrict the testing only for + -march=x86-64 and -mtune-generic -msse. Add -fno-stack-protector. + * gcc.target/i386/auto-init-padding-8.c: Likewise. + * gcc.target/i386/auto-init-padding-9.c: Restrict the testing only for + -march=x86-64. Different pattern match for lp64 and ia32. + +2021-09-17 Martin Sebor <msebor@redhat.com> + + PR middle-end/102200 + * gcc.dg/Wstringop-overflow-62.c: Adjust text of an expected note. + * gcc.dg/Warray-bounds-89.c: New test. + * gcc.dg/Wstringop-overflow-74.c: New test. + * gcc.dg/Wstringop-overflow-75.c: New test. + * gcc.dg/Wstringop-overflow-76.c: New test. + +2021-09-17 Sandra Loosemore <sandra@codesourcery.com> + + * gfortran.dg/PR100914.c: Do not include quadmath.h. Use + _Float128 _Complex instead of __complex128. + * gfortran.dg/PR100914.f90: Add -Wno-pedantic to suppress error + about use of _Float128. + * gfortran.dg/c-interop/typecodes-array-float128-c.c: Use + _Float128 instead of __float128. + * gfortran.dg/c-interop/typecodes-sanity-c.c: Likewise. + * gfortran.dg/c-interop/typecodes-scalar-float128-c.c: Likewise. + * lib/target-supports.exp + (check_effective_target_fortran_real_c_float128): Update comments. + +2021-09-17 Roger Sayle <roger@nextmovesoftware.com> + + PR c/102245 + * gcc.dg/Wint-in-bool-context-4.c: New test case. + +2021-09-17 Jakub Jelinek <jakub@redhat.com> + + * c-c++-common/gomp/atomic-18.c: Expect same diagnostics in C++ as in + C. + * c-c++-common/gomp/atomic-25.c: Drop c effective target. + * c-c++-common/gomp/atomic-26.c: Likewise. + * c-c++-common/gomp/atomic-27.c: Likewise. + * c-c++-common/gomp/atomic-28.c: Likewise. + * c-c++-common/gomp/atomic-29.c: Likewise. + * c-c++-common/gomp/atomic-30.c: Likewise. Adjust expected diagnostics + for C++ when it differs from C. + (foo): Change return type from double to void. + * g++.dg/gomp/atomic-5.C: Adjust expected diagnostics wording. + * g++.dg/gomp/atomic-20.C: New test. + +2021-09-17 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/avx-covert-1.c: New file. + * gcc.target/i386/avx-fp-covert-1.c: Likewise. + * gcc.target/i386/avx-int-covert-1.c: Likewise. + * gcc.target/i386/sse-covert-1.c: Likewise. + * gcc.target/i386/sse-fp-covert-1.c: Likewise. + * gcc.target/i386/sse-int-covert-1.c: Likewise. + +2021-09-17 H.J. Lu <hjl.tools@gmail.com> + + PR target/101900 + * gcc.target/i386/pr101900-1.c: New test. + * gcc.target/i386/pr101900-2.c: Likewise. + * gcc.target/i386/pr101900-3.c: Likewise. + +2021-09-17 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.target/sparc/20210917-1.c: New test. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-typecast-1.c: New test. + * gcc.target/i386/avx512fp16-typecast-2.c: Ditto. + * gcc.target/i386/avx512fp16vl-typecast-1.c: Ditto. + * gcc.target/i386/avx512fp16vl-typecast-2.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-vcvtsd2sh-1a.c: New test. + * gcc.target/i386/avx512fp16-vcvtsd2sh-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2sd-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2sd-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2ss-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2ss-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtss2sh-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtss2sh-1b.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test for new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-helper.h (V512): Add DF contents. + (src3f): New. + * gcc.target/i386/avx512fp16-vcvtpd2ph-1a.c: New test. + * gcc.target/i386/avx512fp16-vcvtpd2ph-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtph2pd-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtph2pd-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtph2psx-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtph2psx-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtps2ph-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtps2ph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtpd2ph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtpd2ph-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtph2pd-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtph2pd-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtph2psx-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtph2psx-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtps2ph-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvtps2ph-1b.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test for new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-vcvttsh2si-1a.c: New test. + * gcc.target/i386/avx512fp16-vcvttsh2si-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttsh2si64-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttsh2si64-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttsh2usi-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttsh2usi-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttsh2usi64-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttsh2usi64-1b.c: Ditto. + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test for new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-vcvttph2dq-1a.c: New test. + * gcc.target/i386/avx512fp16-vcvttph2dq-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2qq-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2qq-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2udq-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2udq-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2uqq-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2uqq-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2uw-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2uw-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2w-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvttph2w-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2dq-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2dq-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2qq-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2qq-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2udq-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2udq-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2uqq-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2uqq-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2uw-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2uw-1b.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2w-1a.c: Ditto. + * gcc.target/i386/avx512fp16vl-vcvttph2w-1b.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test for new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512fp16-helper.h (V512): Add int32 + component. + * gcc.target/i386/avx512fp16-vcvtsh2si-1a.c: New test. + * gcc.target/i386/avx512fp16-vcvtsh2si-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2si64-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2si64-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2usi-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2usi-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2usi64-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsh2usi64-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsi2sh-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsi2sh-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsi2sh64-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtsi2sh64-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtusi2sh-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtusi2sh-1b.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtusi2sh64-1a.c: Ditto. + * gcc.target/i386/avx512fp16-vcvtusi2sh64-1b.c: Ditto. + +2021-09-17 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx-1.c: Add test for new builtins. + * gcc.target/i386/sse-13.c: Ditto. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/sse-14.c: Add test for new intrinsics. + * gcc.target/i386/sse-22.c: Ditto. + 2021-09-16 Patrick Palka <ppalka@redhat.com> PR c++/98486 diff --git a/gcc/testsuite/c-c++-common/gomp/clause-dups-1.c b/gcc/testsuite/c-c++-common/gomp/clause-dups-1.c index 604caf0..a17f68d 100644 --- a/gcc/testsuite/c-c++-common/gomp/clause-dups-1.c +++ b/gcc/testsuite/c-c++-common/gomp/clause-dups-1.c @@ -29,6 +29,12 @@ f1 (int *p) #pragma omp for nowait nowait /* { dg-error "too many 'nowait' clauses" } */ for (i = 0; i < 8; ++i) f0 (); + #pragma omp for schedule(static) order(concurrent) order(concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); + #pragma omp for schedule(static) order(reproducible:concurrent) order(unconstrained:concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); #pragma omp simd collapse(1) collapse(1) /* { dg-error "too many 'collapse' clauses" } */ for (i = 0; i < 8; ++i) f0 (); @@ -207,6 +213,18 @@ f1 (int *p) f0 (); #pragma omp scope nowait nowait /* { dg-error "too many 'nowait' clauses" } */ ; + #pragma omp loop bind(thread) order(concurrent) order(concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); + #pragma omp loop bind(thread) order(reproducible:concurrent) order(unconstrained:concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); + #pragma omp simd order(concurrent) order(concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); + #pragma omp simd order(reproducible:concurrent) order(unconstrained:concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); } #pragma omp declare simd simdlen (4) simdlen (4) /* { dg-error "too many 'simdlen' clauses" } */ @@ -223,3 +241,17 @@ void f6 (int a, int b); void f7 (int a, int b); #pragma omp declare simd linear (a) uniform (a) /* { dg-error "'a' appears more than once in data clauses" } */ void f8 (int a, int b); + +#pragma omp declare target +void +f9 (void) +{ + int i; + #pragma omp distribute dist_schedule(static) order(concurrent) order(concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); + #pragma omp loop bind(thread) order(reproducible:concurrent) order(unconstrained:concurrent) /* { dg-error "too many 'order' clauses" } */ + for (i = 0; i < 8; ++i) + f0 (); +} +#pragma omp end declare target diff --git a/gcc/testsuite/c-c++-common/gomp/clauses-1.c b/gcc/testsuite/c-c++-common/gomp/clauses-1.c index 378c7bf..742132f 100644 --- a/gcc/testsuite/c-c++-common/gomp/clauses-1.c +++ b/gcc/testsuite/c-c++-common/gomp/clauses-1.c @@ -66,14 +66,27 @@ baz (int d, int m, int i1, int i2, int p, int *idp, int s, #pragma omp distribute parallel for \ private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \ if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \ - lastprivate (l) schedule(static, 4) copyin(t) order(concurrent) allocate (p) + lastprivate (l) schedule(static, 4) copyin(t) allocate (p) + for (int i = 0; i < 64; i++) + ll++; + #pragma omp distribute parallel for \ + private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \ + if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \ + lastprivate (l) schedule(static, 4) order(concurrent) allocate (p) for (int i = 0; i < 64; i++) ll++; #pragma omp distribute parallel for simd \ private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \ if (parallel: i2) if(simd: i1) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \ lastprivate (l) schedule(static, 4) nontemporal(ntm) \ - safelen(8) simdlen(4) aligned(q: 32) copyin(t) order(concurrent) allocate (f) + safelen(8) simdlen(4) aligned(q: 32) copyin(t) allocate (f) + for (int i = 0; i < 64; i++) + ll++; + #pragma omp distribute parallel for simd \ + private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) \ + if (parallel: i2) if(simd: i1) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) \ + lastprivate (l) schedule(static, 4) nontemporal(ntm) \ + safelen(8) simdlen(4) aligned(q: 32) order(concurrent) allocate (f) for (int i = 0; i < 64; i++) ll++; #pragma omp distribute simd \ @@ -156,7 +169,7 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, ; #pragma omp target teams distribute \ device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \ - shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \ + shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) order(concurrent) \ collapse(1) dist_schedule(static, 16) nowait depend(inout: dd[0]) allocate (omp_default_mem_alloc:f) in_reduction(+:r2) for (int i = 0; i < 64; i++) ; @@ -218,7 +231,7 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, #pragma omp target nowait depend(inout: dd[0]) in_reduction(+:r2) #pragma omp teams distribute \ private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \ - collapse(1) dist_schedule(static, 16) allocate (omp_default_mem_alloc: f) + collapse(1) dist_schedule(static, 16) allocate (omp_default_mem_alloc: f) order(concurrent) for (int i = 0; i < 64; i++) ; #pragma omp target @@ -249,20 +262,36 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, ll++; #pragma omp teams distribute parallel for \ private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \ - collapse(1) dist_schedule(static, 16) order(concurrent) \ + collapse(1) dist_schedule(static, 16) \ if (parallel: i2) num_threads (nth) proc_bind(spread) \ lastprivate (l) schedule(static, 4) copyin(t) allocate (f) for (int i = 0; i < 64; i++) ll++; + #pragma omp teams distribute parallel for \ + private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \ + collapse(1) dist_schedule(static, 16) order(concurrent) \ + if (parallel: i2) num_threads (nth) proc_bind(spread) \ + lastprivate (l) schedule(static, 4) allocate (f) + for (int i = 0; i < 64; i++) + ll++; #pragma omp teams distribute parallel for simd \ private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \ collapse(1) dist_schedule(static, 16) \ if (parallel: i2) num_threads (nth) proc_bind(spread) \ - lastprivate (l) schedule(static, 4) order(concurrent) \ + lastprivate (l) schedule(static, 4) \ safelen(8) simdlen(4) aligned(q: 32) if (simd: i3) nontemporal(ntm) copyin(t) \ allocate (f) for (int i = 0; i < 64; i++) ll++; + #pragma omp teams distribute parallel for simd \ + private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \ + collapse(1) dist_schedule(static, 16) \ + if (parallel: i2) num_threads (nth) proc_bind(spread) \ + lastprivate (l) schedule(static, 4) order(concurrent) \ + safelen(8) simdlen(4) aligned(q: 32) if (simd: i3) nontemporal(ntm) \ + allocate (f) + for (int i = 0; i < 64; i++) + ll++; #pragma omp teams distribute simd \ private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) \ collapse(1) dist_schedule(static, 16) order(concurrent) \ diff --git a/gcc/testsuite/c-c++-common/gomp/default-2.c b/gcc/testsuite/c-c++-common/gomp/default-2.c new file mode 100644 index 0000000..6378e6e --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/default-2.c @@ -0,0 +1,67 @@ +int x; +extern int z; + +void +foo (void) +{ + int y = 0, i; + static int w; + #pragma omp task default(firstprivate) /* { dg-message "note: enclosing 'task'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ + } + #pragma omp taskloop default(firstprivate) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y++; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ + } + #pragma omp teams default(firstprivate) /* { dg-message "note: enclosing 'teams'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ + } + #pragma omp parallel default(firstprivate) /* { dg-message "note: enclosing 'parallel'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ + } + #pragma omp task default(private) /* { dg-message "note: enclosing 'task'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ + } + #pragma omp taskloop default(private) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ + } + #pragma omp teams default(private) /* { dg-message "note: enclosing 'teams'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ + } + #pragma omp parallel default(private) /* { dg-message "note: enclosing 'parallel'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ + } +} diff --git a/gcc/testsuite/c-c++-common/gomp/default-3.c b/gcc/testsuite/c-c++-common/gomp/default-3.c new file mode 100644 index 0000000..a742a71 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/default-3.c @@ -0,0 +1,14 @@ +void +foo (void) +{ + int i; + #pragma omp task default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + ; + #pragma omp taskloop default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + for (i = 0; i < 64; i++) + ; + #pragma omp teams default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + ; + #pragma omp parallel default(copyprivate) /* { dg-error "expected 'none', 'shared', 'private' or 'firstprivate' before 'copyprivate'" } */ + ; +} diff --git a/gcc/testsuite/c-c++-common/gomp/order-1.c b/gcc/testsuite/c-c++-common/gomp/order-1.c index da4b73d..547d061 100644 --- a/gcc/testsuite/c-c++-common/gomp/order-1.c +++ b/gcc/testsuite/c-c++-common/gomp/order-1.c @@ -29,6 +29,9 @@ f2 (int *a) #pragma omp teams distribute parallel for simd order(concurrent) for (i = 0; i < 128; i++) a[i]++; + #pragma omp teams distribute order(concurrent) + for (i = 0; i < 128; i++) + a[i]++; #pragma omp teams { #pragma omp distribute parallel for order(concurrent) @@ -37,17 +40,11 @@ f2 (int *a) #pragma omp distribute parallel for simd order(concurrent) for (i = 0; i < 128; i++) a[i]++; + #pragma omp distribute order(concurrent) + for (i = 0; i < 128; i++) + a[i]++; } #pragma omp taskloop simd order (concurrent) for (i = 0; i < 128; i++) a[i]++; } - -void -f3 (int *a) -{ - int i; - #pragma omp for order(concurrent) order(concurrent) order(concurrent) - for (i = 0; i < 128; i++) - a[i]++; -} diff --git a/gcc/testsuite/c-c++-common/gomp/order-2.c b/gcc/testsuite/c-c++-common/gomp/order-2.c index 1a9adb0..5e044dc 100644 --- a/gcc/testsuite/c-c++-common/gomp/order-2.c +++ b/gcc/testsuite/c-c++-common/gomp/order-2.c @@ -24,7 +24,7 @@ f2 (int *a) { int i; #pragma omp teams - #pragma omp distribute order(concurrent) /* { dg-error "'order' is not valid for '#pragma omp distribute'" } */ + #pragma omp distribute order(concurrent) for (i = 0; i < 128; i++) a[i]++; #pragma omp taskloop order (concurrent) /* { dg-error "'order' is not valid for '#pragma omp taskloop'" } */ diff --git a/gcc/testsuite/c-c++-common/gomp/order-5.c b/gcc/testsuite/c-c++-common/gomp/order-5.c new file mode 100644 index 0000000..17cc8b5 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/order-5.c @@ -0,0 +1,101 @@ +void +f1 (int *a) +{ + int i; + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp simd order ( reproducible : concurrent ) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp for simd order(reproducible :concurrent) + for (i = 0; i < 128; i++) + a[i]++; +} + +void +f2 (int *a) +{ + int i; + #pragma omp parallel for order(reproducible: concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp parallel for simd order (reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams distribute parallel for order(reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams distribute parallel for simd order(reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams distribute order(reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams + { + #pragma omp distribute parallel for order(reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp distribute parallel for simd order(reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp distribute order(reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + } + #pragma omp taskloop simd order (reproducible:concurrent) + for (i = 0; i < 128; i++) + a[i]++; +} + +void +f3 (int *a) +{ + int i; + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp simd order ( unconstrained : concurrent ) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp for simd order(unconstrained :concurrent) + for (i = 0; i < 128; i++) + a[i]++; +} + +void +f4 (int *a) +{ + int i; + #pragma omp parallel for order(unconstrained: concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp parallel for simd order (unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams distribute parallel for order(unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams distribute parallel for simd order(unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams distribute order(unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp teams + { + #pragma omp distribute parallel for order(unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp distribute parallel for simd order(unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + #pragma omp distribute order(unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; + } + #pragma omp taskloop simd order (unconstrained:concurrent) + for (i = 0; i < 128; i++) + a[i]++; +} diff --git a/gcc/testsuite/c-c++-common/gomp/order-6.c b/gcc/testsuite/c-c++-common/gomp/order-6.c new file mode 100644 index 0000000..2127830 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/order-6.c @@ -0,0 +1,412 @@ +void foo (void); +int v; +#ifdef __cplusplus +extern "C" { +#endif +int omp_get_thread_num (void); +int omp_get_num_threads (void); +int omp_target_is_present (const void *, int); +int omp_get_cancellation (void); +#ifdef __cplusplus +} +#endif + +void +f1 (int *a) +{ + int i; + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp parallel /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp simd + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp critical /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp ordered simd /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + v++; + } + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic read /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + a[i] = v; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic write /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + v = a[i]; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_thread_num (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_num_threads (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_target_is_present (a + i, 0); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_cancellation (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ +} + +void +f2 (int *a) +{ + int i; + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp parallel /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp simd + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp critical /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp ordered simd /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + v++; + } + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic read /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + a[i] = v; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic write /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + v = a[i]; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_thread_num (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_num_threads (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_target_is_present (a + i, 0); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for simd order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_cancellation (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ +} + +void +f3 (int *a) +{ + int i; + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp parallel + foo (); + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp simd + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp critical /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp ordered simd /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + v++; + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic read /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + a[i] = v; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic write /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + v = a[i]; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp task /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + a[i]++; + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp taskloop /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_thread_num (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_num_threads (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_target_is_present (a + i, 0); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for order(reproducible:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_cancellation (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ +} + +void +f4 (int *a) +{ + int i; + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp parallel /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp simd + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp critical /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp ordered simd /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + v++; + } + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic read /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + a[i] = v; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic write /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + v = a[i]; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_thread_num (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_num_threads (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_target_is_present (a + i, 0); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_cancellation (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ +} + +void +f5 (int *a) +{ + int i; + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp parallel /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp simd + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp critical /* { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } */ + foo (); + } + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp ordered simd /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + v++; + } + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic read /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + a[i] = v; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic write /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + v = a[i]; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_thread_num (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_num_threads (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_target_is_present (a + i, 0); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for simd order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_cancellation (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ +} + +void +f6 (int *a) +{ + int i; + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp parallel + foo (); + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp simd + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp critical /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp ordered simd /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + foo (); + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + v++; + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic read /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + a[i] = v; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp atomic write /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c++ } } */ + v = a[i]; /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" "" { target c } } */ + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + #pragma omp task /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + a[i]++; + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + { + int j; + #pragma omp taskloop /* { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } */ + for (j = 0; j < 64; j++) + a[64 * i + j] = i + j; + } + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_thread_num (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_num_threads (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_target_is_present (a + i, 0); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ + #pragma omp for order(unconstrained:concurrent) + for (i = 0; i < 64; i++) + a[i] += omp_get_cancellation (); /* { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } */ +} diff --git a/gcc/testsuite/c-c++-common/pr57371-4.c b/gcc/testsuite/c-c++-common/pr57371-4.c index f43f7c2..d938ecd 100644 --- a/gcc/testsuite/c-c++-common/pr57371-4.c +++ b/gcc/testsuite/c-c++-common/pr57371-4.c @@ -13,25 +13,25 @@ void nonfinite(unsigned short x) { { volatile int nonfinite_1; nonfinite_1 = (float) x > QNAN; - /* { dg-final { scan-tree-dump "nonfinite_1 = \\(float\\)" "original" } } */ + /* { dg-final { scan-tree-dump "nonfinite_1 = 0" "original" } } */ } { volatile int nonfinite_2; nonfinite_2 = (float) x >= QNAN; - /* { dg-final { scan-tree-dump "nonfinite_2 = \\(float\\)" "original" } } */ + /* { dg-final { scan-tree-dump "nonfinite_2 = 0" "original" } } */ } { volatile int nonfinite_3; nonfinite_3 = (float) x < QNAN; - /* { dg-final { scan-tree-dump "nonfinite_3 = \\(float\\)" "original" } } */ + /* { dg-final { scan-tree-dump "nonfinite_3 = 0" "original" } } */ } { volatile int nonfinite_4; nonfinite_4 = (float) x <= QNAN; - /* { dg-final { scan-tree-dump "nonfinite_4 = \\(float\\)" "original" } } */ + /* { dg-final { scan-tree-dump "nonfinite_4 = 0" "original" } } */ } { diff --git a/gcc/testsuite/g++.dg/abi/anon4.C b/gcc/testsuite/g++.dg/abi/anon4.C index 088ba99..8200f4b 100644 --- a/gcc/testsuite/g++.dg/abi/anon4.C +++ b/gcc/testsuite/g++.dg/abi/anon4.C @@ -1,4 +1,5 @@ // PR c++/65209 +// { dg-additional-options "-fno-pie" { target sparc*-*-* } } // { dg-final { scan-assembler-not "comdat" } } // Everything involving the anonymous namespace bits should be private, not diff --git a/gcc/testsuite/g++.dg/cpp23/lookup2.C b/gcc/testsuite/g++.dg/cpp23/lookup2.C new file mode 100644 index 0000000..a16afbe --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp23/lookup2.C @@ -0,0 +1,6 @@ +// DR 1835 + +template <class T> void f(T t) { t.foo::bar(); } +struct foo { void bar(); }; +struct baz : foo { }; +int main() { f(baz()); } diff --git a/gcc/testsuite/g++.dg/gomp/attrs-1.C b/gcc/testsuite/g++.dg/gomp/attrs-1.C index c871c51..2a5f2cf 100644 --- a/gcc/testsuite/g++.dg/gomp/attrs-1.C +++ b/gcc/testsuite/g++.dg/gomp/attrs-1.C @@ -63,7 +63,7 @@ foo (int d, int m, int i1, int i2, int p, int *idp, int s, ll++; [[omp::directive (distribute private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) - allocate (omp_default_mem_alloc:f))]] + allocate (omp_default_mem_alloc:f) order(concurrent))]] for (int i = 0; i < 64; i++) ll++; } @@ -85,14 +85,27 @@ baz (int d, int m, int i1, int i2, int p, int *idp, int s, [[omp::directive (distribute parallel for private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) - lastprivate (l) schedule(static, 4) copyin(t) order(concurrent) allocate (p))]] + lastprivate (l) schedule(static, 4) copyin(t) allocate (p))]] + for (int i = 0; i < 64; i++) + ll++; + [[omp::directive (distribute parallel for + private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) + if (parallel: i2) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) + lastprivate (l) schedule(static, 4) order(concurrent) allocate (p))]] for (int i = 0; i < 64; i++) ll++; [[omp::directive (distribute parallel for simd private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) if (parallel: i2) if(simd: i1) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) lastprivate (l) schedule(static, 4) nontemporal(ntm) - safelen(8) simdlen(4) aligned(q: 32) copyin(t) order(concurrent) allocate (f))]] + safelen(8) simdlen(4) aligned(q: 32) copyin(t) allocate (f))]] + for (int i = 0; i < 64; i++) + ll++; + [[omp::directive (distribute parallel for simd + private (p) firstprivate (f) collapse(1) dist_schedule(static, 16) + if (parallel: i2) if(simd: i1) default(shared) shared(s) reduction(+:r) num_threads (nth) proc_bind(spread) + lastprivate (l) schedule(static, 4) nontemporal(ntm) + safelen(8) simdlen(4) aligned(q: 32) order(concurrent) allocate (f))]] for (int i = 0; i < 64; i++) ll++; [[omp::directive (distribute simd @@ -207,7 +220,7 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, ; [[omp::sequence (omp::directive (target teams distribute device(d) map (tofrom: m) if (target: i1) private (p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) - shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) + shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) order(concurrent) collapse(1) dist_schedule(static, 16) nowait depend(inout: dd[0]) allocate (omp_default_mem_alloc:f) in_reduction(+:r2)))]] for (int i = 0; i < 64; i++) ; @@ -292,7 +305,7 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, [[omp::sequence (directive (target nowait depend(inout: dd[0]) in_reduction(+:r2)), directive (teams distribute private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) - collapse(1) dist_schedule(static, 16) allocate (omp_default_mem_alloc: f)))]] + collapse(1) dist_schedule(static, 16) allocate (omp_default_mem_alloc: f) order(concurrent)))]] for (int i = 0; i < 64; i++) ; [[omp::directive (teams @@ -327,20 +340,36 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, ll++; [[omp::directive (teams distribute parallel for private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) - collapse(1) dist_schedule(static, 16) order(concurrent) + collapse(1) dist_schedule(static, 16) if (parallel: i2) num_threads (nth) proc_bind(spread) lastprivate (l) schedule(static, 4) copyin(t) allocate (f))]] for (int i = 0; i < 64; i++) ll++; + [[omp::directive (teams distribute parallel for + private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) + collapse(1) dist_schedule(static, 16) order(concurrent) + if (parallel: i2) num_threads (nth) proc_bind(spread) + lastprivate (l) schedule(static, 4) allocate (f))]] + for (int i = 0; i < 64; i++) + ll++; [[omp::directive (teams distribute parallel for simd private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) collapse(1) dist_schedule(static, 16) if (parallel: i2) num_threads (nth) proc_bind(spread) - lastprivate (l) schedule(static, 4) order(concurrent) + lastprivate (l) schedule(static, 4) safelen(8) simdlen(4) aligned(q: 32) if (simd: i3) nontemporal(ntm) copyin(t) allocate (f))]] for (int i = 0; i < 64; i++) ll++; + [[omp::directive (teams distribute parallel for simd + private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) + collapse(1) dist_schedule(static, 16) + if (parallel: i2) num_threads (nth) proc_bind(spread) + lastprivate (l) schedule(static, 4) order(concurrent) + safelen(8) simdlen(4) aligned(q: 32) if (simd: i3) nontemporal(ntm) + allocate (f))]] + for (int i = 0; i < 64; i++) + ll++; [[omp::directive (teams distribute simd private(p) firstprivate (f) shared(s) default(shared) reduction(+:r) num_teams(nte) thread_limit(tl) collapse(1) dist_schedule(static, 16) order(concurrent) diff --git a/gcc/testsuite/g++.dg/gomp/attrs-2.C b/gcc/testsuite/g++.dg/gomp/attrs-2.C index 5ec19b3..c00be7f 100644 --- a/gcc/testsuite/g++.dg/gomp/attrs-2.C +++ b/gcc/testsuite/g++.dg/gomp/attrs-2.C @@ -63,7 +63,7 @@ foo (int d, int m, int i1, int i2, int p, int *idp, int s, ll++; [[omp::directive (distribute, private (p),firstprivate (f),collapse(1),dist_schedule(static, 16), - allocate (omp_default_mem_alloc:f))]] + allocate (omp_default_mem_alloc:f),order(concurrent))]] for (int i = 0; i < 64; i++) ll++; } @@ -85,14 +85,27 @@ baz (int d, int m, int i1, int i2, int p, int *idp, int s, [[omp::directive (distribute parallel for, private (p),firstprivate (f),collapse(1),dist_schedule(static, 16), if (parallel: i2),default(shared),shared(s),reduction(+:r),num_threads (nth),proc_bind(spread), - lastprivate (l),schedule(static, 4),copyin(t),order(concurrent),allocate (p))]] + lastprivate (l),schedule(static, 4),copyin(t),allocate (p))]] + for (int i = 0; i < 64; i++) + ll++; + [[omp::directive (distribute parallel for, + private (p),firstprivate (f),collapse(1),dist_schedule(static, 16), + if (parallel: i2),default(shared),shared(s),reduction(+:r),num_threads (nth),proc_bind(spread), + lastprivate (l),schedule(static, 4),order(concurrent),allocate (p))]] for (int i = 0; i < 64; i++) ll++; [[omp::directive (distribute parallel for simd, private (p),firstprivate (f),collapse(1),dist_schedule(static, 16), if (parallel: i2),if(simd: i1),default(shared),shared(s),reduction(+:r),num_threads (nth),proc_bind(spread), lastprivate (l),schedule(static, 4),nontemporal(ntm), - safelen(8),simdlen(4),aligned(q: 32),copyin(t),order(concurrent),allocate (f))]] + safelen(8),simdlen(4),aligned(q: 32),copyin(t),allocate (f))]] + for (int i = 0; i < 64; i++) + ll++; + [[omp::directive (distribute parallel for simd, + private (p),firstprivate (f),collapse(1),dist_schedule(static, 16), + if (parallel: i2),if(simd: i1),default(shared),shared(s),reduction(+:r),num_threads (nth),proc_bind(spread), + lastprivate (l),schedule(static, 4),nontemporal(ntm), + safelen(8),simdlen(4),aligned(q: 32),order(concurrent),allocate (f))]] for (int i = 0; i < 64; i++) ll++; [[omp::directive (distribute simd, @@ -207,7 +220,7 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, ; [[omp::sequence (omp::directive (target teams distribute, device(d),map (tofrom: m),if (target: i1),private (p),firstprivate (f),defaultmap(tofrom: scalar),is_device_ptr (idp), - shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl), + shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl),order(concurrent), collapse(1),dist_schedule(static, 16),nowait depend(inout: dd[0]),allocate (omp_default_mem_alloc:f),in_reduction(+:r2)))]] for (int i = 0; i < 64; i++) ; @@ -292,7 +305,7 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, [[omp::sequence (directive (target, nowait,depend(inout: dd[0]),in_reduction(+:r2)), directive (teams distribute, private(p),firstprivate (f),shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl), - collapse(1),dist_schedule(static, 16),allocate (omp_default_mem_alloc: f)))]] + collapse(1),dist_schedule(static, 16),allocate (omp_default_mem_alloc: f),order(concurrent)))]] for (int i = 0; i < 64; i++) ; [[omp::directive (teams, @@ -327,20 +340,36 @@ bar (int d, int m, int i1, int i2, int i3, int p, int *idp, int s, ll++; [[omp::directive (teams distribute parallel for, private(p),firstprivate (f),shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl), - collapse(1),dist_schedule(static, 16),order(concurrent), + collapse(1),dist_schedule(static, 16), if (parallel: i2),num_threads (nth),proc_bind(spread), lastprivate (l),schedule(static, 4),copyin(t),allocate (f))]] for (int i = 0; i < 64; i++) ll++; + [[omp::directive (teams distribute parallel for, + private(p),firstprivate (f),shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl), + collapse(1),dist_schedule(static, 16),order(concurrent), + if (parallel: i2),num_threads (nth),proc_bind(spread), + lastprivate (l),schedule(static, 4),allocate (f))]] + for (int i = 0; i < 64; i++) + ll++; [[omp::directive (teams distribute parallel for simd, private(p),firstprivate (f),shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl), collapse(1),dist_schedule(static, 16), if (parallel: i2),num_threads (nth),proc_bind(spread), - lastprivate (l),schedule(static, 4),order(concurrent), + lastprivate (l),schedule(static, 4), safelen(8),simdlen(4),aligned(q: 32),if (simd: i3),nontemporal(ntm),copyin(t), allocate (f))]] for (int i = 0; i < 64; i++) ll++; + [[omp::directive (teams distribute parallel for simd, + private(p),firstprivate (f),shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl), + collapse(1),dist_schedule(static, 16), + if (parallel: i2),num_threads (nth),proc_bind(spread), + lastprivate (l),schedule(static, 4),order(concurrent), + safelen(8),simdlen(4),aligned(q: 32),if (simd: i3),nontemporal(ntm), + allocate (f))]] + for (int i = 0; i < 64; i++) + ll++; [[omp::directive (teams distribute simd, private(p),firstprivate (f),shared(s),default(shared),reduction(+:r),num_teams(nte),thread_limit(tl), collapse(1),dist_schedule(static, 16),order(concurrent), diff --git a/gcc/testsuite/g++.dg/gomp/default-1.C b/gcc/testsuite/g++.dg/gomp/default-1.C new file mode 100644 index 0000000..e39df12 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/default-1.C @@ -0,0 +1,112 @@ +namespace N +{ + int x; + extern int z; +} + +struct S +{ + static int s; +}; + +#if __cpp_variable_templates >= 201304 +template <int N> +int t = N; +#endif + +void +foo (void) +{ + int y = 0, i; + static int w; + #pragma omp task default(firstprivate) /* { dg-message "note: enclosing 'task'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'task'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'task'" "" { target c++14 } } */ +#endif + } + #pragma omp taskloop default(firstprivate) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y++; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'taskloop'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'taskloop'" "" { target c++14 } } */ +#endif + } + #pragma omp teams default(firstprivate) /* { dg-message "note: enclosing 'teams'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'teams'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'teams'" "" { target c++14 } } */ +#endif + } + #pragma omp parallel default(firstprivate) /* { dg-message "note: enclosing 'parallel'" } */ + { + y++; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'parallel'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'parallel'" "" { target c++14 } } */ +#endif + } + #pragma omp task default(private) /* { dg-message "note: enclosing 'task'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'task'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'task'" "" { target c++14 } } */ +#endif + } + #pragma omp taskloop default(private) /* { dg-message "note: enclosing 'taskloop'" } */ + for (i = 0; i < 64; i++) + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'taskloop'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'taskloop'" "" { target c++14 } } */ +#endif + } + #pragma omp teams default(private) /* { dg-message "note: enclosing 'teams'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'teams'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'teams'" "" { target c++14 } } */ +#endif + } + #pragma omp parallel default(private) /* { dg-message "note: enclosing 'parallel'" } */ + { + y = 1; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ + w = 1; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ + S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'parallel'" } */ + N::x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ + N::z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ +#if __cpp_variable_templates >= 201304 + t<5>++; /* { dg-error "'t' not specified in enclosing 'parallel'" "" { target c++14 } } */ +#endif + } +} diff --git a/gcc/testsuite/g++.dg/pr88173-1.C b/gcc/testsuite/g++.dg/pr88173-1.C new file mode 100644 index 0000000..08fcf97 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr88173-1.C @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -std=c++11" } */ + +#define big __builtin_huge_val() +#define nan __builtin_nan("") + +constexpr bool b1 = big > nan; +constexpr bool b2 = nan < big; + diff --git a/gcc/testsuite/g++.dg/pr88173-2.C b/gcc/testsuite/g++.dg/pr88173-2.C new file mode 100644 index 0000000..aa7d784 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr88173-2.C @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fsignaling-nans -std=c++11" } */ + +#define big __builtin_huge_val() +#define nan __builtin_nan("") + +constexpr bool b1 = big > nan; +constexpr bool b2 = nan < big; + diff --git a/gcc/testsuite/g++.dg/template/dtor11.C b/gcc/testsuite/g++.dg/template/dtor11.C new file mode 100644 index 0000000..9bb58b4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/dtor11.C @@ -0,0 +1,22 @@ +template <class T> +struct B +{ + void f(T *p) + { + p->template A<int>::~A<int>(); + p->A::~A(); + p->~A<int>(); + p->~A(); + p->~T(); + p->T::~T(); + } +}; + +template <class T> +struct A +{ }; + +int main() +{ + B<A<int> >().f(0); +} diff --git a/gcc/testsuite/g++.dg/template/dtor5.C b/gcc/testsuite/g++.dg/template/dtor5.C index 8fa4eeb..d9a1c69 100644 --- a/gcc/testsuite/g++.dg/template/dtor5.C +++ b/gcc/testsuite/g++.dg/template/dtor5.C @@ -11,7 +11,7 @@ template <class T> void f(A<T> *ap) { } template <class T> void g(A<T> *ap) { - ap->~B(); // { dg-error "destructor name" } + ap->~B(); // { dg-error "" } } int main() diff --git a/gcc/testsuite/g++.dg/vect/pr102421.cc b/gcc/testsuite/g++.dg/vect/pr102421.cc new file mode 100644 index 0000000..ccab695 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr102421.cc @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O3" } */ +/* { dg-additional-options "-march=armv8.2-a+sve" { target aarch64-*-* } } */ + +#include <vector> + +template<typename ValueType> +struct BasicVector +{ + ValueType& operator[](int i) { return x_[i]; } + ValueType operator[](int i) const { return x_[i]; } + ValueType x_[3]; +}; +typedef int ivec1[3]; +typedef BasicVector<double> RVec1; +void foo ( + std::vector<RVec1> &x_, + std::vector<RVec1> &xp_, + int homenr, + unsigned short* cFREEZE, + const ivec1* nFreeze) +{ + std::vector<RVec1> xp = xp_; + std::vector<RVec1> x = x_; + for (int i = 0; i < homenr; i++) + { + const int g = cFREEZE[i]; + for (int d = 0; d < 3; d++) + { + if (nFreeze[g][d] == 0) + x[i][d] = xp[i][d]; + } + } +} diff --git a/gcc/testsuite/g++.dg/warn/Wplacement-new-size-10.C b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-10.C new file mode 100644 index 0000000..6b71a83 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wplacement-new-size-10.C @@ -0,0 +1,13 @@ +/* PR middle-end/102243 - ICE on placement new at global scope + { dg-do compile } + { dg-options "-Wall" } */ + +void *operator new (__SIZE_TYPE__, void *); + +char a[2][sizeof (int)]; + +int *p = new (a[1]) int; + +void *operator new[] (__SIZE_TYPE__, void *p) { return p; } + +int *q = new (a[1]) int[1]; diff --git a/gcc/testsuite/g++.dg/warn/uninit-pr93100.C b/gcc/testsuite/g++.dg/warn/uninit-pr93100.C index 56dc894..e08a36d 100644 --- a/gcc/testsuite/g++.dg/warn/uninit-pr93100.C +++ b/gcc/testsuite/g++.dg/warn/uninit-pr93100.C @@ -1,7 +1,7 @@ /* PR tree-optimization/98508 - Sanitizer disable -Wall and -Wextra { dg-do compile } - { dg-require-effective-target no_fsanitize_address } - { dg-options "-O0 -Wall -fsanitize=address" } */ + { dg-options "-O0 -Wall -fsanitize=address" } + { dg-skip-if "no address sanitizer" { no_fsanitize_address } } */ struct S { diff --git a/gcc/testsuite/g++.target/aarch64/sve/static-var-in-template.C b/gcc/testsuite/g++.target/aarch64/sve/static-var-in-template.C new file mode 100644 index 0000000..74237ff --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/sve/static-var-in-template.C @@ -0,0 +1,17 @@ +/* { dg-do compile } */ + +#include <arm_sve.h> + +template <int N> +void f() +{ + static svbool_t pg = svwhilelt_b64(0, N); +} + +int main(int argc, char **argv) +{ + f<2>(); + return 0; +} + +/* { dg-error "SVE type 'svbool_t' does not have a fixed size" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-89.c b/gcc/testsuite/gcc.dg/Warray-bounds-89.c new file mode 100644 index 0000000..2604f65 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Warray-bounds-89.c @@ -0,0 +1,139 @@ +/* Verify warnings and notes for MIN_EXPRs involving either pointers + to distinct objects or one to a known object and the other to + an unknown one. The relational expressions are strictly invalid + but that should be diagnosed by a separate warning. + { dg-do compile } + { dg-options "-O2 -Warray-bounds -Wno-stringop-overflow" } */ + +/* Verify the note points to the larger of the two objects and mentions + the offset into it (alhough the offset would ideally be a part of + the warning). */ +extern char a3[3]; +extern char a5[5]; // { dg-message "at offset 5 into object 'a5' of size 5" "note" } + +void min_a3_a5 (int i) +{ + char *p = a3 + i; + char *q = a5 + i; + + /* The relational expression below is invalid and should be diagnosed + by its own warning independently of -Warray-bounds. */ + char *d = p < q ? p : q; + + d[4] = 0; + + /* Verify the type in the warning corresponds to the larger of the two + objects. */ + d[5] = 0; // { dg-warning "subscript 5 is outside array bounds of 'char\\\[5]'" } +} + + +// Same as above but with the larger array as the first MIN_EXPR operand. +extern char b4[4]; +extern char b6[6]; // { dg-message "at offset 6 into object 'b6' of size 6" "note" } + +void min_b6_b4 (int i) +{ + char *p = b6 + i; + char *q = b4 + i; + char *d = p < q ? p : q; + + d[5] = 0; + d[6] = 0; // { dg-warning "subscript 6 is outside array bounds of 'char\\\[6]'" } +} + + +/* Same as above but with the first MIN_EXPR operand pointing to an unknown + object. */ +extern char c7[7]; // { dg-message "at offset 7 into object 'c7' of size 7" "note" } + +void min_p_c7 (char *p, int i) +{ + char *q = c7 + i; + char *d = p < q ? p : q; + + d[6] = 0; + d[7] = 0; // { dg-warning "subscript 7 is outside array bounds of 'char\\\[7]'" } +} + + +/* Same as above but with the second MIN_EXPR operand pointing to an unknown + object. */ +extern char d8[8]; // { dg-message "at offset 8 into object 'd8' of size 8" "note" } + +void min_d8_p (char *q, int i) +{ + char *p = d8 + i; + char *d = p < q ? p : q; + + d[7] = 0; + d[8] = 0; // { dg-warning "subscript 8 is outside array bounds of 'char\\\[8]'" } +} + + +/* The following are diagnosed by -Wstringop-overflow but, as a result + of PR 101374, not by -Warray-bounds. */ + +struct A3_5 +{ + char a3[3]; + char a5[5]; // { dg-message "at offset 5 into object 'a5' of size 5" "note" { xfail *-*-* } } +}; + +void min_A3_A5 (int i, struct A3_5 *pa3_5) +{ + char *p = pa3_5->a3 + i; + char *q = pa3_5->a5 + i; + + char *d = p < q ? p : q; + + // d[4] = 0; + d[5] = 0; // { dg-warning "subscript 5 is outside array bounds of 'char\\\[5]'" "pr??????" { xfail *-*-* } } +} + + +struct B4_B6 +{ + char b4[4]; + char b6[6]; // { dg-message "at offset 6 into object 'b6' of size 6" "note" { xfail *-*-* } } +}; + +void min_B6_B4 (int i, struct B4_B6 *pb4_b6) +{ + char *p = pb4_b6->b6 + i; + char *q = pb4_b6->b4 + i; + char *d = p < q ? p : q; + + d[5] = 0; + d[6] = 0; // { dg-warning "subscript 6 is outside array bounds of 'char\\\[6]'" "pr??????" { xfail *-*-* } } +} + + +struct C7 +{ + char c7[7]; // { dg-message "at offset 7 into object 'c7' of size 7" "note" { xfail *-*-* } } +}; + +void min_p_C7 (char *p, int i, struct C7 *pc7) +{ + char *q = pc7->c7 + i; + char *d = p < q ? p : q; + + d[6] = 0; + d[7] = 0; // { dg-warning "subscript 7 is outside array bounds of 'char\\\[7]'" "pr??????" { xfail *-*-* } } +} + + +struct D8 +{ + char d8[8]; // { dg-message "at offset 8 into object 'd8' of size 8" "note" { xfail *-*-* } } +}; + +void min_D8_p (char *q, int i, struct D8 *pd8) +{ + char *p = pd8->d8 + i; + char *d = p < q ? p : q; + + d[7] = 0; + d[8] = 0; // { dg-warning "subscript 8 is outside array bounds of 'char\\\[8]'" "pr??????" { xfail *-*-* } } +} diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c index 318d9bd..4b6d1ab 100644 --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c @@ -117,7 +117,7 @@ void test_min (void) { /* Exercise a pointer pointing to a known object plus constant offset with one pointing to an unknown object. */ - char a6[6]; // { dg-message ": destination object 'a6'" "note" } + char a6[6]; // { dg-message "(at offset 1 into )?destination object 'a6'" "note" } char *p1 = ptr; char *p2 = a6 + 1; char *q = MIN (p1, p2); diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-70.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-70.c index 82c4d9f..ccfe2ce 100644 --- a/gcc/testsuite/gcc.dg/Wstringop-overflow-70.c +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-70.c @@ -17,8 +17,8 @@ void* warn_loop (void) char *p = __builtin_malloc (15); for (int i = 0; i != 16; ++i) /* The size of the write below depends on the target. When vectorized - the vector size may be 4 or 16, otherwise it may be a series of byte + the vector size may be 4, 8 or 16, otherwise it may be a series of byte assignments. */ - p[i] = i; // { dg-warning "writing (1|2|4|16) bytes? into a region of size (0|1|3|15)" } + p[i] = i; // { dg-warning "writing (1|2|4|8|16) bytes? into a region of size (0|1|3|7|15)" } return p; } diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-74.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-74.c new file mode 100644 index 0000000..bacec96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-74.c @@ -0,0 +1,22 @@ +/* PR middle-end/102200 - ICE on a min of a decl and pointer in a loop + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +typedef __SIZE_TYPE__ size_t; + +extern char a[], n; + +void f (void) +{ + char *p = a; + size_t end = 1; + + while (n) + { + if (p < (char*)end) + *p = ';'; + + if (p > (char*)&end) + p = (char*)&end; + } +} diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-75.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-75.c new file mode 100644 index 0000000..0b242e8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-75.c @@ -0,0 +1,133 @@ +/* Verify warnings and notes for MIN_EXPRs involving either pointers + to distinct objects or one to a known object and the other to + an unknown one. The relational expressions are strictly invalid + but that should be diagnosed by a separate warning. + { dg-do compile } + { dg-options "-O2 -Wno-array-bounds" } */ + +/* Verify the note points to the larger of the two objects and mentions + the offset into it (although the offset might be better included in + the warning). */ +extern char a3[3]; +extern char a5[5]; // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" } + +void min_a3_a5 (int i) +{ + char *p = a3 + i; + char *q = a5 + i; + + /* The relational expression below is invalid and should be diagnosed + by its own warning independently of -Wstringop-overflow. */ + char *d = p < q ? p : q; + + d[4] = 0; + d[5] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +// Same as above but with the larger array as the first MIN_EXPR operand. +extern char b4[4]; +extern char b6[6]; // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" } + +void min_b6_b4 (int i) +{ + char *p = b6 + i; + char *q = b4 + i; + char *d = p < q ? p : q; + + d[5] = 0; + d[6] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +/* Same as above but with the first MIN_EXPR operand pointing to an unknown + object. */ +extern char c7[7]; // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" } + +void min_p_c7 (char *p, int i) +{ + char *q = c7 + i; + char *d = p < q ? p : q; + + d[6] = 0; + d[7] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +/* Same as above but with the second MIN_EXPR operand pointing to an unknown + object. */ +extern char d8[8]; // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" } + +void min_d8_p (char *q, int i) +{ + char *p = d8 + i; + char *d = p < q ? p : q; + + d[7] = 0; + d[8] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct A3_5 +{ + char a3[3]; + char a5[5]; // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" } +}; + +void min_A3_A5 (int i, struct A3_5 *pa3_5) +{ + char *p = pa3_5->a3 + i; + char *q = pa3_5->a5 + i; + + char *d = p < q ? p : q; + + // d[4] = 0; + d[5] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct B4_B6 +{ + char b4[4]; + char b6[6]; // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" } +}; + +void min_B6_B4 (int i, struct B4_B6 *pb4_b6) +{ + char *p = pb4_b6->b6 + i; + char *q = pb4_b6->b4 + i; + char *d = p < q ? p : q; + + d[5] = 0; + d[6] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct C7 +{ + char c7[7]; // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" } +}; + +void min_p_C7 (char *p, int i, struct C7 *pc7) +{ + char *q = pc7->c7 + i; + char *d = p < q ? p : q; + + d[6] = 0; + d[7] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct D8 +{ + char d8[8]; // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" } +}; + +void min_D8_p (char *q, int i, struct D8 *pd8) +{ + char *p = pd8->d8 + i; + char *d = p < q ? p : q; + + d[7] = 0; + d[8] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c new file mode 100644 index 0000000..18191a1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-76.c @@ -0,0 +1,148 @@ +/* Verify warnings and notes for MAX_EXPRs involving either pointers + to distinct objects or one to a known object and the other to + an unknown one. Unlike for the same object, for unrelated objects + the expected warnings and notes are the same as for MIN_EXPR: when + the order of the objects in the address space cannot be determined + the larger of them is assumed to be used. (This is different for + distinct struct members where the order is given.) + The relational expressions are strictly invalid but that should be + diagnosed by a separate warning. + { dg-do compile } + { dg-options "-O2 -Wno-array-bounds" } */ + +#define MAX(p, q) ((p) > (q) ? (p) : (q)) + +/* Verify that even for MAX_EXPR and like for MIN_EXPR, the note points + to the larger of the two objects and mentions the offset into it + (although the offset might be better included in the warning). */ +extern char a3[3]; +extern char a5[5]; // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" } + +void max_a3_a5 (int i) +{ + char *p = a3 + i; + char *q = a5 + i; + + /* The relational expression below is invalid and should be diagnosed + by its own warning independently of -Wstringop-overflow. */ + char *d = MAX (p, q); + + d[2] = 0; + d[3] = 0; + d[4] = 0; + d[5] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +// Same as above but with the larger array as the first MAX_EXPR operand. +extern char b4[4]; +extern char b6[6]; // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" } + +void max_b6_b4 (int i) +{ + char *p = b6 + i; + char *q = b4 + i; + char *d = MAX (p, q); + + d[3] = 0; + d[4] = 0; + d[5] = 0; + d[6] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +/* Same as above but with the first MAX_EXPR operand pointing to an unknown + object. */ +extern char c7[7]; // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" } + +void max_p_c7 (char *p, int i) +{ + char *q = c7 + i; + char *d = MAX (p, q); + + d[6] = 0; + d[7] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +/* Same as above but with the second MIN_EXPR operand pointing to an unknown + object. */ +extern char d8[8]; // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" } + +void max_d8_p (char *q, int i) +{ + char *p = d8 + i; + char *d = MAX (p, q); + + d[7] = 0; + d[8] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct A3_5 +{ + char a3[3]; // { dg-message "at offset 3 into destination object 'a3' of size 3" "pr??????" { xfail *-*-* } } + char a5[5]; // { dg-message "at offset 5 into destination object 'a5' of size 5" "note" } +}; + +void max_A3_A5 (int i, struct A3_5 *pa3_5) +{ + char *p = pa3_5->a3 + i; + char *q = pa3_5->a5 + i; + + char *d = MAX (p, q); + + d[2] = 0; + d[3] = 0; // { dg-warning "writing 1 byte into a region of size 0" "pr??????" { xfail *-*-* } } + d[4] = 0; + d[5] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct B4_B6 +{ + char b4[4]; + char b6[6]; // { dg-message "at offset 6 into destination object 'b6' of size 6" "note" } +}; + +void max_B6_B4 (int i, struct B4_B6 *pb4_b6) +{ + char *p = pb4_b6->b6 + i; + char *q = pb4_b6->b4 + i; + char *d = MAX (p, q); + + d[3] = 0; + d[4] = 0; + d[5] = 0; + d[6] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct C7 +{ + char c7[7]; // { dg-message "at offset 7 into destination object 'c7' of size 7" "note" } +}; + +void max_p_C7 (char *p, int i, struct C7 *pc7) +{ + char *q = pc7->c7 + i; + char *d = MAX (p, q); + + d[6] = 0; + d[7] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} + + +struct D8 +{ + char d8[8]; // { dg-message "at offset 8 into destination object 'd8' of size 8" "note" } +}; + +void max_D8_p (char *q, int i, struct D8 *pd8) +{ + char *p = pd8->d8 + i; + char *d = MAX (p, q); + + d[7] = 0; + d[8] = 0; // { dg-warning "writing 1 byte into a region of size 0" } +} diff --git a/gcc/testsuite/gcc.dg/associative-math-1.c b/gcc/testsuite/gcc.dg/associative-math-1.c new file mode 100644 index 0000000..3f9ce5b --- /dev/null +++ b/gcc/testsuite/gcc.dg/associative-math-1.c @@ -0,0 +1,17 @@ +/* Test __ASSOCIATIVE_MATH__ is defined with -fassociative-math. */ +/* { dg-do compile } */ +/* { dg-options "-fassociative-math -fno-signed-zeros -fno-trapping-math" } */ + +#ifndef __ASSOCIATIVE_MATH__ +#error "__ASSOCIATIVE_MATH__ not defined" +#endif + +#pragma GCC optimize "-fno-associative-math" +#ifdef __ASSOCIATIVE_MATH__ +#error "__ASSOCIATIVE_MATH__ defined" +#endif + +#pragma GCC optimize "-fassociative-math" +#ifndef __ASSOCIATIVE_MATH__ +#error "__ASSOCIATIVE_MATH__ not defined" +#endif diff --git a/gcc/testsuite/gcc.dg/associative-math-2.c b/gcc/testsuite/gcc.dg/associative-math-2.c new file mode 100644 index 0000000..764d6f0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/associative-math-2.c @@ -0,0 +1,17 @@ +/* Test __ASSOCIATIVE_MATH__ is not defined with -fno-associative-math. */ +/* { dg-do compile } */ +/* { dg-options "-fno-associative-math" } */ + +#ifdef __ASSOCIATIVE_MATH__ +#error "__ASSOCIATIVE_MATH__ defined" +#endif + +#pragma GCC optimize "-fassociative-math" +#ifndef __ASSOCIATIVE_MATH__ +#error "__ASSOCIATIVE_MATH__ not defined" +#endif + +#pragma GCC optimize "-fno-associative-math" +#ifdef __ASSOCIATIVE_MATH__ +#error "__ASSOCIATIVE_MATH__ defined" +#endif diff --git a/gcc/testsuite/gcc.dg/no-signed-zeros-1.c b/gcc/testsuite/gcc.dg/no-signed-zeros-1.c new file mode 100644 index 0000000..3b9cd71 --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-signed-zeros-1.c @@ -0,0 +1,17 @@ +/* Test __NO_SIGNED_ZEROS__ is defined with -fno-signed-zeros. */ +/* { dg-do compile } */ +/* { dg-options "-fno-signed-zeros" } */ + +#ifndef __NO_SIGNED_ZEROS__ +#error "__NO_SIGNED_ZEROS__ not defined" +#endif + +#pragma GCC optimize "-fsigned-zeros" +#ifdef __NO_SIGNED_ZEROS__ +#error "__NO_SIGNED_ZEROS__ defined" +#endif + +#pragma GCC optimize "-fno-signed-zeros" +#ifndef __NO_SIGNED_ZEROS__ +#error "__NO_SIGNED_ZEROS__ not defined" +#endif diff --git a/gcc/testsuite/gcc.dg/no-signed-zeros-2.c b/gcc/testsuite/gcc.dg/no-signed-zeros-2.c new file mode 100644 index 0000000..865a29f --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-signed-zeros-2.c @@ -0,0 +1,17 @@ +/* Test __NO_SIGNED_ZEROS__ is not defined with -fsigned-zeros. */ +/* { dg-do compile } */ +/* { dg-options "-fsigned-zeros" } */ + +#ifdef __NO_SIGNED_ZEROS__ +#error "__NO_SIGNED_ZEROS__ defined" +#endif + +#pragma GCC optimize "-fno-signed-zeros" +#ifndef __NO_SIGNED_ZEROS__ +#error "__NO_SIGNED_ZEROS__ not defined" +#endif + +#pragma GCC optimize "-fsigned-zeros" +#ifdef __NO_SIGNED_ZEROS__ +#error "__NO_SIGNED_ZEROS__ defined" +#endif diff --git a/gcc/testsuite/gcc.dg/no-trapping-math-1.c b/gcc/testsuite/gcc.dg/no-trapping-math-1.c new file mode 100644 index 0000000..f4faec9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-trapping-math-1.c @@ -0,0 +1,17 @@ +/* Test __NO_TRAPPING_MATH__ is defined with -fno-trapping-math. */ +/* { dg-do compile } */ +/* { dg-options "-fno-trapping-math" } */ + +#ifndef __NO_TRAPPING_MATH__ +#error "__NO_TRAPPING_MATH__ not defined" +#endif + +#pragma GCC optimize "-ftrapping-math" +#ifdef __NO_TRAPPING_MATH__ +#error "__NO_TRAPPING_MATH__ defined" +#endif + +#pragma GCC optimize "-fno-trapping-math" +#ifndef __NO_TRAPPING_MATH__ +#error "__NO_TRAPPING_MATH__ not defined" +#endif diff --git a/gcc/testsuite/gcc.dg/no-trapping-math-2.c b/gcc/testsuite/gcc.dg/no-trapping-math-2.c new file mode 100644 index 0000000..1904b5d --- /dev/null +++ b/gcc/testsuite/gcc.dg/no-trapping-math-2.c @@ -0,0 +1,17 @@ +/* Test __NO_TRAPPING_MATH__ is not defined with -ftrapping-math. */ +/* { dg-do compile } */ +/* { dg-options "-ftrapping-math" } */ + +#ifdef __NO_TRAPPING_MATH__ +#error "__NO_TRAPPING_MATH__ defined" +#endif + +#pragma GCC optimize "-fno-trapping-math" +#ifndef __NO_TRAPPING_MATH__ +#error "__NO_TRAPPING_MATH__ not defined" +#endif + +#pragma GCC optimize "-ftrapping-math" +#ifdef __NO_TRAPPING_MATH__ +#error "__NO_TRAPPING_MATH__ defined" +#endif diff --git a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c index 4cba87b..8818192 100644 --- a/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c +++ b/gcc/testsuite/gcc.dg/plugin/diagnostic-test-string-literals-1.c @@ -332,8 +332,8 @@ pr87652 (const char *stem, int counter) OFFSET + end_idx); \ } while (0) -/* { dg-error "unable to read substring location: unable to read source line" "" { target c } 329 } */ -/* { dg-error "unable to read substring location: failed to get ordinary maps" "" { target c++ } 329 } */ +/* { dg-error "unable to read substring location: failed to get ordinary maps" "" { target c } 329 } */ +/* { dg-error "unable to read substring location: macro expansion" "" { target c++ } 329 } */ /* { dg-begin-multiline-output "" } __emit_string_literal_range(__FILE__":%5d: " format, \ ^~~~~~~~ diff --git a/gcc/testsuite/gcc.dg/pr91441.c b/gcc/testsuite/gcc.dg/pr91441.c index 4f7a8fb..4c785f6 100644 --- a/gcc/testsuite/gcc.dg/pr91441.c +++ b/gcc/testsuite/gcc.dg/pr91441.c @@ -1,11 +1,11 @@ /* PR target/91441 */ /* { dg-do compile } */ -/* { dg-require-effective-target no_fsanitize_address }*/ /* { dg-options "--param asan-stack=1 -fsanitize=kernel-address" } */ +/* { dg-skip-if "no address sanitizer" { no_fsanitize_address } } */ int *bar(int *); int *f( int a) { return bar(&a); } -/* { dg-warning ".'-fsanitize=kernel-address' with stack protection is not supported without '-fasan-shadow-offset=' for this target" "" { target *-*-* } 0 } */ +/* { dg-warning ".'-fsanitize=kernel-address' with stack protection is not supported without '-fasan-shadow-offset=' for this target" "" { target riscv*-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/pr96260.c b/gcc/testsuite/gcc.dg/pr96260.c index 734832f..587afb7 100644 --- a/gcc/testsuite/gcc.dg/pr96260.c +++ b/gcc/testsuite/gcc.dg/pr96260.c @@ -1,7 +1,7 @@ /* PR target/96260 */ /* { dg-do compile } */ -/* { dg-require-effective-target no_fsanitize_address }*/ /* { dg-options "--param asan-stack=1 -fsanitize=kernel-address -fasan-shadow-offset=0x100000" } */ +/* { dg-skip-if "no address sanitizer" { no_fsanitize_address } } */ int *bar(int *); int *f( int a) diff --git a/gcc/testsuite/gcc.dg/pr96307.c b/gcc/testsuite/gcc.dg/pr96307.c index cd1c17c..89002b8 100644 --- a/gcc/testsuite/gcc.dg/pr96307.c +++ b/gcc/testsuite/gcc.dg/pr96307.c @@ -1,7 +1,7 @@ /* PR target/96307 */ /* { dg-do compile } */ -/* { dg-require-effective-target no_fsanitize_address }*/ /* { dg-additional-options "-fsanitize=kernel-address --param=asan-instrumentation-with-call-threshold=8" } */ +/* { dg-skip-if "no address sanitizer" { no_fsanitize_address } } */ #include <limits.h> enum a {test1, test2, test3=INT_MAX}; diff --git a/gcc/testsuite/gcc.dg/reciprocal-math-1.c b/gcc/testsuite/gcc.dg/reciprocal-math-1.c new file mode 100644 index 0000000..49173e2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/reciprocal-math-1.c @@ -0,0 +1,17 @@ +/* Test __RECIPROCAL_MATH__ is defined with -freciprocal-math. */ +/* { dg-do compile } */ +/* { dg-options "-freciprocal-math" } */ + +#ifndef __RECIPROCAL_MATH__ +#error "__RECIPROCAL_MATH__ not defined" +#endif + +#pragma GCC optimize "-fno-reciprocal-math" +#ifdef __RECIPROCAL_MATH__ +#error "__RECIPROCAL_MATH__ defined" +#endif + +#pragma GCC optimize "-freciprocal-math" +#ifndef __RECIPROCAL_MATH__ +#error "__RECIPROCAL_MATH__ not defined" +#endif diff --git a/gcc/testsuite/gcc.dg/reciprocal-math-2.c b/gcc/testsuite/gcc.dg/reciprocal-math-2.c new file mode 100644 index 0000000..959baa7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/reciprocal-math-2.c @@ -0,0 +1,17 @@ +/* Test __RECIPROCAL_MATH__ is not defined with -fno-reciprocal-math. */ +/* { dg-do compile } */ +/* { dg-options "-fno-reciprocal-math" } */ + +#ifdef __RECIPROCAL_MATH__ +#error "__RECIPROCAL_MATH__ defined" +#endif + +#pragma GCC optimize "-freciprocal-math" +#ifndef __RECIPROCAL_MATH__ +#error "__RECIPROCAL_MATH__ not defined" +#endif + +#pragma GCC optimize "-fno-reciprocal-math" +#ifdef __RECIPROCAL_MATH__ +#error "__RECIPROCAL_MATH__ defined" +#endif diff --git a/gcc/testsuite/gcc.dg/rounding-math-1.c b/gcc/testsuite/gcc.dg/rounding-math-1.c new file mode 100644 index 0000000..3b13549 --- /dev/null +++ b/gcc/testsuite/gcc.dg/rounding-math-1.c @@ -0,0 +1,17 @@ +/* Test __ROUNDING_MATH__ is defined with -frounding-math. */ +/* { dg-do compile } */ +/* { dg-options "-frounding-math" } */ + +#ifndef __ROUNDING_MATH__ +#error "__ROUNDING_MATH__ not defined" +#endif + +#pragma GCC optimize "-fno-rounding-math" +#ifdef __ROUNDING_MATH__ +#error "__ROUNDING_MATH__ defined" +#endif + +#pragma GCC optimize "-frounding-math" +#ifndef __ROUNDING_MATH__ +#error "__ROUNDING_MATH__ not defined" +#endif diff --git a/gcc/testsuite/gcc.dg/rounding-math-2.c b/gcc/testsuite/gcc.dg/rounding-math-2.c new file mode 100644 index 0000000..6468a84 --- /dev/null +++ b/gcc/testsuite/gcc.dg/rounding-math-2.c @@ -0,0 +1,17 @@ +/* Test __ROUNDING_MATH__ is not defined with -fno-rounding-math. */ +/* { dg-do compile } */ +/* { dg-options "-fno-rounding-math" } */ + +#ifdef __ROUNDING_MATH__ +#error "__ROUNDING_MATH__ defined" +#endif + +#pragma GCC optimize "-frounding-math" +#ifndef __ROUNDING_MATH__ +#error "__ROUNDING_MATH__ not defined" +#endif + +#pragma GCC optimize "-fno-rounding-math" +#ifdef __ROUNDING_MATH__ +#error "__ROUNDING_MATH__ defined" +#endif diff --git a/gcc/testsuite/gcc.dg/torture/20210916.c b/gcc/testsuite/gcc.dg/torture/20210916.c new file mode 100644 index 0000000..0ea6d45 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/20210916.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +typedef union tree_node *tree; +struct tree_base { + unsigned : 1; + unsigned lang_flag_2 : 1; +}; +struct tree_type { + tree main_variant; +}; +union tree_node { + struct tree_base base; + struct tree_type type; +}; +tree finish_struct_t, finish_struct_x; +void finish_struct() +{ + for (; finish_struct_t->type.main_variant;) + finish_struct_x->base.lang_flag_2 = 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/evrp-ignore.c b/gcc/testsuite/gcc.dg/tree-ssa/evrp-ignore.c new file mode 100644 index 0000000..9bfaed6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/evrp-ignore.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-evrp -fno-tree-fre -fdisable-tree-ethread" } */ + +void kill(void); + +void foo (int x, int y, int z) +{ + // Establish y = [-INF, 54] + if (y < 55) + return; + + // Establish z == x + if (z != x) + return; + + // EVRP should transform this to if (0 != 0) + if (y < 30) + x = 0; + + // # x_1 = PHI <x_5(D)(6), 0(7)> + // The earlier transformation should make the edge from bb7 + // unexecutable, allowing x_1 == x_5 to be registered, and + // then fold away this condition as well. + if (x != z) + kill(); + +} +/* { dg-final { scan-tree-dump-not "kill" "evrp" } } */ diff --git a/gcc/testsuite/gcc.dg/uninit-pr102403-c2.c b/gcc/testsuite/gcc.dg/uninit-pr102403-c2.c new file mode 100644 index 0000000..8181143 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr102403-c2.c @@ -0,0 +1,34 @@ +/* PR middle-end/102403 - ICE in init_from_control_deps, at + gimple-predicate-analysis.cc:2364 + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +extern int a[], b, c, d, e, f, g, h; + +inline void foo (void) { b = 1 ^ a[b ^ (c & 1)]; } + +void bar (void); + +int main (void) +{ + if (!f && ~h) + { + if (g) + goto L2; + } + else + { + int m = 0; // { dg-message "declared here" } + L1: + e = m; + L2: + m ^= 1; // { dg-warning "-Wmaybe-uninitialized" } + if (d) + bar (); + + for (int j = 0; j < 10; j++) + foo (); + + goto L1; + } +} diff --git a/gcc/testsuite/gcc.dg/uninit-pr102403.c b/gcc/testsuite/gcc.dg/uninit-pr102403.c new file mode 100644 index 0000000..1e62e98 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr102403.c @@ -0,0 +1,49 @@ +/* PR middle-end/102403 - ICE in init_from_control_deps, at + gimple-predicate-analysis.cc:2364 + { dg-do compile } + { dg-options "-O2 -Wall" } */ + +int __fmaf (void) +{ + int a = 0; + int b, c, d, e, f; + + int r = 0; + + switch (b) // { dg-warning "-Wuninitialized" } + { + default: + c |= 1; + + case 0: + if (c == 0) + a = 1; + + switch (d) { + case 15: + f = c; + break; + + case 11: + case 6: + case 4: + f = c; + case 10: + e = a; + } + + if (e == 0) // { dg-warning "-Wmaybe-uninitialized" } + f = 0; + + r = f; + } + + // The return statement below gets the unhelpful warning: + // 'f' may be used uninitialized in this function [-Wmaybe-uninitialized] + return r; +} + +/* Prune out warnings issued on the wrong lines, such as: + uninit-pr102403.c:9:13: warning: ‘d’ is used uninitialized [-Wuninitialized] + { dg-prune-output "-Wuninitialized" } + { dg-prune-output "-Wmaybe-uninitialized" } */ diff --git a/gcc/testsuite/gcc.dg/uninit-pr93100.c b/gcc/testsuite/gcc.dg/uninit-pr93100.c index 531a5c3..7cb0222 100644 --- a/gcc/testsuite/gcc.dg/uninit-pr93100.c +++ b/gcc/testsuite/gcc.dg/uninit-pr93100.c @@ -1,7 +1,7 @@ /* PR tree-optimization/93100 - gcc -fsanitize=address inhibits -Wuninitialized { dg-do compile } { dg-options "-Wall -fsanitize=address" } - { dg-skip-if "sanitize address" { "powerpc-ibm-aix*" } } */ + { dg-skip-if "no address sanitizer" { no_fsanitize_address } } */ struct A { diff --git a/gcc/testsuite/gcc.dg/vect/pr65206.c b/gcc/testsuite/gcc.dg/vect/pr65206.c new file mode 100644 index 0000000..3b62626 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr65206.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target vect_double } */ +/* { dg-additional-options "-fno-trapping-math -fno-allow-store-data-races" } */ +/* { dg-additional-options "-mavx" { target avx } } */ + +#define N 1024 + +double a[N], b[N]; + +void foo () +{ + for (int i = 0; i < N; ++i) + if (b[i] < 3.) + a[i] += b[i]; +} + +/* We get a .MASK_STORE because while the load of a[i] does not trap + the store would introduce store data races. Make sure we still + can handle the data dependence with zero distance. */ + +/* { dg-final { scan-tree-dump-not "versioning for alias required" "vect" { target { vect_masked_store || avx } } } } */ +/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { vect_masked_store || avx } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-1.c b/gcc/testsuite/gcc.target/i386/auto-init-1.c index b7690df..3391be1 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-1.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-1.c @@ -1,6 +1,6 @@ /* Verify zero initialization for integer and pointer type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -fno-stack-protector -march=x86-64 -mtune=generic" } */ #ifndef __cplusplus # define bool _Bool diff --git a/gcc/testsuite/gcc.target/i386/auto-init-2.c b/gcc/testsuite/gcc.target/i386/auto-init-2.c index e76fc25..b23f733 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-2.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-2.c @@ -1,6 +1,6 @@ /* Verify pattern initialization for integer and pointer type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ #ifndef __cplusplus # define bool _Bool @@ -31,6 +31,8 @@ void foo() /* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe" 2 "expand" } } */ /* { dg-final { scan-rtl-dump-times "0xfffffffffffffefe" 1 "expand" } } */ -/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" } } */ -/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 3 "expand" } } */ +/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target lp64 } } } */ +/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 3 "expand" { target lp64 } } } */ +/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 4 "expand" { target ia32 } } } */ +/* { dg-final { scan-rtl-dump-times "0xfefefefefefefefe" 1 "expand" { target ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-3.c b/gcc/testsuite/gcc.target/i386/auto-init-3.c index 300ddfb..df31761 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-3.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-3.c @@ -1,6 +1,6 @@ /* Verify zero initialization for floating point type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64 -mtune=generic" } */ long double result; @@ -14,4 +14,5 @@ long double foo() return result; } -/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3 } } */ +/* { dg-final { scan-assembler-times "pxor\t\\\%xmm0, \\\%xmm0" 3 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "fldz" 3 { target ia32} } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-4.c b/gcc/testsuite/gcc.target/i386/auto-init-4.c index abe0b7e..554a2c5 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-4.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-4.c @@ -1,6 +1,6 @@ /* Verify pattern initialization for floating point type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ long double result; @@ -14,7 +14,9 @@ long double foo() return result; } -/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" } } */ -/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" } } */ -/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" } } */ +/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 1 "expand" { target lp64 } } } */ +/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 1 "expand" { target lp64 } } } */ +/* { dg-final { scan-rtl-dump-times "0xfffffffffffffffe\\\]\\\) repeated x16" 1 "expand" { target lp64 } } } */ +/* { dg-final { scan-rtl-dump-times "0xfffffffffefefefe" 2 "expand" { target ia32 } } } */ +/* { dg-final { scan-rtl-dump-times "\\\[0xfefefefefefefefe\\\]" 2 "expand" { target ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-5.c b/gcc/testsuite/gcc.target/i386/auto-init-5.c index b2e708c..27d971f 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-5.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-5.c @@ -1,6 +1,6 @@ /* Verify zero initialization for complex type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=zero" } */ _Complex long double result; @@ -15,6 +15,7 @@ _Complex long double foo() return result; } -/* { dg-final { scan-assembler-times "\\.long\t0" 14 } } */ +/* { dg-final { scan-assembler-times "\\.long\t0" 14 { target lp64 } } } */ +/* { dg-final { scan-assembler-times "\\.long\t0" 12 { target ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-6.c b/gcc/testsuite/gcc.target/i386/auto-init-6.c index c79c039..f75081e 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-6.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-6.c @@ -1,6 +1,6 @@ /* Verify pattern initialization for complex type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ _Complex long double result; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-7.c b/gcc/testsuite/gcc.target/i386/auto-init-7.c index 0114379..7e32576 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-7.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-7.c @@ -1,6 +1,6 @@ /* Verify zero initialization for array, union, and structure type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -fno-stack-protector -msse" } */ struct S { diff --git a/gcc/testsuite/gcc.target/i386/auto-init-8.c b/gcc/testsuite/gcc.target/i386/auto-init-8.c index 28fbeb7..666ee14 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-8.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-8.c @@ -1,6 +1,6 @@ /* Verify pattern initialization for array, union, and structure type automatic variables. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct S { diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-1.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-1.c index a238b8b..149a04f 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-1.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-1.c @@ -1,7 +1,7 @@ /* Verify zero initialization for structure type automatic variables with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_aligned { int internal1; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-10.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-10.c index 3fc6b07..1125bcf 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-10.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-10.c @@ -1,7 +1,7 @@ /* Verify pattern initialization for array type with structure element with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_trailing_hole { int one; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-11.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-11.c index cc982b9..4f90ad2 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-11.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-11.c @@ -1,7 +1,7 @@ /* Verify zero initialization for union type with structure field with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_trailing_hole { int one; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-12.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-12.c index 0fbdb6c..21a1ee2 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-12.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-12.c @@ -1,7 +1,7 @@ /* Verify pattern initialization for union type with structure field with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_trailing_hole { int one; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-2.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-2.c index 5739aa1..483b79a 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-2.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-2.c @@ -1,7 +1,7 @@ /* Verify pattern initialization for structure type automatic variables with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_aligned { int internal1; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c index 8a6d764..220a9f2 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-3.c @@ -1,7 +1,7 @@ /* Verify zero initialization for nested structure type automatic variables with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64" } */ struct test_aligned { unsigned internal1; @@ -24,7 +24,9 @@ int foo () } /* { dg-final { scan-assembler "movl\t\\\$0," } } */ -/* { dg-final { scan-assembler "movl\t\\\$16," } } */ -/* { dg-final { scan-assembler "rep stosq" } } */ +/* { dg-final { scan-assembler "movl\t\\\$16," { target lp64 } } } */ +/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */ +/* { dg-final { scan-assembler "movl\t\\\$32," { target ia32 } } } */ +/* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-4.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-4.c index d7be326..2908b3f 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-4.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-4.c @@ -1,7 +1,7 @@ /* Verify pattern initialization for nested structure type automatic variables with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_aligned { unsigned internal1; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-5.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-5.c index 569b09a..e17a621 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-5.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-5.c @@ -1,7 +1,7 @@ /* Verify zero initialization for structure type automatic variables with tail padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_trailing_hole { char *one; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-6.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-6.c index 4e0b614..754f8af 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-6.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-6.c @@ -1,7 +1,7 @@ /* Verify pattern initialization for structure type automatic variables with tail padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse" } */ struct test_trailing_hole { char *one; diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c index b5abffb..c136e1c 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-7.c @@ -1,7 +1,7 @@ /* Verify zero initialization for structure type automatic variables with padding and has explicit initialization. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -fdump-rtl-expand -march=x86-64 -mtune=generic -msse -fno-stack-protector" } */ struct test_trailing_hole { int one; @@ -17,6 +17,7 @@ int foo () return var.four; } -/* { dg-final { scan-assembler-times "movq\t\\\$0," 2 } } */ +/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */ +/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c index 66591cf..45baa3c 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-8.c @@ -1,7 +1,7 @@ /* Verify pattern initialization for structure type automatic variables with padding and has explicit initialization. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=pattern" } */ +/* { dg-options "-ftrivial-auto-var-init=pattern -fdump-rtl-expand -march=x86-64 -mtune=generic -msse -fno-stack-protector" } */ struct test_trailing_hole { int one; @@ -17,6 +17,5 @@ int foo () return var.four; } -/* { dg-final { scan-assembler-times "movq\t\\\$0," 2 } } */ - - +/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\) repeated x16" 1 "expand" { target ia32 } } } */ +/* { dg-final { scan-rtl-dump-times "const_int 0 \\\[0\\\]\\\)" 1 "expand" { target lp64 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c b/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c index 1ff900f..eafa327 100644 --- a/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c +++ b/gcc/testsuite/gcc.target/i386/auto-init-padding-9.c @@ -1,7 +1,7 @@ /* Verify zero initialization for array type with structure element with padding. */ /* { dg-do compile } */ -/* { dg-options "-ftrivial-auto-var-init=zero" } */ +/* { dg-options "-ftrivial-auto-var-init=zero -march=x86-64" } */ struct test_trailing_hole { int one; @@ -19,4 +19,7 @@ int foo () } /* { dg-final { scan-assembler "movl\t\\\$0," } } */ -/* { dg-final { scan-assembler "rep stosq" } } */ +/* { dg-final { scan-assembler "movl\t\\\$20," { target lp64} } } */ +/* { dg-final { scan-assembler "rep stosq" { target lp64 } } } */ +/* { dg-final { scan-assembler "movl\t\\\$40," { target ia32} } } */ +/* { dg-final { scan-assembler "rep stosl" { target ia32 } } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx-1.c b/gcc/testsuite/gcc.target/i386/avx-1.c index add3e0c..a04c678 100644 --- a/gcc/testsuite/gcc.target/i386/avx-1.c +++ b/gcc/testsuite/gcc.target/i386/avx-1.c @@ -757,6 +757,36 @@ #define __builtin_ia32_vcvtsh2sd_mask_round(A, B, C, D, E) __builtin_ia32_vcvtsh2sd_mask_round(A, B, C, D, 8) #define __builtin_ia32_vcvtss2sh_mask_round(A, B, C, D, E) __builtin_ia32_vcvtss2sh_mask_round(A, B, C, D, 8) #define __builtin_ia32_vcvtsd2sh_mask_round(A, B, C, D, E) __builtin_ia32_vcvtsd2sh_mask_round(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_mask(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_mask(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_mask(A, B, C, D, E) __builtin_ia32_vfmaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfmaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfmaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_mask(A, B, C, D, E) __builtin_ia32_vfnmaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfnmaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfnmaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_mask(A, B, C, D, E) __builtin_ia32_vfmsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfmsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfmsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_mask(A, B, C, D, E) __builtin_ia32_vfnmsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfnmsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfnmsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_mask(A, B, C, D, E) __builtin_ia32_vfmaddsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_mask3(A, B, C, D, E) __builtin_ia32_vfmaddsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_maskz(A, B, C, D, E) __builtin_ia32_vfmaddsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_mask(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_mask3(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_maskz(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_mask(A, B, C, D, E) __builtin_ia32_vfmsubsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_mask3(A, B, C, D, E) __builtin_ia32_vfmsubsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_maskz(A, B, C, D, E) __builtin_ia32_vfmsubsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_mask(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_mask3(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_maskz(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_maskz(A, B, C, D, 8) /* avx512fp16vlintrin.h */ #define __builtin_ia32_cmpph128_mask(A, B, C, D) __builtin_ia32_cmpph128_mask(A, B, 1, D) diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-broadcast-1.c b/gcc/testsuite/gcc.target/i386/avx512fp16-broadcast-1.c new file mode 100644 index 0000000..3e2397f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-broadcast-1.c @@ -0,0 +1,33 @@ +/* PR target/87767 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ +/* { dg-additional-options "-mdynamic-no-pic" { target { *-*-darwin* && ia32 } } } +/* { dg-final { scan-assembler-times "\[^\n\]*\\\{1to8\\\}" 4 } } */ +/* { dg-final { scan-assembler-times "\[^\n\]*\\\{1to16\\\}" 4 } } */ +/* { dg-final { scan-assembler-times "\[^\n\]*\\\{1to32\\\}" 4 } } */ + +typedef _Float16 v8hf __attribute__ ((vector_size (16))); +typedef _Float16 v16hf __attribute__ ((vector_size (32))); +typedef _Float16 v32hf __attribute__ ((vector_size (64))); + +#define CONSTANT 101; +#define FOO(VTYPE, OP_NAME, OP) \ +VTYPE \ + __attribute__ ((noipa)) \ +foo_##OP_NAME##_##VTYPE (VTYPE a) \ +{ \ + return a OP CONSTANT; \ +} \ + +FOO (v8hf, add, +); +FOO (v16hf, add, +); +FOO (v32hf, add, +); +FOO (v8hf, sub, -); +FOO (v16hf, sub, -); +FOO (v32hf, sub, -); +FOO (v8hf, mul, *); +FOO (v16hf, mul, *); +FOO (v32hf, mul, *); +FOO (v8hf, div, /); +FOO (v16hf, div, /); +FOO (v32hf, div, /); diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-broadcast-2.c b/gcc/testsuite/gcc.target/i386/avx512fp16-broadcast-2.c new file mode 100644 index 0000000..016e0ea --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-broadcast-2.c @@ -0,0 +1,53 @@ +/* PR target/87767 */ +/* { dg-do run } */ +/* { dg-options "-O1 -mavx512fp16 -mavx512dq -mavx512vl" } */ +/* { dg-require-effective-target avx512dq } */ +/* { dg-require-effective-target avx512vl } */ +/* { dg-require-effective-target avx512fp16 } */ + +#define AVX512DQ +#define AVX512VL +#define AVX512FP16 +#include "avx512f-helper.h" + +#include "avx512fp16-broadcast-1.c" + +#define RTEST(VTYPE, TYPE, N, OP_NAME, OP) \ + do \ + { \ + TYPE exp[N], src[N]; \ + VTYPE res; \ + for (int i = 0; i < N; i++) \ + src[i] = 2.0 * i - 8.4; \ + res = foo_##OP_NAME##_##VTYPE (*(VTYPE*)&src[0]); \ + for (int i = 0; i < N; i ++) \ + exp[i] = src[i] OP CONSTANT; \ + for (int j = 0; j < N; j++) \ + { \ + if (res[j] != exp[j]) \ + abort(); \ + } \ + } \ + while (0) + +void +test_256 (void) +{ + RTEST (v8hf, _Float16, 8, add, +); + RTEST (v16hf, _Float16, 16, add, +); + RTEST (v32hf, _Float16, 32, add, +); + RTEST (v8hf, _Float16, 8, sub, -); + RTEST (v16hf, _Float16, 16, sub, -); + RTEST (v32hf, _Float16, 32, sub, -); + RTEST (v8hf, _Float16, 8, mul, *); + RTEST (v16hf, _Float16, 16, mul, *); + RTEST (v32hf, _Float16, 32, mul, *); + RTEST (v8hf, _Float16, 8, div, /); + RTEST (v16hf, _Float16, 16, div, /); + RTEST (v32hf, _Float16, 32, div, /); +} + +void +test_128 (void) +{ +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-neg-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-neg-1a.c new file mode 100644 index 0000000..bf7693e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-neg-1a.c @@ -0,0 +1,19 @@ +/* { dg-do compile} */ +/* { dg-options "-O2 -mavx512fp16" } */ + +/* { dg-final { scan-assembler-times "vpxord\[ \\t\]+\[^\n\r\]*%zmm0" 1 } } */ +/* { dg-final { scan-assembler-times "vxorps\[ \\t\]+\[^\n\r\]*%xmm0" 1 } } */ + +#include<immintrin.h> + +_Float16 +neghf (_Float16 a) +{ + return -a; +} + +__m512h +neghf512 (__m512h a) +{ + return -a; +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-neg-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-neg-1b.c new file mode 100644 index 0000000..770f7b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-neg-1b.c @@ -0,0 +1,33 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +static void +test_512 (void) +{ + V512 v1, v2, v3, v4, exp, res; + int i; + init_src(); + + unpack_ph_2twops(src1, &v1, &v2); + v1.f32[0] = -v1.f32[0]; + exp = pack_twops_2ph(v1, v2); + res.zmmh = src1.zmmh; + res.f16[0] = -res.f16[0]; + check_results(&res, &exp, 32, "neg"); + + unpack_ph_2twops(src1, &v1, &v2); + for (i=0; i<16; i++) + { + v1.f32[i] = -v1.f32[i]; + v2.f32[i] = -v2.f32[i]; + } + exp = pack_twops_2ph(v1, v2); + res.zmmh = -src1.zmmh; + check_results(&res, &exp, 32, "neg"); + if (n_errs != 0) { + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-scalar-bitwise-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-scalar-bitwise-1a.c new file mode 100644 index 0000000..a9e45fb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-scalar-bitwise-1a.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mavx512fp16 -mavx512vl" } */ + +_Float16 +f1 (_Float16 x) +{ + return __builtin_fabsf16 (x); +} + +_Float16 +f2 (_Float16 x, _Float16 y) +{ + return __builtin_copysignf16 (x, y); +} + +_Float16 +f3 (_Float16 x) +{ + return -x; +} + +_Float16 +f4 (_Float16 x, _Float16 y) +{ + return x * __builtin_copysignf16 (1, y); +} + + +/* { dg-final { scan-assembler-times "vandps\[^\n\r\]*xmm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler-times "vpternlogd\[^\n\r\]*xmm\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm\[0-9\]" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-scalar-bitwise-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-scalar-bitwise-1b.c new file mode 100644 index 0000000..7a29251 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-scalar-bitwise-1b.c @@ -0,0 +1,82 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-Ofast -mavx512fp16 -mavx512dq" } */ + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +void NOINLINE +emulate_absneg_ph (V512 * dest, V512 op1, int abs) +{ + V512 v1, v2, v3, v4; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(*dest, &v3, &v4); + + for (i = 0; i != 16; i++) { + if (abs) { + v3.f32[i] = __builtin_fabsf (v1.f32[i]); + v4.f32[i] = __builtin_fabsf (v2.f32[i]); + } + else { + v3.f32[i] = -v1.f32[i]; + v4.f32[i] = -v2.f32[i]; + } + } + *dest = pack_twops_2ph(v3, v4); +} + +void NOINLINE +emulate_copysign_ph (V512 * dest, V512 op1, V512 op2, int xorsign) +{ + V512 v1, v2, v3, v4, v5, v6; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v5, &v6); + + for (i = 0; i != 16; i++) { + if (xorsign) { + v5.f32[i] = v1.f32[i] * __builtin_copysignf (1, v3.f32[i]); + v6.f32[i] = v2.f32[i] * __builtin_copysignf (1, v4.f32[i]); + } + else { + v5.f32[i] = __builtin_copysignf (v1.f32[i], v3.f32[i]); + v6.f32[i] = __builtin_copysignf (v2.f32[i], v4.f32[i]); + } + } + *dest = pack_twops_2ph(v5, v6); +} + +void +test_512 (void) +{ + V512 res, exp; + + init_src (); + + /* Abs for float16. */ + emulate_absneg_ph (&exp, src1, 1); + res.f16[0] = __builtin_fabsf16 (src1.f16[0]); + check_results (&res, &exp, 1, "abs_float16"); + + /* Neg for float16. */ + emulate_absneg_ph (&exp, src1, 0); + res.f16[0] = -(src1.f16[0]); + check_results (&res, &exp, 1, "neg_float16"); + + /* Copysign for float16. */ + emulate_copysign_ph (&exp, src1, src2, 0); + res.f16[0] = __builtin_copysignf16 (src1.f16[0], src2.f16[0]); + check_results (&res, &exp, 1, "copysign_float16"); + + /* Xorsign for float16. */ + emulate_copysign_ph (&exp, src1, src2, 1); + res.f16[0] = src1.f16[0] * __builtin_copysignf16 (1, src2.f16[0]); + check_results (&res, &exp, 1, "xorsign_float16"); + + if (n_errs != 0) { + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vector-bitwise-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vector-bitwise-1a.c new file mode 100644 index 0000000..758aec1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vector-bitwise-1a.c @@ -0,0 +1,121 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mavx512vl -mavx512fp16 -mprefer-vector-width=512" } */ + +#include<immintrin.h> +__m128h +f1 (__m128h x) +{ + int i = 0; + __m128h y; + for (; i != 8; i++) + y[i] = __builtin_fabsf16 (x[i]); + return y; +} + +__m256h +f2 (__m256h x) +{ + int i = 0; + __m256h y; + for (; i != 16; i++) + y[i] = __builtin_fabsf16 (x[i]); + return y; +} + +__m512h +f3 (__m512h x) +{ + int i = 0; + __m512h y; + for (; i != 32; i++) + y[i] = __builtin_fabsf16 (x[i]); + return y; +} + +__m128h +f4 (__m128h x) +{ + return -x; +} + +__m256h +f5 (__m256h x) +{ + return -x; +} + +__m512h +f6 (__m512h x) +{ + return -x; +} + +__m128h +f7 (__m128h x, __m128h y) +{ + int i = 0; + __m128h z; + for (; i != 8; i++) + z[i] = __builtin_copysignf16 (x[i], y[i]); + return z; +} + +__m256h +f8 (__m256h x, __m256h y) +{ + int i = 0; + __m256h z; + for (; i != 16; i++) + z[i] = __builtin_copysignf16 (x[i], y[i]); + return z; +} + +__m512h +f9 (__m512h x, __m512h y) +{ + int i = 0; + __m512h z; + for (; i != 32; i++) + z[i] = __builtin_copysignf16 (x[i], y[i]); + return z; +} + +__m128h +f10 (__m128h x, __m128h y) +{ + int i = 0; + __m128h z; + for (; i != 8; i++) + z[i] = x[i] * __builtin_copysignf16 (1, y[i]); + return z; +} + +__m256h +f11 (__m256h x, __m256h y) +{ + int i = 0; + __m256h z; + for (; i != 16; i++) + z[i] = x[i] * __builtin_copysignf16 (1, y[i]); + return z; +} + +__m512h +f12 (__m512h x, __m512h y) +{ + int i = 0; + __m512h z; + for (; i != 32; i++) + z[i] = x[i] * __builtin_copysignf16 (1, y[i]); + return z; +} + +/* { dg-final { scan-assembler "vandps\[^\n\r\]*xmm0" } } */ +/* { dg-final { scan-assembler "vandps\[^\n\r\]*ymm0" } } */ +/* { dg-final { scan-assembler "vpandd\[^\n\r\]*zmm0" } } */ +/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*xmm0" 1 } } */ +/* { dg-final { scan-assembler-times "vxorps\[^\n\r\]*ymm0" 1 } } */ +/* { dg-final { scan-assembler-times "vpxord\[^\n\r\]*zmm0" 1 } } */ +/* { dg-final { scan-assembler-times "vpternlogd\[^\n\r\]*xmm\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "vpternlogd\[^\n\r\]*ymm\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "vpternlogd\[^\n\r\]*zmm\[0-9\]" 2 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vector-bitwise-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vector-bitwise-1b.c new file mode 100644 index 0000000..1398b36 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vector-bitwise-1b.c @@ -0,0 +1,119 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-Ofast -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +void NOINLINE +emulate_absneg_ph (V512 * dest, V512 op1, int abs) +{ + V512 v1, v2, v3, v4; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(*dest, &v3, &v4); + + for (i = 0; i != 16; i++) { + if (abs) { + v3.f32[i] = __builtin_fabsf (v1.f32[i]); + v4.f32[i] = __builtin_fabsf (v2.f32[i]); + } + else { + v3.f32[i] = -v1.f32[i]; + v4.f32[i] = -v2.f32[i]; + } + } + *dest = pack_twops_2ph(v3, v4); +} + +void NOINLINE +emulate_copysign_ph (V512 * dest, V512 op1, V512 op2, int xorsign) +{ + V512 v1, v2, v3, v4, v5, v6; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v5, &v6); + + for (i = 0; i != 16; i++) { + if (xorsign) { + v5.f32[i] = v1.f32[i] * __builtin_copysignf (1, v3.f32[i]); + v6.f32[i] = v2.f32[i] * __builtin_copysignf (1, v4.f32[i]); + } + else { + v5.f32[i] = __builtin_copysignf (v1.f32[i], v3.f32[i]); + v6.f32[i] = __builtin_copysignf (v2.f32[i], v4.f32[i]); + } + } + *dest = pack_twops_2ph(v5, v6); +} + + +void +test_512 (void) +{ + V512 res, exp; + + init_src (); + + /* Abs for vector float16. */ + emulate_absneg_ph (&exp, src1, 1); + for (int i = 0; i != 8; i++) + res.f16[i] = __builtin_fabsf16 (src1.f16[i]); + check_results (&res, &exp, 8, "abs_m128h"); + + for (int i = 0; i != 16; i++) + res.f16[i] = __builtin_fabsf16 (src1.f16[i]); + check_results (&res, &exp, 16, "abs_m256h"); + + for (int i = 0; i != 32; i++) + res.f16[i] = __builtin_fabsf16 (src1.f16[i]); + check_results (&res, &exp, 32, "abs_m512h"); + + /* Neg for vector float16. */ + emulate_absneg_ph (&exp, src1, 0); + for (int i = 0; i != 8; i++) + res.f16[i] = -(src1.f16[i]); + check_results (&res, &exp, 8, "neg_m128h"); + + for (int i = 0; i != 16; i++) + res.f16[i] = -(src1.f16[i]); + check_results (&res, &exp, 16, "neg_m256h"); + + for (int i = 0; i != 32; i++) + res.f16[i] = -(src1.f16[i]); + check_results (&res, &exp, 32, "neg_m512h"); + + /* Copysign for vector float16. */ + emulate_copysign_ph (&exp, src1, src2, 0); + for (int i = 0; i != 8; i++) + res.f16[i] = __builtin_copysignf16 (src1.f16[i], src2.f16[i]); + check_results (&res, &exp, 8, "copysign_m128h"); + + for (int i = 0; i != 16; i++) + res.f16[i] = __builtin_copysignf16 (src1.f16[i], src2.f16[i]); + check_results (&res, &exp, 16, "copysign_m256h"); + + for (int i = 0; i != 32; i++) + res.f16[i] = __builtin_copysignf16 (src1.f16[i], src2.f16[i]); + check_results (&res, &exp, 32, "copysign_m512h"); + + /* Xorsign for vector float16. */ + emulate_copysign_ph (&exp, src1, src2, 1); + for (int i = 0; i != 8; i++) + res.f16[i] = src1.f16[i] * __builtin_copysignf16 (1, src2.f16[i]); + check_results (&res, &exp, 8, "xorsign_m128h"); + + for (int i = 0; i != 16; i++) + res.f16[i] = src1.f16[i] * __builtin_copysignf16 (1, src2.f16[i]); + check_results (&res, &exp, 16, "xorsign_m256h"); + + for (int i = 0; i != 32; i++) + res.f16[i] = src1.f16[i] * __builtin_copysignf16 (1, src2.f16[i]); + check_results (&res, &exp, 32, "xorsign_m512h"); + + if (n_errs != 0) { + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXph-1a.c new file mode 100644 index 0000000..f9e2777 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmadd231ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd231ph\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m512h x1, x2, x3; +volatile __mmask32 m; + +void extern +avx512f_test (void) +{ + x1 = _mm512_fmadd_ph (x1, x2, x3); + x1 = _mm512_mask_fmadd_ph (x1, m, x2, x3); + x3 = _mm512_mask3_fmadd_ph (x1, x2, x3, m); + x1 = _mm512_maskz_fmadd_ph (m, x1, x2, x3); + x1 = _mm512_fmadd_round_ph (x1, x2, x3, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + x1 = _mm512_mask_fmadd_round_ph (x1, m, x2, x3, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + x3 = _mm512_mask3_fmadd_round_ph (x1, x2, x3, m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); + x1 = _mm512_maskz_fmadd_round_ph (m, x1, x2, x3, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXph-1b.c new file mode 100644 index 0000000..71c2b8f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXph-1b.c @@ -0,0 +1,160 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS (AVX512F_LEN / 16) + +void NOINLINE +EMULATE(fmadd_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = v1.f32[i] * v3.f32[i] + v7.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = v2.f32[i] * v4.f32[i] + v8.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void NOINLINE +EMULATE(m_fmadd_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = v7.f32[i] * v1.f32[i] + v3.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = v8.f32[i] * v2.f32[i] + v4.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void +TEST (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + EMULATE(fmadd_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmadd_ph) (HF(src1), HF(src2), + HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmadd_ph); + + init_dest(&res, &exp); + EMULATE(m_fmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmadd_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2)); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmadd_ph); + + init_dest(&res, &exp); + EMULATE(fmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmadd_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmadd_ph); + + init_dest(&res, &exp); + EMULATE(fmadd_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmadd_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmadd_ph); + +#if AVX512F_LEN == 512 + init_dest(&res, &exp); + EMULATE(fmadd_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmadd_round_ph) (HF(src1), HF(src2), + HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmadd_ph); + + init_dest(&res, &exp); + EMULATE(m_fmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmadd_round_ph) (HF(res), MASK_VALUE, HF(src1), + HF(src2), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmadd_ph); + + EMULATE(fmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmadd_round_ph) (HF(src1), HF(src2), HF(res), + MASK_VALUE, _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmadd_ph); + + init_dest(&res, &exp); + EMULATE(fmadd_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmadd_round_ph) (ZMASK_VALUE, HF(src1), HF(src2), + HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmadd_ph); +#endif + + if (n_errs != 0) { + abort (); + } +} + + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXsh-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXsh-1a.c new file mode 100644 index 0000000..472454d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXsh-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmadd...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmadd231sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...sh\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...sh\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd231sh\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...sh\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m128h a, b, c; +volatile __mmask8 m; + +void extern +avx512f_test (void) +{ + a = _mm_fmadd_sh (a, b, c); + a = _mm_mask_fmadd_sh (a, m, b, c); + c = _mm_mask3_fmadd_sh (a, b, c, m); + a = _mm_maskz_fmadd_sh (m, a, b, c); + a = _mm_fmadd_round_sh (a, b, c, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + a = _mm_mask_fmadd_round_sh (a, m, b, c, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + c = _mm_mask3_fmadd_round_sh (a, b, c, m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); + a = _mm_maskz_fmadd_round_sh (m, a, b, c, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXsh-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXsh-1b.c new file mode 100644 index 0000000..a0eca9c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddXXXsh-1b.c @@ -0,0 +1,90 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS 8 + +void NOINLINE +emulate_fmadd_sh(V512 * dest, V512 op1, V512 op2, + __mmask8 k, int zero_mask, int mask3) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + if ((k&1) || !k) + v5.f32[0] = v1.f32[0] * v3.f32[0] + v7.f32[0]; + else if (zero_mask) + v5.f32[0] = 0; + else + v5.f32[0] = v7.f32[0]; + + for (i = 1; i < 8; i++){ + if (mask3) + v5.f32[i] = v7.f32[i]; + else + v5.f32[i] = v1.f32[i]; + } + *dest = pack_twops_2ph(v5, v6); +} + +void +test_512 (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fmadd_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_fmadd_sh"); + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fmadd_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + 0x1); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fmadd_sh"); + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fmadd_sh(src1.xmmh[0], 0x1, src2.xmmh[0], + res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fmadd_sh"); + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fmadd_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fmadd_sh"); + + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fmadd_round_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_fmadd_sh"); + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fmadd_round_sh(src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], 0x1, _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fmadd_sh"); + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fmadd_round_sh(src1.xmmh[0], 0x1, src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fmadd_sh"); + init_dest(&res, &exp); + emulate_fmadd_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fmadd_round_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fmadd_sh"); + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddsubXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddsubXXXph-1a.c new file mode 100644 index 0000000..7063646 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddsubXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub231ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub231ph\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m512h x1, x2, x3; +volatile __mmask32 m; + +void extern +avx512f_test (void) +{ + x1 = _mm512_fmaddsub_ph (x1, x2, x3); + x1 = _mm512_mask_fmaddsub_ph (x1, m, x2, x3); + x3 = _mm512_mask3_fmaddsub_ph (x1, x2, x3, m); + x1 = _mm512_maskz_fmaddsub_ph (m, x1, x2, x3); + x1 = _mm512_fmaddsub_round_ph (x1, x2, x3, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + x1 = _mm512_mask_fmaddsub_round_ph (x1, m, x2, x3, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + x3 = _mm512_mask3_fmaddsub_round_ph (x1, x2, x3, m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); + x1 = _mm512_maskz_fmaddsub_round_ph (m, x1, x2, x3, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddsubXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddsubXXXph-1b.c new file mode 100644 index 0000000..16cf0af1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmaddsubXXXph-1b.c @@ -0,0 +1,171 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS (AVX512F_LEN / 16) + +void NOINLINE +EMULATE(fmaddsub_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + if (i % 2 == 1) { + v5.f32[i] = v1.f32[i] * v3.f32[i] + v7.f32[i]; + } + else { + v5.f32[i] = v1.f32[i] * v3.f32[i] - v7.f32[i]; + } + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + if (i % 2 == 1) { + v6.f32[i] = v2.f32[i] * v4.f32[i] + v8.f32[i]; + } + else { + v6.f32[i] = v2.f32[i] * v4.f32[i] - v8.f32[i]; + } + } + } + *dest = pack_twops_2ph(v5, v6); +} + +void NOINLINE +EMULATE(m_fmaddsub_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + if (i % 2 == 1) { + v5.f32[i] = v1.f32[i] * v7.f32[i] + v3.f32[i]; + } + else { + v5.f32[i] = v1.f32[i] * v7.f32[i] - v3.f32[i]; + } + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + if (i % 2 == 1) { + v6.f32[i] = v2.f32[i] * v8.f32[i] + v4.f32[i]; + } + else { + v6.f32[i] = v2.f32[i] * v8.f32[i] - v4.f32[i]; + } + } + } + *dest = pack_twops_2ph(v5, v6); +} + +void +TEST (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + EMULATE(fmaddsub_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmaddsub_ph) (HF(src1), HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmaddsub_ph); + init_dest(&res, &exp); + EMULATE(fmaddsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmaddsub_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmaddsub_ph); + init_dest(&res, &exp); + EMULATE(m_fmaddsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmaddsub_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2)); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmaddsub_ph); + init_dest(&res, &exp); + EMULATE(fmaddsub_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmaddsub_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmaddsub_ph); + + init_dest(&res, &exp); +#if AVX512F_LEN == 512 + EMULATE(fmaddsub_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmaddsub_round_ph) (HF(src1), HF(src2), + HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmaddsub_ph); + init_dest(&res, &exp); + EMULATE(fmaddsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmaddsub_round_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE, _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmaddsub_ph); + init_dest(&res, &exp); + EMULATE(m_fmaddsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmaddsub_round_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmaddsub_ph); + init_dest(&res, &exp); + EMULATE(fmaddsub_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmaddsub_round_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmaddsub_ph); +#endif + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXph-1a.c new file mode 100644 index 0000000..3b1147a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXph-1a.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmsub231ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub231ph\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m512h x1, x2, x3; +volatile __mmask32 m; + +void extern +avx512f_test (void) +{ + x1 = _mm512_fmsub_ph (x1, x2, x3); + x1 = _mm512_mask_fmsub_ph (x1, m, x2, x3); + x3 = _mm512_mask3_fmsub_ph (x1, x2, x3, m); + x1 = _mm512_maskz_fmsub_ph (m, x1, x2, x3); + x1 = _mm512_fmsub_round_ph (x1, x2, x3, _MM_FROUND_TO_NEAREST_INT + | _MM_FROUND_NO_EXC); + x1 = _mm512_mask_fmsub_round_ph (x1, m, x2, x3, _MM_FROUND_TO_NEG_INF + | _MM_FROUND_NO_EXC); + x3 = _mm512_mask3_fmsub_round_ph (x1, x2, x3, m, _MM_FROUND_TO_POS_INF + | _MM_FROUND_NO_EXC); + x1 = _mm512_maskz_fmsub_round_ph (m, x1, x2, x3, _MM_FROUND_TO_ZERO + | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXph-1b.c new file mode 100644 index 0000000..abb9a9b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXph-1b.c @@ -0,0 +1,155 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS (AVX512F_LEN / 16) + +void NOINLINE +EMULATE(fmsub_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = v1.f32[i] * v3.f32[i] - v7.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = v2.f32[i] * v4.f32[i] - v8.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void NOINLINE +EMULATE(m_fmsub_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = v7.f32[i] * v1.f32[i] - v3.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = v8.f32[i] * v2.f32[i] - v4.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void +TEST (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + EMULATE(fmsub_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmsub_ph) (HF(src1), HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmsub_ph); + + init_dest(&res, &exp); + EMULATE(m_fmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmsub_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2)); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmsub_ph); + + init_dest(&res, &exp); + EMULATE(fmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmsub_ph) (HF(src1), HF(src2), HF(res), MASK_VALUE); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmsub_ph); + + init_dest(&res, &exp); + EMULATE(fmsub_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmsub_ph) (ZMASK_VALUE, HF(src1), HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmsub_ph); + +#if AVX512F_LEN == 512 + init_dest(&res, &exp); + EMULATE(fmsub_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmsub_round_ph) (HF(src1), HF(src2), HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmsub_ph); + + init_dest(&res, &exp); + EMULATE(m_fmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmsub_round_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmsub_ph); + + EMULATE(fmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmsub_round_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE, _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmsub_ph); + + init_dest(&res, &exp); + EMULATE(fmsub_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmsub_round_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmsub_ph); +#endif + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXsh-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXsh-1a.c new file mode 100644 index 0000000..335b9e2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXsh-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmsub...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmsub231sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...sh\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...sh\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub231sh\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...sh\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m128h a, b, c; +volatile __mmask8 m; + +void extern +avx512f_test (void) +{ + a = _mm_fmsub_sh (a, b, c); + a = _mm_mask_fmsub_sh (a, m, b, c); + c = _mm_mask3_fmsub_sh (a, b, c, m); + a = _mm_maskz_fmsub_sh (m, a, b, c); + a = _mm_fmsub_round_sh (a, b, c, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + a = _mm_mask_fmsub_round_sh (a, m, b, c, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + c = _mm_mask3_fmsub_round_sh (a, b, c, m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); + a = _mm_maskz_fmsub_round_sh (m, a, b, c, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXsh-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXsh-1b.c new file mode 100644 index 0000000..a2563fa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubXXXsh-1b.c @@ -0,0 +1,89 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS 8 + +void NOINLINE +emulate_fmsub_sh(V512 * dest, V512 op1, V512 op2, + __mmask8 k, int zero_mask, int mask3) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + if ((k&1) || !k) + v5.f32[0] = v1.f32[0] * v3.f32[0] - v7.f32[0]; + else if (zero_mask) + v5.f32[0] = 0; + else + v5.f32[0] = v7.f32[0]; + for (i = 1; i < 8; i++){ + if (mask3) + v5.f32[i] = v7.f32[i]; + else + v5.f32[i] = v1.f32[i]; + } + *dest = pack_twops_2ph(v5, v6); +} + +void +test_512 (void) +{ + V512 res; + V512 exp; + + init_src(); + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fmsub_sh(src1.xmmh[0], + src2.xmmh[0], res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_fmsub_sh"); + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fmsub_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + 0x1); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fmsub_sh"); + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fmsub_sh(src1.xmmh[0], 0x1, src2.xmmh[0], res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fmsub_sh"); + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fmsub_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fmsub_sh"); + + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fmsub_round_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_fmsub_sh"); + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fmsub_round_sh(src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], 0x1, _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fmsub_sh"); + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fmsub_round_sh(src1.xmmh[0], 0x1, src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fmsub_sh"); + init_dest(&res, &exp); + emulate_fmsub_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fmsub_round_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fmsub_sh"); + + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubaddXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubaddXXXph-1a.c new file mode 100644 index 0000000..87087c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubaddXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd231ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd231ph\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m512h x1, x2, x3; +volatile __mmask32 m; + +void extern +avx512f_test (void) +{ + x1 = _mm512_fmsubadd_ph (x1, x2, x3); + x1 = _mm512_mask_fmsubadd_ph (x1, m, x2, x3); + x3 = _mm512_mask3_fmsubadd_ph (x1, x2, x3, m); + x1 = _mm512_maskz_fmsubadd_ph (m, x1, x2, x3); + x1 = _mm512_fmsubadd_round_ph (x1, x2, x3, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + x1 = _mm512_mask_fmsubadd_round_ph (x1, m, x2, x3, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + x3 = _mm512_mask3_fmsubadd_round_ph (x1, x2, x3, m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); + x1 = _mm512_maskz_fmsubadd_round_ph (m, x1, x2, x3, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubaddXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubaddXXXph-1b.c new file mode 100644 index 0000000..159cae4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfmsubaddXXXph-1b.c @@ -0,0 +1,175 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS (AVX512F_LEN / 16) + +void NOINLINE +EMULATE(fmsubadd_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + if (i % 2 == 1) { + v5.f32[i] = v1.f32[i] * v3.f32[i] - v7.f32[i]; + } + else { + v5.f32[i] = v1.f32[i] * v3.f32[i] + v7.f32[i]; + } + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + if (i % 2 == 1) { + v6.f32[i] = v2.f32[i] * v4.f32[i] - v8.f32[i]; + } + else { + v6.f32[i] = v2.f32[i] * v4.f32[i] + v8.f32[i]; + } + } + } + *dest = pack_twops_2ph(v5, v6); +} + +void NOINLINE +EMULATE(m_fmsubadd_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + if (i % 2 == 1) { + v5.f32[i] = v1.f32[i] * v7.f32[i] - v3.f32[i]; + } + else { + v5.f32[i] = v1.f32[i] * v7.f32[i] + v3.f32[i]; + } + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + if (i % 2 == 1) { + v6.f32[i] = v2.f32[i] * v8.f32[i] - v4.f32[i]; + } + else { + v6.f32[i] = v2.f32[i] * v8.f32[i] + v4.f32[i]; + } + } + } + *dest = pack_twops_2ph(v5, v6); +} + +void +TEST (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + EMULATE(fmsubadd_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmsubadd_ph) (HF(src1), HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmsubadd_ph); + init_dest(&res, &exp); + EMULATE(fmsubadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmsubadd_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmsubadd_ph); + init_dest(&res, &exp); + EMULATE(m_fmsubadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmsubadd_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2)); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmsubadd_ph); + init_dest(&res, &exp); + EMULATE(fmsubadd_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmsubadd_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmsubadd_ph); + + init_dest(&res, &exp); +#if AVX512F_LEN == 512 + EMULATE(fmsubadd_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fmsubadd_round_ph) (HF(src1), HF(src2), + HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _fmsubadd_ph); + init_dest(&res, &exp); + EMULATE(fmsubadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fmsubadd_round_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE, + _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fmsubadd_ph); + init_dest(&res, &exp); + EMULATE(m_fmsubadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fmsubadd_round_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2), + _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fmsubadd_ph); + init_dest(&res, &exp); + EMULATE(fmsubadd_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fmsubadd_round_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res), + _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fmsubadd_ph); +#endif + + if (n_errs != 0) { + abort (); + } +} + + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXph-1a.c new file mode 100644 index 0000000..20e77ce --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmadd231ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd231ph\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m512h x1, x2, x3; +volatile __mmask32 m; + +void extern +avx512f_test (void) +{ + x1 = _mm512_fnmadd_ph (x1, x2, x3); + x1 = _mm512_mask_fnmadd_ph (x1, m, x2, x3); + x3 = _mm512_mask3_fnmadd_ph (x1, x2, x3, m); + x1 = _mm512_maskz_fnmadd_ph (m, x1, x2, x3); + x1 = _mm512_fnmadd_round_ph (x1, x2, x3, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + x1 = _mm512_mask_fnmadd_round_ph (x1, m, x2, x3, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + x3 = _mm512_mask3_fnmadd_round_ph (x1, x2, x3, m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); + x1 = _mm512_maskz_fnmadd_round_ph (m, x1, x2, x3, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXph-1b.c new file mode 100644 index 0000000..b15b1bd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXph-1b.c @@ -0,0 +1,159 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS (AVX512F_LEN / 16) + +void NOINLINE +EMULATE(fnmadd_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = -(v1.f32[i] * v3.f32[i]) + v7.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = -(v2.f32[i] * v4.f32[i]) + v8.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void NOINLINE +EMULATE(m_fnmadd_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = -(v1.f32[i] * v7.f32[i]) + v3.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = -(v2.f32[i] * v8.f32[i]) + v4.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void +TEST (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + EMULATE(fnmadd_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fnmadd_ph) (HF(src1), HF(src2), + HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _fnmadd_ph); + + init_dest(&res, &exp); + EMULATE(m_fnmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fnmadd_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2)); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fnmadd_ph); + + init_dest(&res, &exp); + EMULATE(fnmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fnmadd_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fnmadd_ph); + + init_dest(&res, &exp); + EMULATE(fnmadd_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fnmadd_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fnmadd_ph); + +#if AVX512F_LEN == 512 + init_dest(&res, &exp); + EMULATE(fnmadd_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fnmadd_round_ph) (HF(src1), HF(src2), + HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _fnmadd_ph); + + init_dest(&res, &exp); + EMULATE(m_fnmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fnmadd_round_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fnmadd_ph); + + EMULATE(fnmadd_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fnmadd_round_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE, _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fnmadd_ph); + + init_dest(&res, &exp); + EMULATE(fnmadd_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fnmadd_round_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fnmadd_ph); +#endif + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXsh-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXsh-1a.c new file mode 100644 index 0000000..77106aa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXsh-1a.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfnmadd...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmadd231sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...sh\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...sh\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd231sh\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...sh\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m128h a, b, c; +volatile __mmask8 m; + +void extern +avx512f_test (void) +{ + a = _mm_fnmadd_sh (a, b, c); + a = _mm_mask_fnmadd_sh (a, m, b, c); + c = _mm_mask3_fnmadd_sh (a, b, c, m); + a = _mm_maskz_fnmadd_sh (m, a, b, c); + a = _mm_fnmadd_round_sh (a, b, c, _MM_FROUND_TO_NEAREST_INT + | _MM_FROUND_NO_EXC); + a = _mm_mask_fnmadd_round_sh (a, m, b, c, _MM_FROUND_TO_NEG_INF + | _MM_FROUND_NO_EXC); + c = _mm_mask3_fnmadd_round_sh (a, b, c, m, _MM_FROUND_TO_POS_INF + | _MM_FROUND_NO_EXC); + a = _mm_maskz_fnmadd_round_sh (m, a, b, c, _MM_FROUND_TO_ZERO + | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXsh-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXsh-1b.c new file mode 100644 index 0000000..9200150 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmaddXXXsh-1b.c @@ -0,0 +1,90 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS 8 + +void NOINLINE +emulate_fnmadd_sh(V512 * dest, V512 op1, V512 op2, + __mmask8 k, int zero_mask, int mask3) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + if ((k&1) || !k) + v5.f32[0] = -(v1.f32[0] * v3.f32[0]) + v7.f32[0]; + else if (zero_mask) + v5.f32[0] = 0; + else + v5.f32[0] = v7.f32[0]; + + for (i = 1; i < 8; i++){ + if (mask3) + v5.f32[i] = v7.f32[i]; + else + v5.f32[i] = v1.f32[i]; + } + *dest = pack_twops_2ph(v5, v6); +} + +void +test_512 (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fnmadd_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_fnmadd_sh"); + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fnmadd_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + 0x1); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fnmadd_sh"); + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fnmadd_sh(src1.xmmh[0], 0x1, src2.xmmh[0], + res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fnmadd_sh"); + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fnmadd_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fnmadd_sh"); + + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fnmadd_round_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_fnmadd_sh"); + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fnmadd_round_sh(src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], 0x1, _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fnmadd_sh"); + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fnmadd_round_sh(src1.xmmh[0], 0x1, src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fnmadd_sh"); + init_dest(&res, &exp); + emulate_fnmadd_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fnmadd_round_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fnmadd_sh"); + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXph-1a.c new file mode 100644 index 0000000..eb05de4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXph-1a.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmsub231ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub231ph\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m512h x1, x2, x3; +volatile __mmask32 m; + +void extern +avx512f_test (void) +{ + x1 = _mm512_fnmsub_ph (x1, x2, x3); + x1 = _mm512_mask_fnmsub_ph (x1, m, x2, x3); + x3 = _mm512_mask3_fnmsub_ph (x1, x2, x3, m); + x1 = _mm512_maskz_fnmsub_ph (m, x1, x2, x3); + x1 = _mm512_fnmsub_round_ph (x1, x2, x3, _MM_FROUND_TO_NEAREST_INT + | _MM_FROUND_NO_EXC); + x1 = _mm512_mask_fnmsub_round_ph (x1, m, x2, x3, _MM_FROUND_TO_NEG_INF + | _MM_FROUND_NO_EXC); + x3 = _mm512_mask3_fnmsub_round_ph (x1, x2, x3, m, _MM_FROUND_TO_POS_INF + | _MM_FROUND_NO_EXC); + x1 = _mm512_maskz_fnmsub_round_ph (m, x1, x2, x3, _MM_FROUND_TO_ZERO + | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXph-1b.c new file mode 100644 index 0000000..73f0172 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXph-1b.c @@ -0,0 +1,157 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS (AVX512F_LEN / 16) + +void NOINLINE +EMULATE(fnmsub_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = -(v1.f32[i] * v3.f32[i]) - v7.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = -(v2.f32[i] * v4.f32[i]) - v8.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void NOINLINE +EMULATE(m_fnmsub_ph) (V512 * dest, V512 op1, V512 op2, + __mmask32 k, int zero_mask) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + __mmask16 m1, m2; + + m1 = k & 0xffff; + m2 = (k >> 16) & 0xffff; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + for (i = 0; i < 16; i++) { + if (((1 << i) & m1) == 0) { + if (zero_mask) { + v5.f32[i] = 0; + } + else { + v5.u32[i] = v7.u32[i]; + } + } + else { + v5.f32[i] = -(v1.f32[i] * v7.f32[i]) - v3.f32[i]; + } + + if (((1 << i) & m2) == 0) { + if (zero_mask) { + v6.f32[i] = 0; + } + else { + v6.u32[i] = v8.u32[i]; + } + } + else { + v6.f32[i] = -(v2.f32[i] * v8.f32[i]) - v4.f32[i]; + } + + } + *dest = pack_twops_2ph(v5, v6); +} + +void +TEST (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + EMULATE(fnmsub_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fnmsub_ph) (HF(src1), HF(src2), + HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _fnmsub_ph); + + init_dest(&res, &exp); + EMULATE(m_fnmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fnmsub_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2)); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fnmsub_ph); + + init_dest(&res, &exp); + EMULATE(fnmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fnmsub_ph) (HF(src1), HF(src2), HF(res), MASK_VALUE); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fnmsub_ph); + + init_dest(&res, &exp); + EMULATE(fnmsub_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fnmsub_ph) (ZMASK_VALUE, HF(src1), HF(src2), HF(res)); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fnmsub_ph); + +#if AVX512F_LEN == 512 + init_dest(&res, &exp); + EMULATE(fnmsub_ph)(&exp, src1, src2, NET_MASK, 0); + HF(res) = INTRINSIC (_fnmsub_round_ph) (HF(src1), HF(src2), + HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _fnmsub_ph); + + init_dest(&res, &exp); + EMULATE(m_fnmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask_fnmsub_round_ph) (HF(res), MASK_VALUE, + HF(src1), HF(src2), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask_fnmsub_ph); + + EMULATE(fnmsub_ph)(&exp, src1, src2, MASK_VALUE, 0); + HF(res) = INTRINSIC (_mask3_fnmsub_round_ph) (HF(src1), HF(src2), + HF(res), MASK_VALUE, _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _mask3_fnmsub_ph); + + init_dest(&res, &exp); + EMULATE(fnmsub_ph)(&exp, src1, src2, ZMASK_VALUE, 1); + HF(res) = INTRINSIC (_maskz_fnmsub_round_ph) (ZMASK_VALUE, HF(src1), + HF(src2), HF(res), _ROUND_NINT); + CHECK_RESULT (&res, &exp, N_ELEMS, _maskz_fnmsub_ph); +#endif + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXsh-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXsh-1a.c new file mode 100644 index 0000000..5d14608 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXsh-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfnmsub...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmsub231sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...sh\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...sh\[ \\t\]+\[^\n\]*\{rn-sae\}\[^\{\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...sh\[ \\t\]+\[^\n\]*\{rd-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub231sh\[ \\t\]+\[^\n\]*\{ru-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...sh\[ \\t\]+\[^\n\]*\{rz-sae\}\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m128h a, b, c; +volatile __mmask8 m; + +void extern +avx512f_test (void) +{ + a = _mm_fnmsub_sh (a, b, c); + a = _mm_mask_fnmsub_sh (a, m, b, c); + c = _mm_mask3_fnmsub_sh (a, b, c, m); + a = _mm_maskz_fnmsub_sh (m, a, b, c); + a = _mm_fnmsub_round_sh (a, b, c, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + a = _mm_mask_fnmsub_round_sh (a, m, b, c, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC); + c = _mm_mask3_fnmsub_round_sh (a, b, c, m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC); + a = _mm_maskz_fnmsub_round_sh (m, a, b, c, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXsh-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXsh-1b.c new file mode 100644 index 0000000..7bdb861 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-vfnmsubXXXsh-1b.c @@ -0,0 +1,90 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */ + + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +#define N_ELEMS 8 + +void NOINLINE +emulate_fnmsub_sh(V512 * dest, V512 op1, V512 op2, + __mmask8 k, int zero_mask, int mask3) +{ + V512 v1, v2, v3, v4, v5, v6, v7, v8; + int i; + + unpack_ph_2twops(op1, &v1, &v2); + unpack_ph_2twops(op2, &v3, &v4); + unpack_ph_2twops(*dest, &v7, &v8); + + if ((k&1) || !k) + v5.f32[0] = -(v1.f32[0] * v3.f32[0]) - v7.f32[0]; + else if (zero_mask) + v5.f32[0] = 0; + else + v5.f32[0] = v7.f32[0]; + + for (i = 1; i < 8; i++){ + if (mask3) + v5.f32[i] = v7.f32[i]; + else + v5.f32[i] = v1.f32[i]; + } + *dest = pack_twops_2ph(v5, v6); +} + +void +test_512 (void) +{ + V512 res; + V512 exp; + + init_src(); + + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fnmsub_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_fnmsub_sh"); + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fnmsub_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + 0x1); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fnmsub_sh"); + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fnmsub_sh(src1.xmmh[0], 0x1, src2.xmmh[0], + res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fnmsub_sh"); + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fnmsub_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0]); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fnmsub_sh"); + + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_fnmsub_round_sh(src1.xmmh[0], src2.xmmh[0], res.xmmh[0], + _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_fnmsub_sh"); + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x1, 0, 1); + res.xmmh[0] = _mm_mask3_fnmsub_round_sh(src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], 0x1, _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask3_fnmsub_sh"); + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x1, 0, 0); + res.xmmh[0] = _mm_mask_fnmsub_round_sh(src1.xmmh[0], 0x1, src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_mask_fnmsub_sh"); + init_dest(&res, &exp); + emulate_fnmsub_sh(&exp, src1, src2, 0x3, 1, 0); + res.xmmh[0] = _mm_maskz_fnmsub_round_sh(0x3, src1.xmmh[0], src2.xmmh[0], + res.xmmh[0], _ROUND_NINT); + check_results(&res, &exp, N_ELEMS, "_mm_maskz_fnmsub_sh"); + + if (n_errs != 0) { + abort (); + } +} + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-xorsign-1.c b/gcc/testsuite/gcc.target/i386/avx512fp16-xorsign-1.c new file mode 100644 index 0000000..a22a6ce --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-xorsign-1.c @@ -0,0 +1,41 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -ftree-vectorize -fdump-tree-vect-details -save-temps" } */ + +extern void abort (); + +static void do_test (void); + +#define DO_TEST do_test +#define AVX512FP16 +#include "avx512-check.h" + +#define N 16 +_Float16 a[N] = {-0.1f, -3.2f, -6.3f, -9.4f, + -12.5f, -15.6f, -18.7f, -21.8f, + 24.9f, 27.1f, 30.2f, 33.3f, + 36.4f, 39.5f, 42.6f, 45.7f}; +_Float16 b[N] = {-1.2f, 3.4f, -5.6f, 7.8f, + -9.0f, 1.0f, -2.0f, 3.0f, + -4.0f, -5.0f, 6.0f, 7.0f, + -8.0f, -9.0f, 10.0f, 11.0f}; +_Float16 r[N]; + +static void +__attribute__ ((noinline, noclone)) +do_test (void) +{ + int i; + + for (i = 0; i < N; i++) + r[i] = a[i] * __builtin_copysignf16 (1.0f, b[i]); + + /* check results: */ + for (i = 0; i < N; i++) + if (r[i] != a[i] * __builtin_copysignf16 (1.0f, b[i])) + abort (); +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-assembler "\[ \t\]xor" } } */ +/* { dg-final { scan-assembler "\[ \t\]and" } } */ +/* { dg-final { scan-assembler-not "copysign" } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-neg-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-neg-1a.c new file mode 100644 index 0000000..a40a0d8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-neg-1a.c @@ -0,0 +1,18 @@ +/* { dg-do compile} */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl" } */ + +/* { dg-final { scan-assembler-times "vxorps\[ \\t\]+\[^\n\r\]*%xmm0" 1 } } */ +/* { dg-final { scan-assembler-times "vxorps\[ \\t\]+\[^\n\r\]*%ymm0" 1 } } */ +#include<immintrin.h> + +__m128h +neghf128 (__m128h a) +{ + return -a; +} + +__m256h +neghf256 (__m256h a) +{ + return -a; +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-neg-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-neg-1b.c new file mode 100644 index 0000000..d8f65fb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-neg-1b.c @@ -0,0 +1,33 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512FP16 +#include "avx512fp16-helper.h" + +static void +test_512 (void) +{ + V512 v1, v2, v3, v4, exp, res; + int i; + init_src(); + + unpack_ph_2twops(src1, &v1, &v2); + v1.f32[0] = -v1.f32[0]; + exp = pack_twops_2ph(v1, v2); + res.zmmh = src1.zmmh; + res.f16[0] = -res.f16[0]; + check_results(&res, &exp, 32, "neg"); + + unpack_ph_2twops(src1, &v1, &v2); + for (i=0; i<16; i++) + { + v1.f32[i] = -v1.f32[i]; + v2.f32[i] = -v2.f32[i]; + } + exp = pack_twops_2ph(v1, v2); + res.zmmh = -src1.zmmh; + check_results(&res, &exp, 32, "neg"); + if (n_errs != 0) { + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddXXXph-1a.c new file mode 100644 index 0000000..eea38b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512vl -mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmadd231ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd231ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmadd...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m256h yy, y2, y3; +volatile __m128h xx, x2, x3; +volatile __mmask8 m; +volatile __mmask16 m16; + +void extern +avx512vl_test (void) +{ + yy = _mm256_mask_fmadd_ph (yy, m16, y2, y3); + xx = _mm_mask_fmadd_ph (xx, m, x2, x3); + + y3 = _mm256_mask3_fmadd_ph (yy, y2, y3, m16); + x3 = _mm_mask3_fmadd_ph (xx, x2, x3, m); + + yy = _mm256_maskz_fmadd_ph (m16, yy, y2, y3); + xx = _mm_maskz_fmadd_ph (m, xx, x2, x3); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddXXXph-1b.c new file mode 100644 index 0000000..f6e4a9a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddXXXph-1b.c @@ -0,0 +1,15 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512VL +#define AVX512F_LEN 256 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmaddXXXph-1b.c" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + +#define AVX512F_LEN 128 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmaddXXXph-1b.c" + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1a.c new file mode 100644 index 0000000..963fbb6a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512vl -mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub231ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub231ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmaddsub...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m256h yy, y2, y3; +volatile __m128h xx, x2, x3; +volatile __mmask8 m; +volatile __mmask16 m16; + +void extern +avx512vl_test (void) +{ + yy = _mm256_mask_fmaddsub_ph (yy, m16, y2, y3); + xx = _mm_mask_fmaddsub_ph (xx, m, x2, x3); + + y3 = _mm256_mask3_fmaddsub_ph (yy, y2, y3, m16); + x3 = _mm_mask3_fmaddsub_ph (xx, x2, x3, m); + + yy = _mm256_maskz_fmaddsub_ph (m16, yy, y2, y3); + xx = _mm_maskz_fmaddsub_ph (m, xx, x2, x3); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1b.c new file mode 100644 index 0000000..7f9748b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmaddsubXXXph-1b.c @@ -0,0 +1,15 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512VL +#define AVX512F_LEN 256 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmaddsubXXXph-1b.c" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + +#define AVX512F_LEN 128 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmaddsubXXXph-1b.c" + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubXXXph-1a.c new file mode 100644 index 0000000..add1abc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512vl -mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmsub231ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub231ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsub...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m256h yy, y2, y3; +volatile __m128h xx, x2, x3; +volatile __mmask8 m; +volatile __mmask16 m16; + +void extern +avx512vl_test (void) +{ + yy = _mm256_mask_fmsub_ph (yy, m16, y2, y3); + xx = _mm_mask_fmsub_ph (xx, m, x2, x3); + + y3 = _mm256_mask3_fmsub_ph (yy, y2, y3, m16); + x3 = _mm_mask3_fmsub_ph (xx, x2, x3, m); + + yy = _mm256_maskz_fmsub_ph (m16, yy, y2, y3); + xx = _mm_maskz_fmsub_ph (m, xx, x2, x3); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubXXXph-1b.c new file mode 100644 index 0000000..b9c2085 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubXXXph-1b.c @@ -0,0 +1,15 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512VL +#define AVX512F_LEN 256 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmsubXXXph-1b.c" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + +#define AVX512F_LEN 128 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmsubXXXph-1b.c" + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1a.c new file mode 100644 index 0000000..0316b8e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512vl -mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd231ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd231ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfmsubadd...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m256h yy, y2, y3; +volatile __m128h xx, x2, x3; +volatile __mmask8 m; +volatile __mmask16 m16; + +void extern +avx512vl_test (void) +{ + yy = _mm256_mask_fmsubadd_ph (yy, m16, y2, y3); + xx = _mm_mask_fmsubadd_ph (xx, m, x2, x3); + + y3 = _mm256_mask3_fmsubadd_ph (yy, y2, y3, m16); + x3 = _mm_mask3_fmsubadd_ph (xx, x2, x3, m); + + yy = _mm256_maskz_fmsubadd_ph (m16, yy, y2, y3); + xx = _mm_maskz_fmsubadd_ph (m, xx, x2, x3); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1b.c new file mode 100644 index 0000000..c8caca1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfmsubaddXXXph-1b.c @@ -0,0 +1,15 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512VL +#define AVX512F_LEN 256 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmsubaddXXXph-1b.c" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + +#define AVX512F_LEN 128 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfmsubaddXXXph-1b.c" + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1a.c new file mode 100644 index 0000000..6dad901 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512vl -mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmadd231ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd231ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmadd...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m256h yy, y2, y3; +volatile __m128h xx, x2, x3; +volatile __mmask8 m; +volatile __mmask16 m16; + +void extern +avx512vl_test (void) +{ + yy = _mm256_mask_fnmadd_ph (yy, m16, y2, y3); + xx = _mm_mask_fnmadd_ph (xx, m, x2, x3); + + y3 = _mm256_mask3_fnmadd_ph (yy, y2, y3, m16); + x3 = _mm_mask3_fnmadd_ph (xx, x2, x3, m); + + yy = _mm256_maskz_fnmadd_ph (m16, yy, y2, y3); + xx = _mm_maskz_fnmadd_ph (m, xx, x2, x3); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1b.c new file mode 100644 index 0000000..6c615d6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmaddXXXph-1b.c @@ -0,0 +1,15 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512VL +#define AVX512F_LEN 256 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfnmaddXXXph-1b.c" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + +#define AVX512F_LEN 128 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfnmaddXXXph-1b.c" + diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1a.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1a.c new file mode 100644 index 0000000..1a7fd09 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1a.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512vl -mavx512fp16 -O2" } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vfnmsub231ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub231ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vfnmsub...ph\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m256h yy, y2, y3; +volatile __m128h xx, x2, x3; +volatile __mmask8 m; +volatile __mmask16 m16; + +void extern +avx512vl_test (void) +{ + yy = _mm256_mask_fnmsub_ph (yy, m16, y2, y3); + xx = _mm_mask_fnmsub_ph (xx, m, x2, x3); + + y3 = _mm256_mask3_fnmsub_ph (yy, y2, y3, m16); + x3 = _mm_mask3_fnmsub_ph (xx, x2, x3, m); + + yy = _mm256_maskz_fnmsub_ph (m16, yy, y2, y3); + xx = _mm_maskz_fnmsub_ph (m, xx, x2, x3); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1b.c b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1b.c new file mode 100644 index 0000000..6d72b3d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16vl-vfnmsubXXXph-1b.c @@ -0,0 +1,15 @@ +/* { dg-do run { target avx512fp16 } } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ + +#define AVX512VL +#define AVX512F_LEN 256 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfnmsubXXXph-1b.c" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + +#define AVX512F_LEN 128 +#define AVX512F_LEN_HALF 128 +#include "avx512fp16-vfnmsubXXXph-1b.c" + diff --git a/gcc/testsuite/gcc.target/i386/sse-13.c b/gcc/testsuite/gcc.target/i386/sse-13.c index dd33993..e9a838e 100644 --- a/gcc/testsuite/gcc.target/i386/sse-13.c +++ b/gcc/testsuite/gcc.target/i386/sse-13.c @@ -774,6 +774,36 @@ #define __builtin_ia32_vcvtsh2sd_mask_round(A, B, C, D, E) __builtin_ia32_vcvtsh2sd_mask_round(A, B, C, D, 8) #define __builtin_ia32_vcvtss2sh_mask_round(A, B, C, D, E) __builtin_ia32_vcvtss2sh_mask_round(A, B, C, D, 8) #define __builtin_ia32_vcvtsd2sh_mask_round(A, B, C, D, E) __builtin_ia32_vcvtsd2sh_mask_round(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_mask(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_mask(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_mask(A, B, C, D, E) __builtin_ia32_vfmaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfmaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfmaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_mask(A, B, C, D, E) __builtin_ia32_vfnmaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfnmaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfnmaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_mask(A, B, C, D, E) __builtin_ia32_vfmsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfmsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfmsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_mask(A, B, C, D, E) __builtin_ia32_vfnmsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfnmsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfnmsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_mask(A, B, C, D, E) __builtin_ia32_vfmaddsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_mask3(A, B, C, D, E) __builtin_ia32_vfmaddsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_maskz(A, B, C, D, E) __builtin_ia32_vfmaddsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_mask(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_mask3(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_maskz(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_mask(A, B, C, D, E) __builtin_ia32_vfmsubsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_mask3(A, B, C, D, E) __builtin_ia32_vfmsubsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_maskz(A, B, C, D, E) __builtin_ia32_vfmsubsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_mask(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_mask3(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_maskz(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_maskz(A, B, C, D, 8) /* avx512fp16vlintrin.h */ #define __builtin_ia32_cmpph128_mask(A, B, C, D) __builtin_ia32_cmpph128_mask(A, B, 1, D) diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c index e64321d..01ac4e0 100644 --- a/gcc/testsuite/gcc.target/i386/sse-14.c +++ b/gcc/testsuite/gcc.target/i386/sse-14.c @@ -836,6 +836,16 @@ test_3 (_mm_maskz_cvt_roundsh_ss, __m128, __mmask8, __m128, __m128h, 8) test_3 (_mm_maskz_cvt_roundsh_sd, __m128d, __mmask8, __m128d, __m128h, 8) test_3 (_mm_maskz_cvt_roundss_sh, __m128h, __mmask8, __m128h, __m128, 8) test_3 (_mm_maskz_cvt_roundsd_sh, __m128h, __mmask8, __m128h, __m128d, 8) +test_3 (_mm512_fmaddsub_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fmsubadd_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fmadd_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fnmadd_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fmsub_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fnmsub_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm_fmadd_round_sh, __m128h, __m128h, __m128h, __m128h, 9) +test_3 (_mm_fnmadd_round_sh, __m128h, __m128h, __m128h, __m128h, 9) +test_3 (_mm_fmsub_round_sh, __m128h, __m128h, __m128h, __m128h, 9) +test_3 (_mm_fnmsub_round_sh, __m128h, __m128h, __m128h, __m128h, 9) test_3x (_mm512_mask_cmp_round_ph_mask, __mmask32, __mmask32, __m512h, __m512h, 1, 8) test_3x (_mm_mask_cmp_round_sh_mask, __mmask8, __mmask8, __m128h, __m128h, 1, 8) test_3x (_mm512_mask_reduce_round_ph, __m512h, __m512h, __mmask32, __m512h, 123, 8) @@ -868,6 +878,36 @@ test_4 (_mm_mask_cvt_roundsh_ss, __m128, __m128, __mmask8, __m128, __m128h, 8) test_4 (_mm_mask_cvt_roundsh_sd, __m128d, __m128d, __mmask8, __m128d, __m128h, 8) test_4 (_mm_mask_cvt_roundss_sh, __m128h, __m128h, __mmask8, __m128h, __m128, 8) test_4 (_mm_mask_cvt_roundsd_sh, __m128h, __m128h, __mmask8, __m128h, __m128d, 8) +test_4 (_mm512_mask_fmaddsub_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmaddsub_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fmaddsub_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmsubadd_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_mask_fmsubadd_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_maskz_fmsubadd_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fmadd_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmadd_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fmadd_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fnmadd_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fnmadd_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fnmadd_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fmsub_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmsub_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fmsub_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fnmsub_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fnmsub_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fnmsub_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm_mask_fmadd_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fmadd_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fmadd_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) +test_4 (_mm_mask_fnmadd_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fnmadd_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fnmadd_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) +test_4 (_mm_mask_fmsub_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fmsub_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fmsub_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) +test_4 (_mm_mask_fnmsub_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fnmsub_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fnmsub_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) test_4x (_mm_mask_reduce_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 123, 8) test_4x (_mm_mask_roundscale_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 123, 8) test_4x (_mm_mask_getmant_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 1, 1) diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c index d92898f..79e3f35 100644 --- a/gcc/testsuite/gcc.target/i386/sse-22.c +++ b/gcc/testsuite/gcc.target/i386/sse-22.c @@ -939,6 +939,16 @@ test_3 (_mm_maskz_cvt_roundsh_ss, __m128, __mmask8, __m128, __m128h, 8) test_3 (_mm_maskz_cvt_roundsh_sd, __m128d, __mmask8, __m128d, __m128h, 8) test_3 (_mm_maskz_cvt_roundss_sh, __m128h, __mmask8, __m128h, __m128, 8) test_3 (_mm_maskz_cvt_roundsd_sh, __m128h, __mmask8, __m128h, __m128d, 8) +test_3 (_mm512_fmaddsub_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fmsubadd_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fmadd_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fnmadd_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fmsub_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm512_fnmsub_round_ph, __m512h, __m512h, __m512h, __m512h, 9) +test_3 (_mm_fmadd_round_sh, __m128h, __m128h, __m128h, __m128h, 9) +test_3 (_mm_fnmadd_round_sh, __m128h, __m128h, __m128h, __m128h, 9) +test_3 (_mm_fmsub_round_sh, __m128h, __m128h, __m128h, __m128h, 9) +test_3 (_mm_fnmsub_round_sh, __m128h, __m128h, __m128h, __m128h, 9) test_3x (_mm512_mask_cmp_round_ph_mask, __mmask32, __mmask32, __m512h, __m512h, 1, 8) test_3x (_mm_mask_cmp_round_sh_mask, __mmask8, __mmask8, __m128h, __m128h, 1, 8) test_3x (_mm512_mask_reduce_round_ph, __m512h, __m512h, __mmask32, __m512h, 123, 8) @@ -970,6 +980,36 @@ test_4 (_mm_mask_cvt_roundsh_ss, __m128, __m128, __mmask8, __m128, __m128h, 8) test_4 (_mm_mask_cvt_roundsh_sd, __m128d, __m128d, __mmask8, __m128d, __m128h, 8) test_4 (_mm_mask_cvt_roundss_sh, __m128h, __m128h, __mmask8, __m128h, __m128, 8) test_4 (_mm_mask_cvt_roundsd_sh, __m128h, __m128h, __mmask8, __m128h, __m128d, 8) +test_4 (_mm512_mask_fmaddsub_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmaddsub_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fmaddsub_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmsubadd_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_mask_fmsubadd_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_maskz_fmsubadd_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fmadd_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmadd_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fmadd_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fnmadd_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fnmadd_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fnmadd_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fmsub_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fmsub_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fmsub_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm512_mask_fnmsub_round_ph, __m512h, __m512h, __mmask32, __m512h, __m512h, 9) +test_4 (_mm512_mask3_fnmsub_round_ph, __m512h, __m512h, __m512h, __m512h, __mmask32, 9) +test_4 (_mm512_maskz_fnmsub_round_ph, __m512h, __mmask32, __m512h, __m512h, __m512h, 9) +test_4 (_mm_mask_fmadd_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fmadd_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fmadd_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) +test_4 (_mm_mask_fnmadd_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fnmadd_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fnmadd_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) +test_4 (_mm_mask_fmsub_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fmsub_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fmsub_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) +test_4 (_mm_mask_fnmsub_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 9) +test_4 (_mm_mask3_fnmsub_round_sh, __m128h, __m128h, __m128h, __m128h, __mmask8, 9) +test_4 (_mm_maskz_fnmsub_round_sh, __m128h, __mmask8, __m128h, __m128h, __m128h, 9) test_4x (_mm_mask_reduce_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 123, 8) test_4x (_mm_mask_roundscale_round_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 123, 8) test_4x (_mm_mask_getmant_sh, __m128h, __m128h, __mmask8, __m128h, __m128h, 1, 1) diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c index 9c32b7b..4be2c1e 100644 --- a/gcc/testsuite/gcc.target/i386/sse-23.c +++ b/gcc/testsuite/gcc.target/i386/sse-23.c @@ -775,6 +775,36 @@ #define __builtin_ia32_vcvtsh2sd_mask_round(A, B, C, D, E) __builtin_ia32_vcvtsh2sd_mask_round(A, B, C, D, 8) #define __builtin_ia32_vcvtss2sh_mask_round(A, B, C, D, E) __builtin_ia32_vcvtss2sh_mask_round(A, B, C, D, 8) #define __builtin_ia32_vcvtsd2sh_mask_round(A, B, C, D, E) __builtin_ia32_vcvtsd2sh_mask_round(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_mask(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfmaddsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_mask(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfmsubaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_mask(A, B, C, D, E) __builtin_ia32_vfmaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfmaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfmaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_mask(A, B, C, D, E) __builtin_ia32_vfnmaddph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_mask3(A, B, C, D, E) __builtin_ia32_vfnmaddph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddph512_maskz(A, B, C, D, E) __builtin_ia32_vfnmaddph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_mask(A, B, C, D, E) __builtin_ia32_vfmsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfmsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfmsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_mask(A, B, C, D, E) __builtin_ia32_vfnmsubph512_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_mask3(A, B, C, D, E) __builtin_ia32_vfnmsubph512_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubph512_maskz(A, B, C, D, E) __builtin_ia32_vfnmsubph512_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_mask(A, B, C, D, E) __builtin_ia32_vfmaddsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_mask3(A, B, C, D, E) __builtin_ia32_vfmaddsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmaddsh3_maskz(A, B, C, D, E) __builtin_ia32_vfmaddsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_mask(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_mask3(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmaddsh3_maskz(A, B, C, D, E) __builtin_ia32_vfnmaddsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_mask(A, B, C, D, E) __builtin_ia32_vfmsubsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_mask3(A, B, C, D, E) __builtin_ia32_vfmsubsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfmsubsh3_maskz(A, B, C, D, E) __builtin_ia32_vfmsubsh3_maskz(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_mask(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_mask(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_mask3(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_mask3(A, B, C, D, 8) +#define __builtin_ia32_vfnmsubsh3_maskz(A, B, C, D, E) __builtin_ia32_vfnmsubsh3_maskz(A, B, C, D, 8) /* avx512fp16vlintrin.h */ #define __builtin_ia32_cmpph128_mask(A, B, C, D) __builtin_ia32_cmpph128_mask(A, B, 1, D) diff --git a/gcc/testsuite/gfortran.dg/goacc/privatization-1-compute.f90 b/gcc/testsuite/gfortran.dg/goacc/privatization-1-compute.f90 index ed7e9ec..31f998d 100644 --- a/gcc/testsuite/gfortran.dg/goacc/privatization-1-compute.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/privatization-1-compute.f90 @@ -39,9 +39,9 @@ contains !$acc atomic write ! ... to force 'TREE_ADDRESSABLE'. y = a !$acc end parallel - ! { dg-note {variable 'i' in 'private' clause potentially has improper OpenACC privatization level: 'parm_decl'} "TODO" { xfail *-*-* } l_compute$c_compute } - ! { dg-note {variable 'j' in 'private' clause potentially has improper OpenACC privatization level: 'parm_decl'} "TODO" { xfail *-*-* } l_compute$c_compute } - ! { dg-note {variable 'a' in 'private' clause potentially has improper OpenACC privatization level: 'parm_decl'} "TODO" { xfail *-*-* } l_compute$c_compute } + ! { dg-note {variable 'i' in 'private' clause potentially has improper OpenACC privatization level: 'parm_decl'} "TODO2" { xfail *-*-* } l_compute$c_compute } + ! { dg-note {variable 'j' in 'private' clause potentially has improper OpenACC privatization level: 'parm_decl'} "TODO3" { xfail *-*-* } l_compute$c_compute } + ! { dg-note {variable 'a' in 'private' clause potentially has improper OpenACC privatization level: 'parm_decl'} "TODO4" { xfail *-*-* } l_compute$c_compute } ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } l_compute$c_compute } ! { dg-note {variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } end subroutine f diff --git a/gcc/testsuite/gfortran.dg/goacc/routine-external-level-of-parallelism-2.f b/gcc/testsuite/gfortran.dg/goacc/routine-external-level-of-parallelism-2.f index 04d507f..949d571 100644 --- a/gcc/testsuite/gfortran.dg/goacc/routine-external-level-of-parallelism-2.f +++ b/gcc/testsuite/gfortran.dg/goacc/routine-external-level-of-parallelism-2.f @@ -22,8 +22,8 @@ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, n call workerr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } -! { dg-bogus "note: routine 'workerr' declared here" "TODO" { xfail { ! offloading_enabled } } .-1 } -! { dg-bogus "note: routine 'workerr_' declared here" "TODO" { xfail offloading_enabled } .-2 } +! { dg-bogus "note: routine 'workerr' declared here" "TODO1" { xfail { ! offloading_enabled } } .-1 } +! { dg-bogus "note: routine 'workerr_' declared here" "TODO2" { xfail offloading_enabled } .-2 } end do end do !$acc end parallel loop @@ -36,8 +36,8 @@ do j = 1, n call gangr (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } ! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 } -! { dg-bogus "note: routine 'gangr' declared here" "TODO" { xfail { ! offloading_enabled } } .-2 } -! { dg-bogus "note: routine 'gangr_' declared here" "TODO" { xfail offloading_enabled } .-3 } +! { dg-bogus "note: routine 'gangr' declared here" "TODO1" { xfail { ! offloading_enabled } } .-2 } +! { dg-bogus "note: routine 'gangr_' declared here" "TODO2" { xfail offloading_enabled } .-3 } end do end do !$acc end parallel loop @@ -162,8 +162,8 @@ !$acc parallel loop ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } do i = 1, n call vectorr (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" } -! { dg-bogus "note: routine 'vectorr' declared here" "TODO" { xfail { ! offloading_enabled } } .-1 } -! { dg-bogus "note: routine 'vectorr_' declared here" "TODO" { xfail offloading_enabled } .-2 } +! { dg-bogus "note: routine 'vectorr' declared here" "TODO1" { xfail { ! offloading_enabled } } .-1 } +! { dg-bogus "note: routine 'vectorr_' declared here" "TODO2" { xfail offloading_enabled } .-2 } end do !$acc end parallel loop @@ -214,8 +214,8 @@ ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 } do j = 1, n a(i) = workerf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } -! { dg-bogus "note: routine 'workerf' declared here" "TODO" { xfail { ! offloading_enabled } } .-1 } -! { dg-bogus "note: routine 'workerf_' declared here" "TODO" { xfail offloading_enabled } .-2 } +! { dg-bogus "note: routine 'workerf' declared here" "TODO1" { xfail { ! offloading_enabled } } .-1 } +! { dg-bogus "note: routine 'workerf_' declared here" "TODO2" { xfail offloading_enabled } .-2 } end do end do !$acc end parallel loop @@ -228,8 +228,8 @@ do j = 1, n a(i) = gangf (a, n) ! { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } ! { dg-error "routine call uses same OpenACC parallelism as containing loop" "" { target *-*-* } .-1 } -! { dg-bogus "note: routine 'gangf' declared here" "TODO" { xfail { ! offloading_enabled } } .-2 } -! { dg-bogus "note: routine 'gangf_' declared here" "TODO" { xfail offloading_enabled } .-3 } +! { dg-bogus "note: routine 'gangf' declared here" "TODO1" { xfail { ! offloading_enabled } } .-2 } +! { dg-bogus "note: routine 'gangf_' declared here" "TODO2" { xfail offloading_enabled } .-3 } end do end do !$acc end parallel loop @@ -354,8 +354,8 @@ !$acc parallel loop ! { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } do i = 1, n a(i) = vectorf (a, n) ! { dg-message "optimized: assigned OpenACC vector loop parallelism" } -! { dg-bogus "note: routine 'vectorf' declared here" "TODO" { xfail { ! offloading_enabled } } .-1 } -! { dg-bogus "note: routine 'vectorf_' declared here" "TODO" { xfail offloading_enabled } .-2 } +! { dg-bogus "note: routine 'vectorf' declared here" "TODO1" { xfail { ! offloading_enabled } } .-1 } +! { dg-bogus "note: routine 'vectorf_' declared here" "TODO2" { xfail offloading_enabled } .-2 } end do !$acc end parallel loop diff --git a/gcc/testsuite/gfortran.dg/gomp/order-5.f90 b/gcc/testsuite/gfortran.dg/gomp/order-5.f90 new file mode 100644 index 0000000..4d9e336 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/order-5.f90 @@ -0,0 +1,129 @@ +! { dg-additional-options "-fdump-tree-original" } + +subroutine f1 (a) + integer :: a(*), i + !$omp do order(reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp simd order ( reproducible : concurrent ) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp do simd order(reproducible :concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do +end + +subroutine f2 (a) + integer :: a(*), i + !$omp parallel do order(reproducible: concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp parallel do simd order (reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute parallel do order(reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute parallel do simd order(reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute order(reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams + !$omp distribute parallel do order(reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp distribute parallel do simd order(reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp distribute order(reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp end teams + !$omp taskloop simd order (reproducible:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do +end + +subroutine f3 (a) + integer :: a(*), i + !$omp do order(unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp simd order ( unconstrained : concurrent ) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp do simd order(unconstrained :concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do +end + +subroutine f4 (a) + integer :: a(*), i + !$omp parallel do order(unconstrained: concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp parallel do simd order (unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute parallel do order(unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute parallel do simd order(unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute order(unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams + !$omp distribute parallel do order(unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp distribute parallel do simd order(unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp distribute order(unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp end teams + !$omp taskloop simd order (unconstrained:concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do +end + +! { dg-final { scan-tree-dump-times "#pragma omp distribute order\\(concurrent\\)" 6 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp distribute order\\(unconstrained:concurrent\\)" 6 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp for nowait order\\(concurrent\\)" 6 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp for nowait order\\(unconstrained:concurrent\\)" 6 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp for order\\(concurrent\\)" 2 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp for order\\(unconstrained:concurrent\\)" 2 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp parallel" 12 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) order\\(concurrent\\)" 6 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp simd linear\\(i:1\\) order\\(unconstrained:concurrent\\)" 6 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp taskloop" 2 "original"} } +! { dg-final { scan-tree-dump-times "#pragma omp teams" 8 "original"} } diff --git a/gcc/testsuite/gfortran.dg/gomp/order-6.f90 b/gcc/testsuite/gfortran.dg/gomp/order-6.f90 new file mode 100644 index 0000000..c8aeecb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/order-6.f90 @@ -0,0 +1,436 @@ +module m + use iso_c_binding + implicit none (type, external) + interface + subroutine foo() + end subroutine foo + integer function omp_get_thread_num () + end + integer function omp_get_num_threads () + end + integer function omp_target_is_present (x, i) + import :: c_ptr + type(c_ptr) :: x + integer, value :: i + end + integer function omp_get_cancellation () + end + end interface + integer :: v +contains +subroutine f1 (a) + integer, target :: a(*) + integer :: i + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + !$omp parallel ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end parallel + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + block + integer j + !$omp simd + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + !$omp critical ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end critical + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end ordered + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = v + 1 + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = v + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = a(i) + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_target_is_present (c_loc (a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do +end + +subroutine f2 (a) + integer, target :: a(*) + integer :: i + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + !$omp parallel ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end parallel + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + block + integer j + !$omp simd + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + !$omp critical ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end critical + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end ordered + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = v + 1 + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = v + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = a(i) + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_target_is_present (c_loc(a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do simd order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do +end + +subroutine f3 (a) + integer, target :: a(*) + integer :: i + !$omp do order(reproducible:concurrent) + do i = 1, 64 + !$omp parallel + call foo () + !$omp end parallel + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + block + integer j + !$omp simd + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + !$omp critical ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end critical + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end ordered + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = v + 1 + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = v + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = a(i) + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + !$omp task ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = a(i) + 1 + !$omp end task + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + block + integer j + !$omp taskloop ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_target_is_present (c_loc (a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do order(reproducible:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do +end + +subroutine f4 (a) + integer, target :: a(*) + integer :: i + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp parallel ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end parallel + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + block + integer j + !$omp simd + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp critical ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end critical + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end ordered + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = v + 1 + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = v + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = a(i) + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_target_is_present (c_loc (a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do +end + +subroutine f5 (a) + integer, target :: a(*) + integer :: i + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp parallel ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end parallel + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + block + integer j + !$omp simd + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp critical ! { dg-error "OpenMP constructs other than 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' region" } + call foo () + !$omp end critical + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end ordered + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = v + 1 + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = v + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = a(i) + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_target_is_present (c_loc (a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do simd order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do +end + +subroutine f6 (a) + integer, target :: a(*) + integer :: i + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + !$omp parallel + call foo () + !$omp end parallel + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + block + integer j + !$omp simd + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + !$omp critical ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end critical + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + !$omp ordered simd ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + call foo () + !$omp end ordered + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = v + 1 + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic read ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = v + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + !$omp atomic write ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + v = a(i) + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + !$omp task ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + a(i) = a(i) + 1 + !$omp end task + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + block + integer j + !$omp taskloop ! { dg-error "OpenMP constructs other than 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'order\\(concurrent\\)' clause" } + do j = 1, 64 + a(64 * i + j) = i + j + end do + end block + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_target_is_present (c_loc (a(i)), 0) ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do + !$omp do order(unconstrained:concurrent) + do i = 1, 64 + a(i) = a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtime API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order\\(concurrent\\)' clause" } + end do +end +end module m diff --git a/gcc/testsuite/gfortran.dg/gomp/order-7.f90 b/gcc/testsuite/gfortran.dg/gomp/order-7.f90 new file mode 100644 index 0000000..4be8ab3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/order-7.f90 @@ -0,0 +1,59 @@ +subroutine f1 (a) + integer :: a(*) + integer i + !$omp do order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp simd order ( concurrent ) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp do simd order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do +end + +subroutine f2 (a) + integer :: a(*) + integer i + !$omp parallel do order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp parallel do simd order (concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute parallel do order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute parallel do simd order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams distribute order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp teams + !$omp distribute parallel do order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp distribute parallel do simd order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp distribute order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp end teams + !$omp taskloop simd order (concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do +end diff --git a/gcc/testsuite/gfortran.dg/gomp/order-8.f90 b/gcc/testsuite/gfortran.dg/gomp/order-8.f90 new file mode 100644 index 0000000..c753886 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/order-8.f90 @@ -0,0 +1,61 @@ +subroutine f1 (a) + integer :: a(*) + integer i + !$omp do order ! { dg-error "Failed to match clause" } + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp do simd order : ! { dg-error "Failed to match clause" } + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp simd order ( foobar ) ! { dg-error "Expected ORDER\\(CONCURRENT\\) at .1. with optional 'reproducible' or 'unconstrained' modifier" } + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp do simd order( concurrent ! { dg-error "Expected ORDER\\(CONCURRENT\\) at .1. with optional 'reproducible' or 'unconstrained' modifier" } + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp do simd order( concurrent : foo )! { dg-error "Expected ORDER\\(CONCURRENT\\) at .1. with optional 'reproducible' or 'unconstrained' modifier" } + do i = 1, 128 + a(i) = a(i) + 1 + end do +end + +subroutine f2 (a) + integer :: a(*) + integer i + !$omp teams + !$omp distribute order(concurrent) + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp end teams + !$omp taskloop order (concurrent) ! { dg-error "Failed to match clause" } + do i = 1, 128 + a(i) = a(i) + 1 + end do + !$omp do order(concurrent) ordered ! { dg-error "ORDER clause must not be used together ORDERED" } + do i = 1, 128 + !$omp ordered + a(i) = a(i) + 1 + !$omp end ordered + end do + !$omp do ordered order(concurrent) ! { dg-error "ORDER clause must not be used together ORDERED" } + do i = 1, 128 + !$omp ordered + a(i) = a(i) + 1 + !$omp end ordered + end do + !$omp do ordered (1) order(concurrent) ! { dg-error "ORDER clause must not be used together ORDERED" } + do i = 1, 128 + !$omp ordered depend (sink: i - 1) + !$omp ordered depend (source) + end do + !$omp do order(concurrent)ordered (1) ! { dg-error "ORDER clause must not be used together ORDERED" } + do i = 1, 128 + !$omp ordered depend (sink: i - 1) + !$omp ordered depend (source) + end do +end diff --git a/gcc/testsuite/gfortran.dg/gomp/order-9.f90 b/gcc/testsuite/gfortran.dg/gomp/order-9.f90 new file mode 100644 index 0000000..c769511 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/order-9.f90 @@ -0,0 +1,35 @@ +subroutine foo + !$omp do schedule(static) order(concurrent) order(concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do + !$omp do schedule(static) order(reproducible:concurrent) order(unconstrained:concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do + + !$omp loop bind(thread) order(concurrent) order(concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do + !$omp loop bind(thread) order(reproducible:concurrent) order(unconstrained:concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do + !$omp simd order(concurrent) order(concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do + !$omp simd order(reproducible:concurrent) order(unconstrained:concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do + !$omp distribute dist_schedule(static) order(concurrent) order(concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do + !$omp loop bind(thread) order(reproducible:concurrent) order(unconstrained:concurrent) ! { dg-error "Duplicated 'order \\(' clause" } + do i = 1, 8 + call f0 () + end do +end diff --git a/gcc/testsuite/gfortran.dg/include_14.f90 b/gcc/testsuite/gfortran.dg/include_14.f90 new file mode 100644 index 0000000..b306b2c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_14.f90 @@ -0,0 +1,5 @@ +! { dg-additional-options "-cpp -idirafter /fdaf/ -I bar" } +end + +! { dg-warning "/fdaf/: No such file or directory" "" { target *-*-* } 0 } +! { dg-warning "bar: No such file or directory" "" { target *-*-* } 0 } diff --git a/gcc/testsuite/gfortran.dg/include_15.f90 b/gcc/testsuite/gfortran.dg/include_15.f90 new file mode 100644 index 0000000..4944282 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_15.f90 @@ -0,0 +1,5 @@ +! { dg-additional-options "-cpp -idirafter /fdaf/ -I bar -Wmissing-include-dirs" } +end + +! { dg-warning "/fdaf/: No such file or directory" "" { target *-*-* } 0 } +! { dg-warning "bar: No such file or directory" "" { target *-*-* } 0 } diff --git a/gcc/testsuite/gfortran.dg/include_16.f90 b/gcc/testsuite/gfortran.dg/include_16.f90 new file mode 100644 index 0000000..45794f2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_16.f90 @@ -0,0 +1,2 @@ +! { dg-additional-options "-cpp -idirafter /fdaf/ -I bar -Wno-missing-include-dirs" } +end diff --git a/gcc/testsuite/gfortran.dg/include_17.f90 b/gcc/testsuite/gfortran.dg/include_17.f90 new file mode 100644 index 0000000..0ed5c86d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_17.f90 @@ -0,0 +1,4 @@ +! { dg-do compile } +! { dg-options "-I foo-bar -Wno-missing-include-dirs" } +end + diff --git a/gcc/testsuite/gfortran.dg/include_18.f90 b/gcc/testsuite/gfortran.dg/include_18.f90 new file mode 100644 index 0000000..ca69df3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_18.f90 @@ -0,0 +1,3 @@ +! { dg-do compile } +! { dg-options "-I nothere -Wno-missing-include-dirs" } +end diff --git a/gcc/testsuite/gfortran.dg/include_19.f90 b/gcc/testsuite/gfortran.dg/include_19.f90 new file mode 100644 index 0000000..2a06817 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_19.f90 @@ -0,0 +1,4 @@ +! { dg-do compile } +! { dg-options "-J foobar/foo -Wno-missing-include-dirs" } +program main +end program main diff --git a/gcc/testsuite/gfortran.dg/include_20.f90 b/gcc/testsuite/gfortran.dg/include_20.f90 new file mode 100644 index 0000000..4f8fdc6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_20.f90 @@ -0,0 +1,5 @@ +! { dg-do compile } +! { dg-options "-J foobar/foo" } +program main +end program main +! { dg-warning "Nonexistent include directory" "" { target *-*-* } 0 } diff --git a/gcc/testsuite/gfortran.dg/include_21.f90 b/gcc/testsuite/gfortran.dg/include_21.f90 new file mode 100644 index 0000000..40bc598 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/include_21.f90 @@ -0,0 +1,26 @@ +# 1 "../../../trunk/libgfortran/generated/_abs_c4.F90" +# 1 "C:\\msys\\1.0.10\\home\\FX\\ibin\\i586-pc-mingw32\\libgfortran//" +# 1 "<built-in>" +# 1 "<command-line>" +# 1 "../../../trunk/libgfortran/generated/_abs_c4.F90" +! Comment here + +# 1 "./config.h" 1 + +# 37 "../../../trunk/libgfortran/generated/_abs_c4.F90" 2 + +# 1 "./kinds.inc" 1 +# 38 "../../../trunk/libgfortran/generated/_abs_c4.F90" 2 + +# 1 "./c99_protos.inc" 1 +# 39 "../../../trunk/libgfortran/generated/_abs_c4.F90" 2 + +elemental function abs_c4 (parm) + complex (kind=4), intent (in) :: parm + real (kind=4) :: abs_c4 + + abs_c4 = abs (parm) +end function + +! { dg-do compile } +! { dg-options "-fpreprocessed -g3 -Wno-missing-include-dirs" } diff --git a/gcc/testsuite/gfortran.dg/include_6.f90 b/gcc/testsuite/gfortran.dg/include_6.f90 index f5bb085..3e3be1b 100644 --- a/gcc/testsuite/gfortran.dg/include_6.f90 +++ b/gcc/testsuite/gfortran.dg/include_6.f90 @@ -1,6 +1,6 @@ ! { dg-do compile } ! { dg-options "-I gfortran.log" } -! { dg-error "is not a directory" "" { target *-*-* } 0 } +! { dg-warning "Include directory 'gfortran.log/': Not a directory" "" { target *-*-* } 0 } ! { dg-prune-output "compilation terminated." } end diff --git a/gcc/testsuite/gfortran.dg/pr102366.f90 b/gcc/testsuite/gfortran.dg/pr102366.f90 new file mode 100644 index 0000000..d002f64 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr102366.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! { dg-options "-fdump-tree-original -Wall" } +! { dg-final { scan-tree-dump-times "static real" 1 "original" } } +! PR fortran/102366 - large arrays no longer become static + +program p + real(kind=4) :: a(16776325) + a=1.0 +end diff --git a/gcc/testsuite/gnat.dg/asan1.adb b/gcc/testsuite/gnat.dg/asan1.adb index a4bc59a..26bc1a4 100644 --- a/gcc/testsuite/gnat.dg/asan1.adb +++ b/gcc/testsuite/gnat.dg/asan1.adb @@ -1,7 +1,7 @@ -- { dg-do compile } -- { dg-additional-sources asan1_pkg.ads } -- { dg-options "-fsanitize=address" } --- { dg-skip-if "" no_fsanitize_address } +-- { dg-skip-if "no address sanitizer" { no_fsanitize_address } } with Asan1_Pkg; diff --git a/gcc/testsuite/jit.dg/jit.exp b/gcc/testsuite/jit.dg/jit.exp index 4459dbc..10b98bd 100644 --- a/gcc/testsuite/jit.dg/jit.exp +++ b/gcc/testsuite/jit.dg/jit.exp @@ -167,6 +167,9 @@ proc fixed_host_execute {args} { if {![file exists ${executable}]} { perror "The executable, \"$executable\" is missing" 0 return "No source file found" + } elseif {![file executable ${executable}]} { + perror "The executable, \"$executable\" is not usable" 0 + return "Bad executable found" } verbose "params: $params" 2 @@ -194,84 +197,125 @@ proc fixed_host_execute {args} { set args [concat $args ${params}] verbose "args: $args" 2 - eval spawn -noecho $args - - expect_after full_buffer { error "got full_buffer" } + # We checked that the executable exists above, and can be executed, but + # that does not cover other reasons that the launch could fail (e.g. + # missing or malformed params); catch such cases here and report them. + set err [catch "spawn -noecho $args" pid] + set sub_proc_id $spawn_id + if { $pid <= 0 || $err != 0 || $sub_proc_id < 0 } { + warning "failed to spawn : $args : err = $err" + } + + # Increase the buffer size, if needed to avoid spurious buffer-full + # events; GCC uses 10000; chose a power of two here. + set current_max_match [match_max -i $sub_proc_id] + if { $current_max_match < 8192 } { + match_max -i $sub_proc_id 8192 + set used [match_max -i $sub_proc_id] + } + + # If we get a buffer-full error, that seems to be unrecoverable so try to + # exit in a reasonable manner to avoid wedged processes. + expect_after full_buffer { + verbose -log "fixed_host_execute: $args FULL BUFFER" + # FIXME: this all assumes that closing the connection will cause the + # sub-process to terminate (but that is not going to be the case if, + # for example, there is something started with -nohup somewhere). + # We should explicitly kill it here. + # Set the process to be a nowait exit. + wait -nowait -i $sub_proc_id + catch close + perror "${executable} got full_buffer" + return "${executable} got full_buffer" + } set prefix "\[^\r\n\]*" + # Work around a Darwin tcl or termios bug that sometimes inserts extra + # CR characters into the cooked tty stream + set endline "\r\n" + if { [istarget *-*-darwin*] } { + set endline "\r(\r)*\n" + } + + # Note that the logic here assumes that we cannot (validly) get single + # carriage return or line feed characters in the stream. If those occur, + # it will stop any further matching. We arange for the matching to be + # at the start of the buffer - so that if there is any spurious output + # to be discarded, it must be done explicitly - not by matching part-way + # through the buffer. expect { - -re "^$prefix\[0-9\]\[0-9\]:..:..:${text}*\r\n" { + -re "^$prefix\[0-9\]\[0-9\]:..:..:${text}*$endline" { regsub "\[\n\r\t\]*NOTE: $text\r\n" $expect_out(0,string) "" output verbose "$output" 3 set timetol 0 exp_continue } - -re "^$prefix\tNOTE:\[^\r\n\]+\r\n" { - regsub "\[\n\r\t\]*NOTE: $text\r\n" $expect_out(0,string) "" output - set output [string range $output 6 end-2] - verbose "$output" 2 + -re "^\tNOTE: (\[^\r\n\]+)$endline" { + # discard notes. + verbose "Ignored note: $expect_out(1,string)" 2 set timetol 0 exp_continue } - -re "^$prefix\tPASSED:\[^\r\n\]+\r\n" { - regsub "\[\n\r\t\]*PASSED: $text\r\n" $expect_out(0,string) "" output - set output [string range $output 8 end-2] - pass "$output" + -re "^\tPASSED: (\[^\r\n\]+)$endline" { + pass "$expect_out(1,string)" set timetol 0 exp_continue } - -re "^$prefix\tFAILED:\[^\r\n\]+\r\n" { - regsub "\[\n\r\t\]*FAILED: $text\r\n" $expect_out(0,string) "" output - set output [string range $output 8 end-2] - fail "$output" + -re "^\tFAILED: (\[^\r\n\]+)$endline" { + fail "$expect_out(1,string)" set timetol 0 exp_continue } - -re "^$prefix\tUNTESTED:\[^\r\n\]+\r\n" { - regsub "\[\n\r\t\]*TESTED: $text\r\n" $expect_out(0,string) "" output - set output [string range $output 8 end-2] - untested "$output" + -re "^\tUNTESTED: (\[^\r\n\]+)$endline" { + untested "$expect_out(1,string)" set timetol 0 exp_continue } - -re "^$prefix\tUNRESOLVED:\[^\r\n\]+\r\n" { - regsub "\[\n\r\t\]*UNRESOLVED: $text\r\n" $expect_out(0,string) "" output - set output [string range $output 8 end-2] - unresolved "$output" + -re "^\tUNRESOLVED: (\[^\r\n\]+)$endline" { + unresolved "$expect_out(1,string)" set timetol 0 exp_continue } - -re "^Totals" { - verbose "All done" 2 + -re "^$prefix$endline" { + # This matches and discards any other lines (including blank ones). + if { [string length $expect_out(buffer)] <= 2 } { + set output "blank line" + } else { + set output [string range $expect_out(buffer) 0 end-2] + } + verbose -log "DISCARDED $expect_out(spawn_id) : $output" + exp_continue } eof { - # unresolved "${executable} died prematurely" - # catch close - # return "${executable} died prematurely" + # This seems to be the only way that we can reliably know that the + # output is finished since there are cases where further output + # follows the dejagnu test harness totals. + verbose "saw eof" 2 } timeout { - warning "Timed out executing test case" if { $timetol <= 2 } { + verbose -log "Timed out with retry (timeout = $timeout)" incr timetol exp_continue } else { + warning "Timed out executing testcase (timeout = $timeout)" catch close return "Timed out executing test case" } } - -re "^$prefix\r\n" { - exp_continue - } } - # Use "wait" before "close": valgrind might not have finished - # writing the log out before we parse it, so we need to wait for - # the spawnee to finish. - - catch wait wres - verbose "wres: $wres" 2 - verify_exit_status $executable $wres - + # Use "wait" to pick up the sub-process exit state. If the sub-process is + # writing to a file (perhaps under valgrind) then that also needs to be + # complete; only attempt this on a valid spawn. + if { $sub_proc_id > 0 } { + verbose "waiting for $sub_proc_id" 1 + # Be explicit about what we are waiting for. + catch "wait -i $sub_proc_id" wres + verbose "wres: $wres" 2 + verify_exit_status $executable $wres + } + if $run_under_valgrind { upvar 2 name name parse_valgrind_logfile $name $valgrind_logfile diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp index 91f165b..fac212e 100644 --- a/gcc/testsuite/lib/prune.exp +++ b/gcc/testsuite/lib/prune.exp @@ -37,6 +37,9 @@ proc prune_gcc_output { text } { # Handle any freeform regexps. set text [handle-dg-regexps $text] + # Remove Windows .exe suffix + regsub -all "(as|cc1|cc1plus|collect2|f951|ld|lto-wrapper)\.exe?:" $text {\1:} text + regsub -all "(^|\n)(\[^\n\]*: \[iI\]|I)n ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|substitution|program|subroutine|block-data)\[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: (recursively )?required \[^\n\]*" $text "" text diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f11c4e6..9ebca7a 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -11251,14 +11251,15 @@ proc check_effective_target_movdir { } { } "-mmovdiri -mmovdir64b" ] } -# Return 1 if target is not support address sanitize, 1 otherwise. +# Return 1 if the target does not support address sanitizer, 0 otherwise proc check_effective_target_no_fsanitize_address {} { if ![check_no_compiler_messages fsanitize_address executable { int main (void) { return 0; } - }] { + } "-fsanitize=address" ] { return 1; } + return 0; } |