diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-01 06:35:08 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-01 06:35:08 +0000 |
commit | a30fe044170c44da9e441535e2167ca8e885b3cb (patch) | |
tree | 2ebaaed9567b6d2c562b45ef1d92bcb5cb136795 /gcc/testsuite | |
parent | ddda25955ee583217ccbd7ad5c33c6bb9f304649 (diff) | |
download | gcc-a30fe044170c44da9e441535e2167ca8e885b3cb.tar.gz |
2008-09-01 Basile Starynkevitch <basile@starynkevitch.net>
MERGED WITH TRUNK rev139820
* gcc/melt/warmelt-first.bysl: added location argument to inform.
* gcc/warmelt-first-0.c: regenerated.
* gcc/warmelt-macro-0.c: regenerated.
* gcc/warmelt-normal-0.c: regenerated.
* gcc/warmelt-genobj-0.c: regenerated.
* gcc/warmelt-outobj-0.c: regenerated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@139849 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
1107 files changed, 25138 insertions, 1042 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f7386283660..405e0f37084 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,1517 @@ +2008-08-30 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR middle-end/36444 + * g++.dg/torture/pr36444.C: New testcase. + * gcc.c-torture/compile/vector-4.c: New testcase. + +2008-08-30 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/36895 + * gfortran.dg/namelist_53.f90: New test. + +2008-08-29 Michael Meissner <gnu@the-meissners.org> + + * gcc.target/i386/sse-22.c: Change #pragma GCC option to #pragma + GCC target. Change attribute((option(...))) to + attribute((target(...))). + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/funcspec-1.c: Ditto. + * gcc.target/i386/funcspec-2.c: Ditto. + * gcc.target/i386/funcspec-3.c: Ditto. + * gcc.target/i386/funcspec-4.c: Ditto. + * gcc.target/i386/funcspec-5.c: Ditto. + * gcc.target/i386/funcspec-6.c: Ditto. + * gcc.target/i386/funcspec-7.c: Ditto. + * gcc.target/i386/funcspec-8.c: Ditto. + * gcc.target/i386/funcspec-9.c: Ditto. + * gcc.target/i386/funcspec-10.c: Ditto. + * gcc.target/i386/funcspec-11.c: Ditto. + + * gcc.target/i386/cold-1.c: Delete. + * gcc.target/i386/hot-1.c: Ditto. + + * gcc.dg/pr36997.c: Add -msse2 to the target flags. + + * gcc.target/i386/funcspec-8.c: #pragma GCC option push is now + #pragma GCC push_options, and #pragma GCC option pop is now + #pragma GCC pop_options. + * gcc.target/i386/opt-2.c: Ditto. + +2008-08-29 Mark Mitchell <mark@codesourcery.com> + + * g++.dg/abi/mangle-neon.C: Add substitution test. + +2008-08-29 Jakub Jelinek <jakub@redhat.com> + + PR c/37261 + * gcc.dg/pr37261.c: New test. + + PR fortran/23057 + * gfortran.dg/debug/pr35154-dwarf2.f: Adjust for replacement + of DW_TAG_member with DW_TAG_variable. + +2008-08-29 Jan Hubicka <jh@suse.cz> + + * gcc.dg/ipa/modif-1.c: Update template. + +2008-08-29 Jan Hubicka <jh@suse.cz> + + * gcc.dg/ipa/ipa-1.c: Fix template for better debug output. + * gcc.dg/ipa/ipa-2.c: Fix template for better debug output. + * gcc.dg/ipa/ipa-3.c: Fix template for better debug output. + * gcc.dg/ipa/ipa-4.c: Fix template for better debug output. + * gcc.dg/ipa/ipa-5.c: Fix template for better debug output. + * gcc.dg/ipa/ipa-7.c: Fix template for better debug output. + +2008-08-29 Richard Guenther <rguenther@suse.de> + + * gfortran.fortran-torture/compile/20080805-1.f90: New testcase. + +2008-08-29 Richard Guenther <rguenther@suse.de> + + PR middle-end/37236 + * gfortran.fortran-torture/compile/pr37236.f: New testcase. + +2008-08-29 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37207 + * gcc.dg/tree-ssa/vrp46.c: New testcase. + +2008-08-28 Adam Nemet <anemet@caviumnetworks.com> + + * gcc.target/mips/octeon-bbit-1.c: New test. + * gcc.target/mips/octeon-bbit-2.c: New test. + * gcc.target/mips/octeon-bbit-3.c: New test. + +2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + Andrew Pinski <pinskia@gcc.gnu.org> + + PR 18050 + * gcc.dg/Wsequence-point-pr18050.c: New. + * g++.dg/warn/Wsequence-point-pr18050.C: New. + +2008-08-28 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/37260 + * g++.dg/parse/crash44.C: New. + +2008-08-28 Adam Nemet <anemet@caviumnetworks.com> + + * gcc.target/mips/octeon-dmul-1.c: New test. + * gcc.target/mips/octeon-dmul-2.c: New test. + * gcc.target/mips/dmult-1.c: New test. + +2008-08-28 Xuepeng Guo <xuepeng.guo@intel.com> + Joey Ye <joey.ye@intel.com> + H.J. Lu <hongjiu.lu@intel.com> + + * gcc.dg/compat/vector-1b_main.c: New. + * gcc.dg/compat/vector-1b_x.c: Likewise. + * gcc.dg/compat/vector-1b_y.c: Likewise. + * gcc.dg/compat/vector-2b_main.c: Likewise. + * gcc.dg/compat/vector-2b_x.c: Likewise. + * gcc.dg/compat/vector-2b_y.c: Likewise. + * gcc.target/i386/aes-avx-check.h: Likewise. + * gcc.target/i386/avx-1.c: Likewise. + * gcc.target/i386/avx-2.c: Likewise. + * gcc.target/i386/avx-3.c: Likewise. + * gcc.target/i386/avx-check.h: Likewise. + * gcc.target/i386/avx-set1-epi32-1.c: Likewise. + * gcc.target/i386/avx-set1-pd-256-1.c: Likewise. + * gcc.target/i386/avx-set1-ps-256-1.c: Likewise. + * gcc.target/i386/avx-set-v16hi-1.c: Likewise. + * gcc.target/i386/avx-set-v16hi-2.c: Likewise. + * gcc.target/i386/avx-set-v16hi-3.c: Likewise. + * gcc.target/i386/avx-set-v16hi-4.c: Likewise. + * gcc.target/i386/avx-set-v16hi-5.c: Likewise. + * gcc.target/i386/avx-set-v32qi-1.c: Likewise. + * gcc.target/i386/avx-set-v32qi-2.c: Likewise. + * gcc.target/i386/avx-set-v32qi-3.c: Likewise. + * gcc.target/i386/avx-set-v32qi-4.c: Likewise. + * gcc.target/i386/avx-set-v32qi-5.c: Likewise. + * gcc.target/i386/avx-set-v4df-1.c: Likewise. + * gcc.target/i386/avx-set-v4df-2.c: Likewise. + * gcc.target/i386/avx-set-v4df-3.c: Likewise. + * gcc.target/i386/avx-set-v4df-4.c: Likewise. + * gcc.target/i386/avx-set-v4df-5.c: Likewise. + * gcc.target/i386/avx-set-v4di-1.c: Likewise. + * gcc.target/i386/avx-set-v4di-2.c: Likewise. + * gcc.target/i386/avx-set-v4di-3.c: Likewise. + * gcc.target/i386/avx-set-v4di-4.c: Likewise. + * gcc.target/i386/avx-set-v4di-5.c: Likewise. + * gcc.target/i386/avx-set-v8sf-1.c: Likewise. + * gcc.target/i386/avx-set-v8sf-2.c: Likewise. + * gcc.target/i386/avx-set-v8sf-3.c: Likewise. + * gcc.target/i386/avx-set-v8sf-4.c: Likewise. + * gcc.target/i386/avx-set-v8sf-5.c: Likewise. + * gcc.target/i386/avx-set-v8si-1.c: Likewise. + * gcc.target/i386/avx-set-v8si-2.c: Likewise. + * gcc.target/i386/avx-set-v8si-3.c: Likewise. + * gcc.target/i386/avx-set-v8si-4.c: Likewise. + * gcc.target/i386/avx-set-v8si-5.c: Likewise. + * gcc.target/i386/avx-setzero-pd-256-1.c: Likewise. + * gcc.target/i386/avx-setzero-ps-256-1.c: Likewise. + * gcc.target/i386/avx-setzero-si256-1.c: Likewise. + * gcc.target/i386/avx-vaddpd-1.c: Likewise. + * gcc.target/i386/avx-vaddpd-256-1.c: Likewise. + * gcc.target/i386/avx-vaddps-1.c: Likewise. + * gcc.target/i386/avx-vaddps-256-1.c: Likewise. + * gcc.target/i386/avx-vaddsd-1.c: Likewise. + * gcc.target/i386/avx-vaddss-1.c: Likewise. + * gcc.target/i386/avx-vaddsubpd-1.c: Likewise. + * gcc.target/i386/avx-vaddsubpd-256-1.c: Likewise. + * gcc.target/i386/avx-vaddsubps-1.c: Likewise. + * gcc.target/i386/avx-vaddsubps-256-1.c: Likewise. + * gcc.target/i386/avx-vaesdec-1.c: Likewise. + * gcc.target/i386/avx-vaesdeclast-1.c: Likewise. + * gcc.target/i386/avx-vaesenc-1.c: Likewise. + * gcc.target/i386/avx-vaesenclast-1.c: Likewise. + * gcc.target/i386/avx-vaesimc-1.c: Likewise. + * gcc.target/i386/avx-vaeskeygenassist-1.c: Likewise. + * gcc.target/i386/avx-vandnpd-1.c: Likewise. + * gcc.target/i386/avx-vandnpd-256-1.c: Likewise. + * gcc.target/i386/avx-vandnps-1.c: Likewise. + * gcc.target/i386/avx-vandnps-256-1.c: Likewise. + * gcc.target/i386/avx-vandpd-1.c: Likewise. + * gcc.target/i386/avx-vandpd-256-1.c: Likewise. + * gcc.target/i386/avx-vandps-1.c: Likewise. + * gcc.target/i386/avx-vandps-256-1.c: Likewise. + * gcc.target/i386/avx-vblendpd-1.c: Likewise. + * gcc.target/i386/avx-vblendpd-256-1.c: Likewise. + * gcc.target/i386/avx-vblendps-256-1.c: Likewise. + * gcc.target/i386/avx-vblendvpd-256-1.c: Likewise. + * gcc.target/i386/avx-vblendvps-256-1.c: Likewise. + * gcc.target/i386/avx-vbroadcastf128-256-1.c: Likewise. + * gcc.target/i386/avx-vbroadcastf128-256-2.c: Likewise. + * gcc.target/i386/avx-vbroadcastsd-1.c: Likewise. + * gcc.target/i386/avx-vbroadcastss-1.c: Likewise. + * gcc.target/i386/avx-vbroadcastss-2.c: Likewise. + * gcc.target/i386/avx-vcmppd-1.c: Likewise. + * gcc.target/i386/avx-vcmppd-256-1.c: Likewise. + * gcc.target/i386/avx-vcmpps-1.c: Likewise. + * gcc.target/i386/avx-vcmpps-256-1.c: Likewise. + * gcc.target/i386/avx-vcmpsd-1.c: Likewise. + * gcc.target/i386/avx-vcmpss-1.c: Likewise. + * gcc.target/i386/avx-vcomisd-1.c: Likewise. + * gcc.target/i386/avx-vcomisd-2.c: Likewise. + * gcc.target/i386/avx-vcomisd-3.c: Likewise. + * gcc.target/i386/avx-vcomisd-4.c: Likewise. + * gcc.target/i386/avx-vcomisd-5.c: Likewise. + * gcc.target/i386/avx-vcomisd-6.c: Likewise. + * gcc.target/i386/avx-vcomiss-1.c: Likewise. + * gcc.target/i386/avx-vcomiss-2.c: Likewise. + * gcc.target/i386/avx-vcomiss-3.c: Likewise. + * gcc.target/i386/avx-vcomiss-4.c: Likewise. + * gcc.target/i386/avx-vcomiss-5.c: Likewise. + * gcc.target/i386/avx-vcomiss-6.c: Likewise. + * gcc.target/i386/avx-vcvtdq2pd-1.c: Likewise. + * gcc.target/i386/avx-vcvtdq2pd-256-1.c: Likewise. + * gcc.target/i386/avx-vcvtdq2ps-1.c: Likewise. + * gcc.target/i386/avx-vcvtpd2dq-1.c: Likewise. + * gcc.target/i386/avx-vcvtpd2dq-256-1.c: Likewise. + * gcc.target/i386/avx-vcvtpd2ps-1.c: Likewise. + * gcc.target/i386/avx-vcvtpd2ps-256-1.c: Likewise. + * gcc.target/i386/avx-vcvtps2dq-1.c: Likewise. + * gcc.target/i386/avx-vcvtps2dq-256-1.c: Likewise. + * gcc.target/i386/avx-vcvtps2pd-1.c: Likewise. + * gcc.target/i386/avx-vcvtps2pd-256-1.c: Likewise. + * gcc.target/i386/avx-vcvtsd2si-1.c: Likewise. + * gcc.target/i386/avx-vcvtsd2si-2.c: Likewise. + * gcc.target/i386/avx-vcvtsd2ss-1.c: Likewise. + * gcc.target/i386/avx-vcvtsi2sd-1.c: Likewise. + * gcc.target/i386/avx-vcvtsi2sd-2.c: Likewise. + * gcc.target/i386/avx-vcvtsi2ss-1.c: Likewise. + * gcc.target/i386/avx-vcvtsi2ss-2.c: Likewise. + * gcc.target/i386/avx-vcvtss2sd-1.c: Likewise. + * gcc.target/i386/avx-vcvtss2si-1.c: Likewise. + * gcc.target/i386/avx-vcvtss2si-2.c: Likewise. + * gcc.target/i386/avx-vcvttpd2dq-1.c: Likewise. + * gcc.target/i386/avx-vcvttpd2dq-256-1.c: Likewise. + * gcc.target/i386/avx-vcvttps2dq-1.c: Likewise. + * gcc.target/i386/avx-vcvttps2dq-256-1.c: Likewise. + * gcc.target/i386/avx-vcvttsd2si-1.c: Likewise. + * gcc.target/i386/avx-vcvttsd2si-2.c: Likewise. + * gcc.target/i386/avx-vcvttss2si-1.c: Likewise. + * gcc.target/i386/avx-vcvttss2si-2.c: Likewise. + * gcc.target/i386/avx-vdivpd-1.c: Likewise. + * gcc.target/i386/avx-vdivpd-256-1.c: Likewise. + * gcc.target/i386/avx-vdivps-1.c: Likewise. + * gcc.target/i386/avx-vdivps-256-1.c: Likewise. + * gcc.target/i386/avx-vdivsd-1.c: Likewise. + * gcc.target/i386/avx-vdivss-1.c: Likewise. + * gcc.target/i386/avx-vdppd-1.c: Likewise. + * gcc.target/i386/avx-vdppd-2.c: Likewise. + * gcc.target/i386/avx-vdpps-1.c: Likewise. + * gcc.target/i386/avx-vdpps-2.c: Likewise. + * gcc.target/i386/avx-vextractf128-256-1.c: Likewise. + * gcc.target/i386/avx-vextractf128-256-2.c: Likewise. + * gcc.target/i386/avx-vextractps-1.c: Likewise. + * gcc.target/i386/avx-vhaddpd-1.c: Likewise. + * gcc.target/i386/avx-vhaddpd-256-1.c: Likewise. + * gcc.target/i386/avx-vhaddps-1.c: Likewise. + * gcc.target/i386/avx-vhaddps-256-1.c: Likewise. + * gcc.target/i386/avx-vhsubpd-1.c: Likewise. + * gcc.target/i386/avx-vhsubpd-256-1.c: Likewise. + * gcc.target/i386/avx-vhsubps-1.c: Likewise. + * gcc.target/i386/avx-vhsubps-256-1.c: Likewise. + * gcc.target/i386/avx-vinsertf128-256-1.c: Likewise. + * gcc.target/i386/avx-vinsertf128-256-2.c: Likewise. + * gcc.target/i386/avx-vinsertf128-256-3.c: Likewise. + * gcc.target/i386/avx-vinsertps-1.c: Likewise. + * gcc.target/i386/avx-vinsertps-2.c: Likewise. + * gcc.target/i386/avx-vlddqu-1.c: Likewise. + * gcc.target/i386/avx-vlddqu-256-1.c: Likewise. + * gcc.target/i386/avx-vmaskmovpd-256-1.c: Likewise. + * gcc.target/i386/avx-vmaskmovpd-256-2.c: Likewise. + * gcc.target/i386/avx-vmaskmovps-256-1.c: Likewise. + * gcc.target/i386/avx-vmaskmovps-256-2.c: Likewise. + * gcc.target/i386/avx-vmaxpd-1.c: Likewise. + * gcc.target/i386/avx-vmaxpd-256-1.c: Likewise. + * gcc.target/i386/avx-vmaxps-1.c: Likewise. + * gcc.target/i386/avx-vmaxps-256-1.c: Likewise. + * gcc.target/i386/avx-vmaxsd-1.c: Likewise. + * gcc.target/i386/avx-vmaxss-1.c: Likewise. + * gcc.target/i386/avx-vminpd-1.c: Likewise. + * gcc.target/i386/avx-vminpd-256-1.c: Likewise. + * gcc.target/i386/avx-vminps-1.c: Likewise. + * gcc.target/i386/avx-vminps-256-1.c: Likewise. + * gcc.target/i386/avx-vminsd-1.c: Likewise. + * gcc.target/i386/avx-vminss-1.c: Likewise. + * gcc.target/i386/avx-vmovapd-1.c: Likewise. + * gcc.target/i386/avx-vmovapd-256-1.c: Likewise. + * gcc.target/i386/avx-vmovapd-256-2.c: Likewise. + * gcc.target/i386/avx-vmovapd-2.c: Likewise. + * gcc.target/i386/avx-vmovaps-1.c: Likewise. + * gcc.target/i386/avx-vmovaps-256-1.c: Likewise. + * gcc.target/i386/avx-vmovaps-256-2.c: Likewise. + * gcc.target/i386/avx-vmovaps-2.c: Likewise. + * gcc.target/i386/avx-vmovd-1.c: Likewise. + * gcc.target/i386/avx-vmovd-2.c: Likewise. + * gcc.target/i386/avx-vmovddup-1.c: Likewise. + * gcc.target/i386/avx-vmovddup-256-1.c: Likewise. + * gcc.target/i386/avx-vmovdqa-1.c: Likewise. + * gcc.target/i386/avx-vmovdqa-256-1.c: Likewise. + * gcc.target/i386/avx-vmovdqa-256-2.c: Likewise. + * gcc.target/i386/avx-vmovdqa-2.c: Likewise. + * gcc.target/i386/avx-vmovdqu-1.c: Likewise. + * gcc.target/i386/avx-vmovdqu-256-1.c: Likewise. + * gcc.target/i386/avx-vmovdqu-256-2.c: Likewise. + * gcc.target/i386/avx-vmovdqu-2.c: Likewise. + * gcc.target/i386/avx-vmovhlps-1.c: Likewise. + * gcc.target/i386/avx-vmovhpd-1.c: Likewise. + * gcc.target/i386/avx-vmovhpd-2.c: Likewise. + * gcc.target/i386/avx-vmovhps-1.c: Likewise. + * gcc.target/i386/avx-vmovhps-2.c: Likewise. + * gcc.target/i386/avx-vmovlhps-1.c: Likewise. + * gcc.target/i386/avx-vmovlpd-1.c: Likewise. + * gcc.target/i386/avx-vmovlpd-2.c: Likewise. + * gcc.target/i386/avx-vmovmskpd-1.c: Likewise. + * gcc.target/i386/avx-vmovmskpd-256-1.c: Likewise. + * gcc.target/i386/avx-vmovmskps-1.c: Likewise. + * gcc.target/i386/avx-vmovmskps-256-1.c: Likewise. + * gcc.target/i386/avx-vmovntdq-1.c: Likewise. + * gcc.target/i386/avx-vmovntdqa-1.c: Likewise. + * gcc.target/i386/avx-vmovntpd-1.c: Likewise. + * gcc.target/i386/avx-vmovntps-1.c: Likewise. + * gcc.target/i386/avx-vmovq-1.c: Likewise. + * gcc.target/i386/avx-vmovq-2.c: Likewise. + * gcc.target/i386/avx-vmovq-3.c: Likewise. + * gcc.target/i386/avx-vmovsd-1.c: Likewise. + * gcc.target/i386/avx-vmovsd-2.c: Likewise. + * gcc.target/i386/avx-vmovshdup-1.c: Likewise. + * gcc.target/i386/avx-vmovshdup-256-1.c: Likewise. + * gcc.target/i386/avx-vmovsldup-1.c: Likewise. + * gcc.target/i386/avx-vmovsldup-256-1.c: Likewise. + * gcc.target/i386/avx-vmovss-1.c: Likewise. + * gcc.target/i386/avx-vmovss-2.c: Likewise. + * gcc.target/i386/avx-vmovss-3.c: Likewise. + * gcc.target/i386/avx-vmovupd-1.c: Likewise. + * gcc.target/i386/avx-vmovupd-256-1.c: Likewise. + * gcc.target/i386/avx-vmovupd-256-2.c: Likewise. + * gcc.target/i386/avx-vmovupd-2.c: Likewise. + * gcc.target/i386/avx-vmovups-1.c: Likewise. + * gcc.target/i386/avx-vmovups-256-1.c: Likewise. + * gcc.target/i386/avx-vmovups-256-2.c: Likewise. + * gcc.target/i386/avx-vmovups-2.c: Likewise. + * gcc.target/i386/avx-vmpsadbw-1.c: Likewise. + * gcc.target/i386/avx-vmulpd-1.c: Likewise. + * gcc.target/i386/avx-vmulpd-256-1.c: Likewise. + * gcc.target/i386/avx-vmulps-1.c: Likewise. + * gcc.target/i386/avx-vmulps-256-1.c: Likewise. + * gcc.target/i386/avx-vmulsd-1.c: Likewise. + * gcc.target/i386/avx-vmulss-1.c: Likewise. + * gcc.target/i386/avx-vorpd-1.c: Likewise. + * gcc.target/i386/avx-vorpd-256-1.c: Likewise. + * gcc.target/i386/avx-vorps-1.c: Likewise. + * gcc.target/i386/avx-vorps-256-1.c: Likewise. + * gcc.target/i386/avx-vpabsb-1.c: Likewise. + * gcc.target/i386/avx-vpabsd-1.c: Likewise. + * gcc.target/i386/avx-vpabsw-1.c: Likewise. + * gcc.target/i386/avx-vpackssdw-1.c: Likewise. + * gcc.target/i386/avx-vpacksswb-1.c: Likewise. + * gcc.target/i386/avx-vpackusdw-1.c: Likewise. + * gcc.target/i386/avx-vpackuswb-1.c: Likewise. + * gcc.target/i386/avx-vpaddb-1.c: Likewise. + * gcc.target/i386/avx-vpaddd-1.c: Likewise. + * gcc.target/i386/avx-vpaddq-1.c: Likewise. + * gcc.target/i386/avx-vpaddsb-1.c: Likewise. + * gcc.target/i386/avx-vpaddsw-1.c: Likewise. + * gcc.target/i386/avx-vpaddusb-1.c: Likewise. + * gcc.target/i386/avx-vpaddusw-1.c: Likewise. + * gcc.target/i386/avx-vpaddw-1.c: Likewise. + * gcc.target/i386/avx-vpalignr-1.c: Likewise. + * gcc.target/i386/avx-vpand-1.c: Likewise. + * gcc.target/i386/avx-vpandn-1.c: Likewise. + * gcc.target/i386/avx-vpavgb-1.c: Likewise. + * gcc.target/i386/avx-vpavgw-1.c: Likewise. + * gcc.target/i386/avx-vpblendvb-1.c: Likewise. + * gcc.target/i386/avx-vpblendw-1.c: Likewise. + * gcc.target/i386/avx-vpcmpeqb-1.c: Likewise. + * gcc.target/i386/avx-vpcmpeqd-1.c: Likewise. + * gcc.target/i386/avx-vpcmpeqq-1.c: Likewise. + * gcc.target/i386/avx-vpcmpeqw-1.c: Likewise. + * gcc.target/i386/avx-vpcmpestri-1.c: Likewise. + * gcc.target/i386/avx-vpcmpestri-2.c: Likewise. + * gcc.target/i386/avx-vpcmpestrm-1.c: Likewise. + * gcc.target/i386/avx-vpcmpestrm-2.c: Likewise. + * gcc.target/i386/avx-vpcmpgtb-1.c: Likewise. + * gcc.target/i386/avx-vpcmpgtd-1.c: Likewise. + * gcc.target/i386/avx-vpcmpgtq-1.c: Likewise. + * gcc.target/i386/avx-vpcmpgtw-1.c: Likewise. + * gcc.target/i386/avx-vpcmpistri-1.c: Likewise. + * gcc.target/i386/avx-vpcmpistri-2.c: Likewise. + * gcc.target/i386/avx-vpcmpistrm-1.c: Likewise. + * gcc.target/i386/avx-vpcmpistrm-2.c: Likewise. + * gcc.target/i386/avx-vperm2f128-256-1.c: Likewise. + * gcc.target/i386/avx-vperm2f128-256-2.c: Likewise. + * gcc.target/i386/avx-vperm2f128-256-3.c: Likewise. + * gcc.target/i386/avx-vpermil2pd-1.c: Likewise. + * gcc.target/i386/avx-vpermil2pd-256-1.c: Likewise. + * gcc.target/i386/avx-vpermil2ps-1.c: Likewise. + * gcc.target/i386/avx-vpermil2ps-256-1.c: Likewise. + * gcc.target/i386/avx-vpermilpd-1.c: Likewise. + * gcc.target/i386/avx-vpermilpd-256-1.c: Likewise. + * gcc.target/i386/avx-vpermilpd-256-2.c: Likewise. + * gcc.target/i386/avx-vpermilpd-2.c: Likewise. + * gcc.target/i386/avx-vpermilps-1.c: Likewise. + * gcc.target/i386/avx-vpermilps-256-1.c: Likewise. + * gcc.target/i386/avx-vpermilps-256-2.c: Likewise. + * gcc.target/i386/avx-vpermilps-2.c: Likewise. + * gcc.target/i386/avx-vpextrb-1.c: Likewise. + * gcc.target/i386/avx-vpextrd-1.c: Likewise. + * gcc.target/i386/avx-vpextrq-1.c: Likewise. + * gcc.target/i386/avx-vpextrw-1.c: Likewise. + * gcc.target/i386/avx-vphaddd-1.c: Likewise. + * gcc.target/i386/avx-vphaddsw-1.c: Likewise. + * gcc.target/i386/avx-vphaddw-1.c: Likewise. + * gcc.target/i386/avx-vphminposuw-1.c: Likewise. + * gcc.target/i386/avx-vphsubd-1.c: Likewise. + * gcc.target/i386/avx-vphsubsw-1.c: Likewise. + * gcc.target/i386/avx-vphsubw-1.c: Likewise. + * gcc.target/i386/avx-vpinsrb-1.c: Likewise. + * gcc.target/i386/avx-vpinsrd-1.c: Likewise. + * gcc.target/i386/avx-vpinsrq-1.c: Likewise. + * gcc.target/i386/avx-vpmaddubsw-1.c: Likewise. + * gcc.target/i386/avx-vpmaxsb-1.c: Likewise. + * gcc.target/i386/avx-vpmaxsd-1.c: Likewise. + * gcc.target/i386/avx-vpmaxsw-1.c: Likewise. + * gcc.target/i386/avx-vpmaxub-1.c: Likewise. + * gcc.target/i386/avx-vpmaxud-1.c: Likewise. + * gcc.target/i386/avx-vpmaxuw-1.c: Likewise. + * gcc.target/i386/avx-vpminsb-1.c: Likewise. + * gcc.target/i386/avx-vpminsd-1.c: Likewise. + * gcc.target/i386/avx-vpminsw-1.c: Likewise. + * gcc.target/i386/avx-vpminub-1.c: Likewise. + * gcc.target/i386/avx-vpminud-1.c: Likewise. + * gcc.target/i386/avx-vpminuw-1.c: Likewise. + * gcc.target/i386/avx-vpmovmskb-1.c: Likewise. + * gcc.target/i386/avx-vpmovsxbd-1.c: Likewise. + * gcc.target/i386/avx-vpmovsxbq-1.c: Likewise. + * gcc.target/i386/avx-vpmovsxbw-1.c: Likewise. + * gcc.target/i386/avx-vpmovsxdq-1.c: Likewise. + * gcc.target/i386/avx-vpmovsxwd-1.c: Likewise. + * gcc.target/i386/avx-vpmovsxwq-1.c: Likewise. + * gcc.target/i386/avx-vpmovzxbd-1.c: Likewise. + * gcc.target/i386/avx-vpmovzxbq-1.c: Likewise. + * gcc.target/i386/avx-vpmovzxbw-1.c: Likewise. + * gcc.target/i386/avx-vpmovzxdq-1.c: Likewise. + * gcc.target/i386/avx-vpmovzxwd-1.c: Likewise. + * gcc.target/i386/avx-vpmovzxwq-1.c: Likewise. + * gcc.target/i386/avx-vpmuldq-1.c: Likewise. + * gcc.target/i386/avx-vpmulhrsw-1.c: Likewise. + * gcc.target/i386/avx-vpmulhuw-1.c: Likewise. + * gcc.target/i386/avx-vpmulhw-1.c: Likewise. + * gcc.target/i386/avx-vpmulld-1.c: Likewise. + * gcc.target/i386/avx-vpmullw-1.c: Likewise. + * gcc.target/i386/avx-vpmuludq-1.c: Likewise. + * gcc.target/i386/avx-vpor-1.c: Likewise. + * gcc.target/i386/avx-vpsadbw-1.c: Likewise. + * gcc.target/i386/avx-vpshufb-1.c: Likewise. + * gcc.target/i386/avx-vpshufd-1.c: Likewise. + * gcc.target/i386/avx-vpshufhw-1.c: Likewise. + * gcc.target/i386/avx-vpshuflw-1.c: Likewise. + * gcc.target/i386/avx-vpsignb-1.c: Likewise. + * gcc.target/i386/avx-vpsignd-1.c: Likewise. + * gcc.target/i386/avx-vpsignw-1.c: Likewise. + * gcc.target/i386/avx-vpslld-1.c: Likewise. + * gcc.target/i386/avx-vpslld-2.c: Likewise. + * gcc.target/i386/avx-vpslldq-1.c: Likewise. + * gcc.target/i386/avx-vpsllq-1.c: Likewise. + * gcc.target/i386/avx-vpsllq-2.c: Likewise. + * gcc.target/i386/avx-vpsllw-1.c: Likewise. + * gcc.target/i386/avx-vpsllw-2.c: Likewise. + * gcc.target/i386/avx-vpsrad-1.c: Likewise. + * gcc.target/i386/avx-vpsrad-2.c: Likewise. + * gcc.target/i386/avx-vpsraw-1.c: Likewise. + * gcc.target/i386/avx-vpsraw-2.c: Likewise. + * gcc.target/i386/avx-vpsrld-1.c: Likewise. + * gcc.target/i386/avx-vpsrld-2.c: Likewise. + * gcc.target/i386/avx-vpsrldq-1.c: Likewise. + * gcc.target/i386/avx-vpsrlq-1.c: Likewise. + * gcc.target/i386/avx-vpsrlq-2.c: Likewise. + * gcc.target/i386/avx-vpsrlw-1.c: Likewise. + * gcc.target/i386/avx-vpsrlw-2.c: Likewise. + * gcc.target/i386/avx-vpsubb-1.c: Likewise. + * gcc.target/i386/avx-vpsubd-1.c: Likewise. + * gcc.target/i386/avx-vpsubq-1.c: Likewise. + * gcc.target/i386/avx-vpsubsb-1.c: Likewise. + * gcc.target/i386/avx-vpsubsw-1.c: Likewise. + * gcc.target/i386/avx-vpsubw-1.c: Likewise. + * gcc.target/i386/avx-vptest-1.c: Likewise. + * gcc.target/i386/avx-vptest-256-1.c: Likewise. + * gcc.target/i386/avx-vptest-256-2.c: Likewise. + * gcc.target/i386/avx-vptest-256-3.c: Likewise. + * gcc.target/i386/avx-vptest-2.c: Likewise. + * gcc.target/i386/avx-vptest-3.c: Likewise. + * gcc.target/i386/avx-vpunpckhbw-1.c: Likewise. + * gcc.target/i386/avx-vpunpckhdq-1.c: Likewise. + * gcc.target/i386/avx-vpunpckhqdq-1.c: Likewise. + * gcc.target/i386/avx-vpunpckhwd-1.c: Likewise. + * gcc.target/i386/avx-vpunpcklbw-1.c: Likewise. + * gcc.target/i386/avx-vpunpckldq-1.c: Likewise. + * gcc.target/i386/avx-vpunpcklqdq-1.c: Likewise. + * gcc.target/i386/avx-vpunpcklwd-1.c: Likewise. + * gcc.target/i386/avx-vpxor-1.c: Likewise. + * gcc.target/i386/avx-vrcpps-1.c: Likewise. + * gcc.target/i386/avx-vrcpps-256-1.c: Likewise. + * gcc.target/i386/avx-vroundpd-1.c: Likewise. + * gcc.target/i386/avx-vroundpd-256-1.c: Likewise. + * gcc.target/i386/avx-vroundpd-256-2.c: Likewise. + * gcc.target/i386/avx-vroundpd-256-3.c: Likewise. + * gcc.target/i386/avx-vroundpd-2.c: Likewise. + * gcc.target/i386/avx-vroundpd-3.c: Likewise. + * gcc.target/i386/avx-vroundps-256-1.c: Likewise. + * gcc.target/i386/avx-vrsqrtps-1.c: Likewise. + * gcc.target/i386/avx-vrsqrtps-256-1.c: Likewise. + * gcc.target/i386/avx-vshufpd-1.c: Likewise. + * gcc.target/i386/avx-vshufpd-256-1.c: Likewise. + * gcc.target/i386/avx-vshufps-1.c: Likewise. + * gcc.target/i386/avx-vshufps-256-1.c: Likewise. + * gcc.target/i386/avx-vsqrtpd-1.c: Likewise. + * gcc.target/i386/avx-vsqrtpd-256-1.c: Likewise. + * gcc.target/i386/avx-vsqrtps-1.c: Likewise. + * gcc.target/i386/avx-vsqrtps-256-1.c: Likewise. + * gcc.target/i386/avx-vsubpd-1.c: Likewise. + * gcc.target/i386/avx-vsubpd-256-1.c: Likewise. + * gcc.target/i386/avx-vsubps-1.c: Likewise. + * gcc.target/i386/avx-vsubps-256-1.c: Likewise. + * gcc.target/i386/avx-vsubsd-1.c: Likewise. + * gcc.target/i386/avx-vsubss-1.c: Likewise. + * gcc.target/i386/avx-vtestpd-1.c: Likewise. + * gcc.target/i386/avx-vtestpd-256-1.c: Likewise. + * gcc.target/i386/avx-vtestpd-256-2.c: Likewise. + * gcc.target/i386/avx-vtestpd-256-3.c: Likewise. + * gcc.target/i386/avx-vtestpd-2.c: Likewise. + * gcc.target/i386/avx-vtestpd-3.c: Likewise. + * gcc.target/i386/avx-vtestps-1.c: Likewise. + * gcc.target/i386/avx-vtestps-256-1.c: Likewise. + * gcc.target/i386/avx-vtestps-256-2.c: Likewise. + * gcc.target/i386/avx-vtestps-256-3.c: Likewise. + * gcc.target/i386/avx-vtestps-2.c: Likewise. + * gcc.target/i386/avx-vtestps-3.c: Likewise. + * gcc.target/i386/avx-vucomisd-1.c: Likewise. + * gcc.target/i386/avx-vucomisd-2.c: Likewise. + * gcc.target/i386/avx-vucomisd-3.c: Likewise. + * gcc.target/i386/avx-vucomisd-4.c: Likewise. + * gcc.target/i386/avx-vucomisd-5.c: Likewise. + * gcc.target/i386/avx-vucomisd-6.c: Likewise. + * gcc.target/i386/avx-vucomiss-1.c: Likewise. + * gcc.target/i386/avx-vucomiss-2.c: Likewise. + * gcc.target/i386/avx-vucomiss-3.c: Likewise. + * gcc.target/i386/avx-vucomiss-4.c: Likewise. + * gcc.target/i386/avx-vucomiss-5.c: Likewise. + * gcc.target/i386/avx-vucomiss-6.c: Likewise. + * gcc.target/i386/avx-vunpckhpd-1.c: Likewise. + * gcc.target/i386/avx-vunpckhpd-256-1.c: Likewise. + * gcc.target/i386/avx-vunpckhps-1.c: Likewise. + * gcc.target/i386/avx-vunpckhps-256-1.c: Likewise. + * gcc.target/i386/avx-vunpcklpd-1.c: Likewise. + * gcc.target/i386/avx-vunpcklpd-256-1.c: Likewise. + * gcc.target/i386/avx-vunpcklps-1.c: Likewise. + * gcc.target/i386/avx-vunpcklps-256-1.c: Likewise. + * gcc.target/i386/avx-vxorpd-1.c: Likewise. + * gcc.target/i386/avx-vxorpd-256-1.c: Likewise. + * gcc.target/i386/avx-vxorps-1.c: Likewise. + * gcc.target/i386/avx-vxorps-256-1.c: Likewise. + * gcc.target/i386/avx-vzeroall-1.c: Likewise. + * gcc.target/i386/avx-vzeroall-2.c: Likewise. + * gcc.target/i386/avx-vzeroupper-1.c: Likewise. + * gcc.target/i386/avx-vzeroupper-2.c: Likewise. + * gcc.target/i386/m256-1.c: Likewise. + * gcc.target/i386/m256-2.c: Likewise. + * gcc.target/i386/m256-check.h: Likewise. + * gcc.target/i386/sse2-addpd-1.c: Likewise. + * gcc.target/i386/sse2-addsd-1.c: Likewise. + * gcc.target/i386/sse2-andnpd-1.c: Likewise. + * gcc.target/i386/sse2-andpd-1.c: Likewise. + * gcc.target/i386/sse2-comisd-1.c: Likewise. + * gcc.target/i386/sse2-comisd-2.c: Likewise. + * gcc.target/i386/sse2-comisd-3.c: Likewise. + * gcc.target/i386/sse2-comisd-4.c: Likewise. + * gcc.target/i386/sse2-comisd-5.c: Likewise. + * gcc.target/i386/sse2-comisd-6.c: Likewise. + * gcc.target/i386/sse2-cvtdq2pd-1.c: Likewise. + * gcc.target/i386/sse2-cvtdq2ps-1.c: Likewise. + * gcc.target/i386/sse2-cvtpd2dq-1.c: Likewise. + * gcc.target/i386/sse2-cvtpd2ps-1.c: Likewise. + * gcc.target/i386/sse2-cvtps2dq-1.c: Likewise. + * gcc.target/i386/sse2-cvtps2pd-1.c: Likewise. + * gcc.target/i386/sse2-cvtsd2si-1.c: Likewise. + * gcc.target/i386/sse2-cvtsd2si-2.c: Likewise. + * gcc.target/i386/sse2-cvtsd2ss-1.c: Likewise. + * gcc.target/i386/sse2-cvtsi2sd-1.c: Likewise. + * gcc.target/i386/sse2-cvtsi2sd-2.c: Likewise. + * gcc.target/i386/sse2-cvtss2sd-1.c: Likewise. + * gcc.target/i386/sse2-cvttpd2dq-1.c: Likewise. + * gcc.target/i386/sse2-cvttps2dq-1.c: Likewise. + * gcc.target/i386/sse2-cvttsd2si-1.c: Likewise. + * gcc.target/i386/sse2-cvttsd2si-2.c: Likewise. + * gcc.target/i386/sse2-divpd-1.c: Likewise. + * gcc.target/i386/sse2-divsd-1.c: Likewise. + * gcc.target/i386/sse2-maxpd-1.c: Likewise. + * gcc.target/i386/sse2-maxsd-1.c: Likewise. + * gcc.target/i386/sse2-minpd-1.c: Likewise. + * gcc.target/i386/sse2-minsd-1.c: Likewise. + * gcc.target/i386/sse2-movapd-1.c: Likewise. + * gcc.target/i386/sse2-movapd-2.c: Likewise. + * gcc.target/i386/sse2-movd-1.c: Likewise. + * gcc.target/i386/sse2-movd-2.c: Likewise. + * gcc.target/i386/sse2-movdqa-1.c: Likewise. + * gcc.target/i386/sse2-movdqa-2.c: Likewise. + * gcc.target/i386/sse2-movdqu-1.c: Likewise. + * gcc.target/i386/sse2-movdqu-2.c: Likewise. + * gcc.target/i386/sse2-movhpd-1.c: Likewise. + * gcc.target/i386/sse2-movhpd-2.c: Likewise. + * gcc.target/i386/sse2-movlpd-1.c: Likewise. + * gcc.target/i386/sse2-movlpd-2.c: Likewise. + * gcc.target/i386/sse2-movmskpd-1.c: Likewise. + * gcc.target/i386/sse2-movntdq-1.c: Likewise. + * gcc.target/i386/sse2-movntpd-1.c: Likewise. + * gcc.target/i386/sse2-movq-1.c: Likewise. + * gcc.target/i386/sse2-movq-2.c: Likewise. + * gcc.target/i386/sse2-movq-3.c: Likewise. + * gcc.target/i386/sse2-movsd-1.c: Likewise. + * gcc.target/i386/sse2-movsd-2.c: Likewise. + * gcc.target/i386/sse2-movupd-1.c: Likewise. + * gcc.target/i386/sse2-movupd-2.c: Likewise. + * gcc.target/i386/sse2-mulpd-1.c: Likewise. + * gcc.target/i386/sse2-mulsd-1.c: Likewise. + * gcc.target/i386/sse2-orpd-1.c: Likewise. + * gcc.target/i386/sse2-packssdw-1.c: Likewise. + * gcc.target/i386/sse2-packsswb-1.c: Likewise. + * gcc.target/i386/sse2-packuswb-1.c: Likewise. + * gcc.target/i386/sse2-paddb-1.c: Likewise. + * gcc.target/i386/sse2-paddd-1.c: Likewise. + * gcc.target/i386/sse2-paddq-1.c: Likewise. + * gcc.target/i386/sse2-paddsb-1.c: Likewise. + * gcc.target/i386/sse2-paddsw-1.c: Likewise. + * gcc.target/i386/sse2-paddusb-1.c: Likewise. + * gcc.target/i386/sse2-paddusw-1.c: Likewise. + * gcc.target/i386/sse2-paddw-1.c: Likewise. + * gcc.target/i386/sse2-pand-1.c: Likewise. + * gcc.target/i386/sse2-pandn-1.c: Likewise. + * gcc.target/i386/sse2-pavgb-1.c: Likewise. + * gcc.target/i386/sse2-pavgw-1.c: Likewise. + * gcc.target/i386/sse2-pcmpeqb-1.c: Likewise. + * gcc.target/i386/sse2-pcmpeqd-1.c: Likewise. + * gcc.target/i386/sse2-pcmpeqw-1.c: Likewise. + * gcc.target/i386/sse2-pcmpgtb-1.c: Likewise. + * gcc.target/i386/sse2-pcmpgtd-1.c: Likewise. + * gcc.target/i386/sse2-pcmpgtw-1.c: Likewise. + * gcc.target/i386/sse2-pmaddwd-1.c: Likewise. + * gcc.target/i386/sse2-pmaxsw-1.c: Likewise. + * gcc.target/i386/sse2-pmaxub-1.c: Likewise. + * gcc.target/i386/sse2-pminsw-1.c: Likewise. + * gcc.target/i386/sse2-pminub-1.c: Likewise. + * gcc.target/i386/sse2-pmovmskb-1.c: Likewise. + * gcc.target/i386/sse2-pmulhuw-1.c: Likewise. + * gcc.target/i386/sse2-pmulhw-1.c: Likewise. + * gcc.target/i386/sse2-pmullw-1.c: Likewise. + * gcc.target/i386/sse2-pmuludq-1.c: Likewise. + * gcc.target/i386/sse2-por-1.c: Likewise. + * gcc.target/i386/sse2-psadbw-1.c: Likewise. + * gcc.target/i386/sse2-pshufd-1.c: Likewise. + * gcc.target/i386/sse2-pshufhw-1.c: Likewise. + * gcc.target/i386/sse2-pshuflw-1.c: Likewise. + * gcc.target/i386/sse2-pslld-1.c: Likewise. + * gcc.target/i386/sse2-pslld-2.c: Likewise. + * gcc.target/i386/sse2-pslldq-1.c: Likewise. + * gcc.target/i386/sse2-psllq-1.c: Likewise. + * gcc.target/i386/sse2-psllq-2.c: Likewise. + * gcc.target/i386/sse2-psllw-1.c: Likewise. + * gcc.target/i386/sse2-psllw-2.c: Likewise. + * gcc.target/i386/sse2-psrad-1.c: Likewise. + * gcc.target/i386/sse2-psrad-2.c: Likewise. + * gcc.target/i386/sse2-psraw-1.c: Likewise. + * gcc.target/i386/sse2-psraw-2.c: Likewise. + * gcc.target/i386/sse2-psrld-1.c: Likewise. + * gcc.target/i386/sse2-psrld-2.c: Likewise. + * gcc.target/i386/sse2-psrldq-1.c: Likewise. + * gcc.target/i386/sse2-psrlq-1.c: Likewise. + * gcc.target/i386/sse2-psrlq-2.c: Likewise. + * gcc.target/i386/sse2-psrlw-1.c: Likewise. + * gcc.target/i386/sse2-psrlw-2.c: Likewise. + * gcc.target/i386/sse2-psubb-1.c: Likewise. + * gcc.target/i386/sse2-psubd-1.c: Likewise. + * gcc.target/i386/sse2-psubq-1.c: Likewise. + * gcc.target/i386/sse2-psubsb-1.c: Likewise. + * gcc.target/i386/sse2-psubsw-1.c: Likewise. + * gcc.target/i386/sse2-psubw-1.c: Likewise. + * gcc.target/i386/sse2-punpckhbw-1.c: Likewise. + * gcc.target/i386/sse2-punpckhdq-1.c: Likewise. + * gcc.target/i386/sse2-punpckhqdq-1.c: Likewise. + * gcc.target/i386/sse2-punpckhwd-1.c: Likewise. + * gcc.target/i386/sse2-punpcklbw-1.c: Likewise. + * gcc.target/i386/sse2-punpckldq-1.c: Likewise. + * gcc.target/i386/sse2-punpcklqdq-1.c: Likewise. + * gcc.target/i386/sse2-punpcklwd-1.c: Likewise. + * gcc.target/i386/sse2-pxor-1.c: Likewise. + * gcc.target/i386/sse2-shufpd-1.c: Likewise. + * gcc.target/i386/sse2-shufps-1.c: Likewise. + * gcc.target/i386/sse2-sqrtpd-1.c: Likewise. + * gcc.target/i386/sse2-subpd-1.c: Likewise. + * gcc.target/i386/sse2-subsd-1.c: Likewise. + * gcc.target/i386/sse2-ucomisd-1.c: Likewise. + * gcc.target/i386/sse2-ucomisd-2.c: Likewise. + * gcc.target/i386/sse2-ucomisd-3.c: Likewise. + * gcc.target/i386/sse2-ucomisd-4.c: Likewise. + * gcc.target/i386/sse2-ucomisd-5.c: Likewise. + * gcc.target/i386/sse2-ucomisd-6.c: Likewise. + * gcc.target/i386/sse2-unpckhpd-1.c: Likewise. + * gcc.target/i386/sse2-unpcklpd-1.c: Likewise. + * gcc.target/i386/sse2-xorpd-1.c: Likewise. + * gcc.target/i386/sse-addps-1.c: Likewise. + * gcc.target/i386/sse-addss-1.c: Likewise. + * gcc.target/i386/sse-andnps-1.c: Likewise. + * gcc.target/i386/sse-andps-1.c: Likewise. + * gcc.target/i386/sse-comiss-1.c: Likewise. + * gcc.target/i386/sse-comiss-2.c: Likewise. + * gcc.target/i386/sse-comiss-3.c: Likewise. + * gcc.target/i386/sse-comiss-4.c: Likewise. + * gcc.target/i386/sse-comiss-5.c: Likewise. + * gcc.target/i386/sse-comiss-6.c: Likewise. + * gcc.target/i386/sse-cvtsi2ss-1.c: Likewise. + * gcc.target/i386/sse-cvtsi2ss-2.c: Likewise. + * gcc.target/i386/sse-cvtss2si-1.c: Likewise. + * gcc.target/i386/sse-cvtss2si-2.c: Likewise. + * gcc.target/i386/sse-cvttss2si-1.c: Likewise. + * gcc.target/i386/sse-cvttss2si-2.c: Likewise. + * gcc.target/i386/sse-divps-1.c: Likewise. + * gcc.target/i386/sse-divss-1.c: Likewise. + * gcc.target/i386/sse-maxps-1.c: Likewise. + * gcc.target/i386/sse-maxss-1.c: Likewise. + * gcc.target/i386/sse-minps-1.c: Likewise. + * gcc.target/i386/sse-minss-1.c: Likewise. + * gcc.target/i386/sse-movaps-1.c: Likewise. + * gcc.target/i386/sse-movaps-2.c: Likewise. + * gcc.target/i386/sse-movhlps-1.c: Likewise. + * gcc.target/i386/sse-movhps-1.c: Likewise. + * gcc.target/i386/sse-movhps-2.c: Likewise. + * gcc.target/i386/sse-movlhps-1.c: Likewise. + * gcc.target/i386/sse-movmskps-1.c: Likewise. + * gcc.target/i386/sse-movntps-1.c: Likewise. + * gcc.target/i386/sse-movss-1.c: Likewise. + * gcc.target/i386/sse-movss-2.c: Likewise. + * gcc.target/i386/sse-movss-3.c: Likewise. + * gcc.target/i386/sse-movups-1.c: Likewise. + * gcc.target/i386/sse-movups-2.c: Likewise. + * gcc.target/i386/sse-mulps-1.c: Likewise. + * gcc.target/i386/sse-mulss-1.c: Likewise. + * gcc.target/i386/sse-orps-1.c: Likewise. + * gcc.target/i386/sse-rcpps-1.c: Likewise. + * gcc.target/i386/sse-rsqrtps-1.c: Likewise. + * gcc.target/i386/sse-sqrtps-1.c: Likewise. + * gcc.target/i386/sse-subps-1.c: Likewise. + * gcc.target/i386/sse-subss-1.c: Likewise. + * gcc.target/i386/sse-ucomiss-1.c: Likewise. + * gcc.target/i386/sse-ucomiss-2.c: Likewise. + * gcc.target/i386/sse-ucomiss-3.c: Likewise. + * gcc.target/i386/sse-ucomiss-4.c: Likewise. + * gcc.target/i386/sse-ucomiss-5.c: Likewise. + * gcc.target/i386/sse-ucomiss-6.c: Likewise. + * gcc.target/i386/sse-unpckhps-1.c: Likewise. + * gcc.target/i386/sse-unpcklps-1.c: Likewise. + * gcc.target/i386/sse-xorps-1.c: Likewise. + * gcc.target/i386/vararg-10.c: Likewise. + * gcc.target/i386/vararg-3.c: Likewise. + * gcc.target/i386/vararg-4.c: Likewise. + * gcc.target/i386/vararg-5.c: Likewise. + * gcc.target/i386/vararg-6.c: Likewise. + * gcc.target/i386/vararg-7.c: Likewise. + * gcc.target/i386/vararg-8.c: Likewise. + * gcc.target/i386/vararg-9.c: Likewise. + * g++.dg/other/i386-5.C: Likewise. + * g++.dg/other/i386-6.C: Likewise. + + * gcc.target/i386/aesdec.c (CHECK_H): New. + (TEST): New. + Include CHECK_H instead of "XXX-check.h" and run TEST + instead of XXX_test. + * gcc.target/i386/aesdeclast.c: Likewise. + * gcc.target/i386/aesenc.c: Likewise. + * gcc.target/i386/aesenclast.c: Likewise. + * gcc.target/i386/aesimc.c: Likewise. + * gcc.target/i386/aeskeygenassist.c: Likewise. + * gcc.target/i386/sse3-addsubpd.c: Likewise. + * gcc.target/i386/sse3-addsubps.c: Likewise. + * gcc.target/i386/sse3-haddpd.c: Likewise. + * gcc.target/i386/sse3-haddps.c: Likewise. + * gcc.target/i386/sse3-hsubpd.c: Likewise. + * gcc.target/i386/sse3-hsubps.c: Likewise. + * gcc.target/i386/sse3-lddqu.c: Likewise. + * gcc.target/i386/sse3-movddup.c: Likewise. + * gcc.target/i386/sse3-movshdup.c: Likewise. + * gcc.target/i386/sse3-movsldup.c: Likewise. + * gcc.target/i386/sse4_1-blendpd.c: Likewise. + * gcc.target/i386/sse4_1-blendps.c: Likewise. + * gcc.target/i386/sse4_1-dppd-1.c: Likewise. + * gcc.target/i386/sse4_1-dppd-2.c: Likewise. + * gcc.target/i386/sse4_1-dpps-1.c: Likewise. + * gcc.target/i386/sse4_1-dpps-2.c: Likewise. + * gcc.target/i386/sse4_1-extractps.c: Likewise. + * gcc.target/i386/sse4_1-insertps-1.c: Likewise. + * gcc.target/i386/sse4_1-insertps-2.c: Likewise. + * gcc.target/i386/sse4_1-movntdqa.c: Likewise. + * gcc.target/i386/sse4_1-mpsadbw.c: Likewise. + * gcc.target/i386/sse4_1-packusdw.c: Likewise. + * gcc.target/i386/sse4_1-pblendvb.c: Likewise. + * gcc.target/i386/sse4_1-pblendw.c: Likewise. + * gcc.target/i386/sse4_1-pcmpeqq.c: Likewise. + * gcc.target/i386/sse4_1-pextrb.c: Likewise. + * gcc.target/i386/sse4_1-pextrd.c: Likewise. + * gcc.target/i386/sse4_1-pextrq.c: Likewise. + * gcc.target/i386/sse4_1-pextrw.c: Likewise. + * gcc.target/i386/sse4_1-phminposuw.c: Likewise. + * gcc.target/i386/sse4_1-pinsrb.c: Likewise. + * gcc.target/i386/sse4_1-pinsrd.c: Likewise. + * gcc.target/i386/sse4_1-pinsrq.c: Likewise. + * gcc.target/i386/sse4_1-pmaxsb.c: Likewise. + * gcc.target/i386/sse4_1-pmaxsd.c: Likewise. + * gcc.target/i386/sse4_1-pmaxud.c: Likewise. + * gcc.target/i386/sse4_1-pmaxuw.c: Likewise. + * gcc.target/i386/sse4_1-pminsb.c: Likewise. + * gcc.target/i386/sse4_1-pminsd.c: Likewise. + * gcc.target/i386/sse4_1-pminud.c: Likewise. + * gcc.target/i386/sse4_1-pminuw.c: Likewise. + * gcc.target/i386/sse4_1-pmovsxbd.c: Likewise. + * gcc.target/i386/sse4_1-pmovsxbq.c: Likewise. + * gcc.target/i386/sse4_1-pmovsxbw.c: Likewise. + * gcc.target/i386/sse4_1-pmovsxdq.c: Likewise. + * gcc.target/i386/sse4_1-pmovsxwd.c: Likewise. + * gcc.target/i386/sse4_1-pmovsxwq.c: Likewise. + * gcc.target/i386/sse4_1-pmovzxbd.c: Likewise. + * gcc.target/i386/sse4_1-pmovzxbq.c: Likewise. + * gcc.target/i386/sse4_1-pmovzxbw.c: Likewise. + * gcc.target/i386/sse4_1-pmovzxdq.c: Likewise. + * gcc.target/i386/sse4_1-pmovzxwd.c: Likewise. + * gcc.target/i386/sse4_1-pmovzxwq.c: Likewise. + * gcc.target/i386/sse4_1-pmuldq.c: Likewise. + * gcc.target/i386/sse4_1-pmulld.c: Likewise. + * gcc.target/i386/sse4_1-ptest-1.c: Likewise. + * gcc.target/i386/sse4_1-ptest-2.c: Likewise. + * gcc.target/i386/sse4_1-ptest-3.c: Likewise. + * gcc.target/i386/sse4_1-roundpd-1.c: Likewise. + * gcc.target/i386/sse4_1-roundpd-2.c: Likewise. + * gcc.target/i386/sse4_1-roundpd-3.c: Likewise. + * gcc.target/i386/sse4_2-pcmpestri-1.c: Likewise. + * gcc.target/i386/sse4_2-pcmpestri-2.c: Likewise. + * gcc.target/i386/sse4_2-pcmpestrm-1.c: Likewise. + * gcc.target/i386/sse4_2-pcmpestrm-2.c: Likewise. + * gcc.target/i386/sse4_2-pcmpgtq.c: Likewise. + * gcc.target/i386/sse4_2-pcmpistri-1.c: Likewise. + * gcc.target/i386/sse4_2-pcmpistri-2.c: Likewise. + * gcc.target/i386/sse4_2-pcmpistrm-1.c: Likewise. + * gcc.target/i386/sse4_2-pcmpistrm-2.c: Likewise. + * gcc.target/i386/ssse3-pabsb.c: Likewise. Don't run MMX + tests for AVX. + * gcc.target/i386/ssse3-pabsd.c: Likewise. + * gcc.target/i386/ssse3-pabsw.c: Likewise. + * gcc.target/i386/ssse3-palignr.c: Likewise. + * gcc.target/i386/ssse3-phaddd.c: Likewise. + * gcc.target/i386/ssse3-phaddsw.c: Likewise. + * gcc.target/i386/ssse3-phaddw.c: Likewise. + * gcc.target/i386/ssse3-phsubd.c: Likewise. + * gcc.target/i386/ssse3-phsubsw.c: Likewise. + * gcc.target/i386/ssse3-phsubw.c: Likewise. + * gcc.target/i386/ssse3-pmaddubsw.c: Likewise. + * gcc.target/i386/ssse3-pmulhrsw.c: Likewise. + * gcc.target/i386/ssse3-pshufb.c: Likewise. + * gcc.target/i386/ssse3-psignb.c: Likewise. + * gcc.target/i386/ssse3-psignd.c: Likewise. + * gcc.target/i386/ssse3-psignw.c: Likewise. + + * gcc.target/i386/i386.exp (check_effective_target_vaes): New. + + * gcc.target/i386/m128-check.h: Include <xmmintrin.h>. Include + <emmintrin.h> for SSE2. + (union128i_b): Defined only for SSE2. + (union128i_w): Likewise. + (union128i_d): Likewise. + (union128i_q): Likewise. + (union128d): Likewise. + (check_union128i_b): Likewise. + (check_union128i_w): Likewise. + (check_union128i_d): Likewise. + (check_union128i_q): Likewise. + (check_union128d): Likewise. + (union128i_ub): New. + (union128i_uw): Likewise. + (check_union128i_ub): Likewise. + (check_union128i_uw): Likewise. + (ESP_FLOAT): Likewise. + (ESP_DOUBLE): Likewise. + (CHECK_ARRAY): Likewise. + (checkVd): Likewise. + (checkVf): Likewise. + (ieee754_float): Likewise. + (ieee754_double): Likewise. + + * gcc.target/i386/sse-check.h: Include "m128-check.h". + + * gcc.target/x86_64/abi/abi-x86_64.exp: Replace asm-support.s + with asm-support.S. + + * gcc.target/x86_64/abi/asm-support.s: Renamed to ... + * gcc.target/x86_64/abi/asm-support.S: This. Add + ".sse_check none" if __AVX__ is defined. + + * lib/target-supports.exp (check_effective_target_avx): New. + +2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c/30949 + * gcc.dg/pr30949.c: New. + * gcc.dg/transparent-union-1.c: Update. + * gcc.dg/cleanup-1.c: Update. + * gcc.dg/assign-warn-2.c: Update. + * gcc.dg/conv-2.c: Update. + * gcc.dg/Wpointer-sign-pedantic.c: Update. + * gcc.dg/Wpointer-sign-Wall.c: Update. + * gcc.dg/assign-warn-1.c: Update. + * gcc.dg/dfp/composite-type.c: Update. + * gcc.dg/noncompile/20020213-1.c: Update. + +2008-08-28 Daniel Kraft <d@domob.eu> + + * gfortran.dg/typebound_call_1.f03: New test. + * gfortran.dg/typebound_call_2.f03: New test. + * gfortran.dg/typebound_call_3.f03: New test. + * gfortran.dg/typebound_call_4.f03: New test. + * gfortran.dg/typebound_call_5.f03: New test. + * gfortran.dg/typebound_call_6.f03: New test. + * gfortran.dg/typebound_proc_1.f08: Don't expect not-implemented error. + * gfortran.dg/typebound_proc_2.f90: Ditto. + * gfortran.dg/typebound_proc_5.f03: Ditto. + * gfortran.dg/typebound_proc_6.f03: Ditto. + * gfortran.dg/typebound_proc_7.f03: Ditto. + * gfortran.dg/typebound_proc_8.f03: Ditto. + +2008-08-28 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37207 + * gcc.c-torture/compile/pr37207.c: New testcase. + +2008-08-28 Janus Weil <janus@gcc.gnu.org> + + PR fortran/37253 + * gfortran.dg/proc_ptr_10.f90: New. + +2008-08-28 Dodji Seketeli <dodji@redhat.com> + + PR c++/36741 + * g++.dg/other/new-size-type.C: New test. + +2008-08-28 Ira Rosen <irar@il.ibm.com> + + * lib/target-supports.exp (check_effective_target_vect_perm): New. + * gcc.dg/vect/slp-perm-1.c: New testcase. + * gcc.dg/vect/slp-perm-2.c: New testcase. + * gcc.dg/vect/slp-perm-3.c: New testcase. + * gcc.dg/vect/slp-perm-4.c: New testcase. + * gcc.dg/vect/slp-perm-5.c: New testcase. + * gcc.dg/vect/slp-perm-6.c: New testcase. + * gcc.dg/vect/slp-perm-7.c: New testcase. + * gcc.dg/vect/slp-perm-8.c: New testcase. + * gcc.dg/vect/slp-perm-9.c: New testcase. + +2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR 37217 + * gcc.dg/pr37217.c: New. + +2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c/31673 + * gcc.dg/c90-fordecl-1.c: Update. + +2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c/37186 + * gcc.dg/pr37186.c: New. + +2008-08-27 Janis Johnson <janis187@us.ibm.com> + + * gcc.dg/torture/type-generic-1.c: Revert previous change. + * g++.dg/torture/type-generic-1.C: Ditto. + +2008-08-27 Jan Hubicka <jh@suse.cz> + + * gcc.dg/ipa/ipacost-1.c: Remove template matching only x86-64 + * gcc.dg/ipa/ipacost-2.c: Add -fipa-cp-clone; remove template matching + only x86-64 + * gcc.dg/ipa/ipa-1.c: Add -fipa-cp-clone + * gcc.dg/ipa/ipa-2.c: Add -fipa-cp-clone + * gcc.dg/ipa/ipa-3.c: Add -fipa-cp-clone + * gcc.dg/ipa/ipa-4.c: Add -fipa-cp-clone + * gcc.dg/ipa/ipa-5.c: Add -fipa-cp-clone + * gcc.dg/ipa/ipa-7.c: Add -fipa-cp-clone + +2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/35321 + * g++.dg/parse/offsetof8.C: New. + +2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c++/17880 + * g++.dg/warn/sequence-pt-1.C: New. + * g++.dg/warn/sequence-pt-pr17880.C: New. + +2008-08-26 Douglas Gregor <doug.gregor@gmail.com> + + * g++.dg/cpp0x/scoped_enum_examples.C: New. + * g++.dg/cpp0x/scoped_enum.C: New. + * g++.dg/cpp0x/scoped_enum_98.C: New. + * g++.dg/cpp0x/enum_base_warn.C: New. + * g++.dg/cpp0x/enum_base.C: New. + +2008-08-26 Janis Johnson <janis187@us.ibm.com> + + * gcc.target/powerpc/altivec-macros.c: Fix dg-message directives. + * gcc.target/powerpc/ppu-intrinsics.c: Ignore some warnings. + * gcc.target/powerpc/darwin-save-world-1.c: Require AltiVec hardware. + * gcc.target/powerpc/altivec-types-1.c: Expect some notes. + * gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c: Ignore a warning. + * g++.dg/ext/altivec-2.C: Initialize a local variable. + * g++.dg/ext/altivec-3.C: Move AltiVec code out of main. + + * gcc.dg/torture/type-generic-1.c: Don't use IBM 128-bit long double. + * g++.dg/torture/type-generic-1.C: Ditto. + +2008-08-26 Victor Kaplansky <victork@il.ibm.com> + + * gcc.dg/vect/slp-18.c: Require vect_intfloat_cvt. + * gcc.dg/vect/slp-11.c: Likewise. + * gcc.dg/vect/fast-math-pr35982.c: Likewise. + * lib/target-supports.exp: + (check_effective_target_vect_pack_trunc): Add SPU to the list. + (check_effective_target_vect_extract_even_odd): Likewise. + (check_effective_target_vect_extract_even_odd_wide): Likewise. + (check_effective_target_vect_interleave): Likewise. + +2008-08-25 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + Andrew Pinski <andrew_pinski@playstation.sony.com> + + * gcc.target/powerpc/altivec-volatile.c: New test. + +2008-08-25 Daniel Kraft <d@domob.eu> + + * gfortran.dg/extends_7.f03: New test. + * gfortran.dg/typebound_proc_7.f03: New test. + * gfortran.dg/typebound_proc_8.f03: New test. + +2008-08-24 Adam Nemet <anemet@caviumnetworks.com> + + * gcc.target/mips/octeon-pop-1.c: New test. + +2008-08-24 Tobias Burnus <burnus@net-b.de> + + PR fortran/37201 + * gfortran.dg/bind_c_18.f90: New. + +2008-08-24 Jan Hubicka <jh@suse.cz> + + * gcc.dg/ipa/ipacost-1.c: New testcase. + * gcc.dg/ipa/ipacost-2.c: New testcase. + * gcc.dg/ipa/ipa-7.c: Update template. + +2008-08-24 Tobias Burnus <burnus@net-b.de> + + PR fortran/37201 + * gfortran.dg/bind_c_usage_17.f90: New. + * gfortran.dg/bind_c_usage_17_c.c: New. + +2008-08-24 Daniel Kraft <d@domob.eu> + + * gfortran.dg/finalize_5.f03: Adapted expected error message to changes + to handling of CONTAINS in derived-type declarations. + * gfortran.dg/typebound_proc_1.f08: New test. + * gfortran.dg/typebound_proc_2.f90: New test. + * gfortran.dg/typebound_proc_3.f03: New test. + * gfortran.dg/typebound_proc_4.f03: New test. + * gfortran.dg/typebound_proc_5.f03: New test. + * gfortran.dg/typebound_proc_6.f03: New test. + +2008-08-23 Tobias Burnus <burnus@net-b.de> + + PR fortran/37076 + * gfortran.dg/widechar_9.f90: New. + +2008-08-23 Tobias Burnus <burnus@net-b.de> + + PR fortran/37025 + * gfortran.dg/widechar_8.f90: New. + +2008-08-23 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/37174 + * g++.dg/vect/pr37174.cc: New test. + +2008-08-22 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37078 + * gcc.c-torture/compile/pr37078.c: New testcase. + +2008-08-22 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/37143 + * g++.dg/vect/pr37143.C: New testcase. + +2008-08-22 Daniel Kraft <d@domob.eu> + + PR fortran/30239 + * gfortran.dg/duplicate_type_1.f90: New test. + * gfortran.dg/duplicate_type_2.f90: New test. + +2008-08-22 Uros Bizjak <ubizjak@gmail.com> + + * gcc.dg/tree-ssa/pr21658.c (dg-options): Use -fdump-tree-ccp1-details. + (dg-final): Use cleanup-tree-dump "ccp1". + * gcc.dg/tree-prof/ic-misattribution-1a.c: Cleanup tree_profile. + * gcc.dg/ipa/iinline-1.c: Cleanup ipa dump, not tree dump. + * g++.dg/ipa/iinline-1.C: Ditto. + * gfortran.dg/intrinsic_std_1.f90: Cleanup "original" tree dump. + * gfortran.dg/char_eoshift_5.f90: Ditto. + * gfortran.dg/index_2.f90: Ditto. + +2008-08-22 Uros Bizjak <ubizjak@gmail.com> + + PR target/37184 + * gcc.target/i386/pr37184.c: New test. + + PR target/37191 + * gcc.target/i386/pr37191.c: New test. + + PR target/37197 + * gcc.target/i386/pr37197.c: New test. + +2008-08-22 Richard Guenther <rguenther@suse.de> + + PR middle-end/36548 + PR middle-end/37125 + * gcc.c-torture/execute/pr37125.c: New testcase. + +2008-08-22 Daniel Kraft <d@domob.eu> + + * gfortran.dg/used_before_typed_4.f90: New test. + +2008-08-22 Daniel Kraft <d@domob.eu> + + PR fortran/32095 + PR fortran/34228 + * gfortran.dg/used_before_typed_1.f90: New test. + * gfortran.dg/used_before_typed_2.f90: New test. + * gfortran.dg/used_before_typed_3.f90: New test. + * gfortran.dg/array_constructor_26.f03: Add -std=gnu to not enable + legacy-behaviour for the new check. + * gfortran.dg/array_constructor_27.f03: Ditto. + * gfortran.dg/blockdata_4.f90: Ditto. + * gfortran.dg/bound_2.f90: Reordered declarations to satisfy the check. + * gfortran.dg/result_in_spec_1.f90: Ditto. + * gfortran.dg/argument_checking_7.f90: Adapted expected error messages. + +2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR 30457 + * gcc.dg/pr30457.c: New. + +2008-08-21 Aldy Hernandez <aldyh@redhat.com> + + * gcc.dg/20011008-1.c: Test column. + * gcc.dg/20080820.c: New. + * gcc.dg/fltconst-1.c: Test column. + * gcc.dg/cpp/cpp.exp: Add -fno-show-column. + * gcc.dg/cpp/trad/trad.exp: Same. + * lib/gcc.exp (gcc_target_compile): Remove -fno-show-column. + * lib/gcc-dg.exp (process-message): Handle columns. + +2008-08-21 Joseph Myers <joseph@codesourcery.com> + + * g++.dg/opt/anchor1.C (foo): Return the return value of + ycf->ascent. + +2008-08-21 Richard Guenther <rguenther@suse.de> + + * gcc.dg/vect/vect-fold-1.c: Scan ccp1 dump instead of dom1. + +2008-08-21 Richard Guenther <rguenther@suse.de> + + PR middle-end/36817 + * gcc.c-torture/compile/pr36817.c: New testcase. + +2008-08-21 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/ssa-fre-13.c: Remove XFAIL. + * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise. + * gcc.dg/tree-ssa/ssa-fre-17.c: Likewise. + * gcc.dg/tree-ssa/data-dep-1.c: Likewise. + * gcc.dg/tree-ssa/ltrans-3.c: Likewise. + +2008-08-21 Richard Guenther <rguenther@suse.de> + + PR testsuite/37182 + * gcc.dg/pr17506.c: Remove duplicate testcase. + * gcc.dg/uninit-15.c: Adjust to allow for both correct + behaviors, one xfailed. + +2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR middle-end/179 + * gcc.dg/uninit-6.c (make_something): Remove XFAIL. + * gcc.dg/uninit-6-O0.c (make_something): Remove XFAIL. + * gcc.dg/uninit-B.c (baz): Remove XFAIL. + * gcc.dg/uninit-B-2.c: New. + * gcc.dg/uninit-B-O0-2.c: New. + * gcc.dg/uninit-pr19430-O0.c: New. + * gcc.dg/uninit-pr19430.c: New. + * gcc.dg/uninit-pr19430-2.c: New. + +2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c++/35158 + * g++.dg/gomp/pr35158.C: New. + +2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR 35701 + * gcc.dg/pr35701.c: New. + * gcc.dg/Wconversion-real-integer.c: Add more tests. + * gcc.dg/Wconversion-pr34389.c: Update. + * g++.dg/warn/Wconversion-pr34389.C: Update. + +2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c++/35602 + * g++.dg/warn/pr35602.C: New. + +2008-08-20 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/pr21829.c: Scan optimized and cddce2 dumps + instead of phicprop2. Make sure all is fine after cddce2, + add an XFAILed scan for merging the two remaining ifs. + +2008-08-20 Richard Guenther <rguenther@suse.de> + + * gcc.c-torture/compile/20080820-1.c: New testcase. + +2008-08-20 Jakub Jelinek <jakub@redhat.com> + + PR c/37171 + * gcc.dg/pr37171.c: New test. + +2008-08-20 Arnaud Charlet <charlet@adacore.com> + + * gnat.dg/div_no_warning.adb: New test. + +2008-08-20 H.J. Lu <hongjiu.lu@intel.com> + + PR target/37169 + * i386/sse2-init-v2di-2.c: New. + +2008-08-20 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/forwprop-9.c: Scan FRE dump as well. + * gcc.dg/tree-ssa/forwprop-10.c: New testcase. + +2008-08-20 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/20030530-2.c: Scan dom2 dump. + * gcc.dg/tree-ssa/20030611-1.c: Likewise. + * gcc.dg/tree-ssa/20030703-1.c: Likewise. + * gcc.dg/tree-ssa/20030703-2.c: Likewise. + * gcc.dg/tree-ssa/20030708-1.c: Likewise. + * gcc.dg/tree-ssa/20030709-3.c: Likewise. + * gcc.dg/tree-ssa/20030710-1.c: Likewise. + * gcc.dg/tree-ssa/20030711-1.c: Likewise. + * gcc.dg/tree-ssa/20030711-2.c: Likewise. + * gcc.dg/tree-ssa/20030711-3.c: Likewise. + * gcc.dg/tree-ssa/20030714-1.c: Likewise. + * gcc.dg/tree-ssa/20030714-2.c: Likewise. + * gcc.dg/tree-ssa/20030729-1.c: Likewise. + * gcc.dg/tree-ssa/20030730-1.c: Likewise. + * gcc.dg/tree-ssa/20030730-2.c: Likewise. + * gcc.dg/tree-ssa/20030731-1.c: Likewise. + * gcc.dg/tree-ssa/20030807-1.c: Likewise. + * gcc.dg/tree-ssa/20030807-11.c: Likewise. + * gcc.dg/tree-ssa/20030807-2.c: Likewise. + * gcc.dg/tree-ssa/20030807-3.c: Likewise. + * gcc.dg/tree-ssa/20030807-5.c: Likewise. + * gcc.dg/tree-ssa/20030807-8.c: Likewise. + * gcc.dg/tree-ssa/20030807-9.c: Likewise. + * gcc.dg/tree-ssa/20030814-1.c: Likewise. + * gcc.dg/tree-ssa/20030814-2.c: Likewise. + * gcc.dg/tree-ssa/20030814-3.c: Likewise. + * gcc.dg/tree-ssa/20030814-4.c: Likewise. + * gcc.dg/tree-ssa/20030814-5.c: Likewise. + * gcc.dg/tree-ssa/20030814-6.c: Likewise. + * gcc.dg/tree-ssa/20030814-7.c: Likewise. + * gcc.dg/tree-ssa/20030922-1.c: Likewise. + * gcc.dg/tree-ssa/20040729-1.c: Likewise. + * gcc.dg/tree-ssa/20041122-1.c: Likewise. + * gcc.dg/tree-ssa/pr21417.c: Likewise. + * gcc.dg/tree-ssa/pr21829.c: Scan phicprop2 dump. + * gcc.dg/tree-ssa/ssa-dce-1.c: Scan dce2 dump. + * gcc.dg/tree-ssa/ssa-dce-2.c: Likewise. + * g++.dg/tree-ssa/pr31146.C: Remove XFAIL, adjust pattern. + * gfortran.dg/ldist-1.f90: Adjust. + +2008-08-20 Victor Kaplansky <victork@il.ibm.com> + + * gcc.dg/vect/vect-multitypes-15.c: Fix typo. + * gcc/testsuite/lib/target-supports.exp + (check_effective_target_vect_long_long): Remove spu-*-*. + * gcc.dg/vect/vect-multitypes-16.c: Make init loop unvectorizable. + * gcc.dg/vect/slp-widen-mult-u8.c: Likewise. + +2008-08-20 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/pr20701.c: Scan vrp1 dump. + * gcc.dg/tree-ssa/ssa-dom-thread-1.c: Pass -fno-tree-vrp. + * gcc.dg/tree-ssa/ssa-pre-20.c: New testcase. + +2008-08-19 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + * gcc.dg/torture/fp-int-convert-float.c: Reenable test on SPU. + * gcc.dg/torture/fp-int-convert-timode.c: Reenable "float" test on SPU. + +2008-08-19 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/ssa-ccp-14.c: XFAIL. + +2008-08-19 H.J. Lu <hongjiu.lu@intel.com> + + PR target/37157 + * gcc.target/i386/sse2-unpack-1.c: New. + +2008-08-19 Jakub Jelinek <jakub@redhat.com> + + PR debug/37156 + * gcc.dg/pr37156.c: New test. + +2008-08-19 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/35972 + PR tree-optimization/23094 + * gcc.dg/tree-ssa/ssa-pre-19.c: New testcase. + * gcc.dg/autopar/reduc-1.c: Move constant initialized arrays to + global memory. + * gcc.dg/autopar/reduc-1char.c: Likewise. + * gcc.dg/autopar/reduc-1short.c: Likewise. + * gcc.dg/autopar/reduc-2.c: Likewise. + * gcc.dg/autopar/reduc-2char.c: Likewise. + * gcc.dg/autopar/reduc-2short.c: Likewise. + * gcc.dg/autopar/reduc-3.c: Likewise. + * gcc.dg/tree-ssa/ifc-20040816-1.c: Likewise. + * gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c: Likewise. + * gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c: Likewise. + * gcc.dg/vect/fast-math-vect-reduc-5.c: Likewise. + * gcc.dg/vect/fast-math-vect-reduc-7.c: Likewise. + * gcc.dg/vect/no-trapping-math-2.c: Likewise. + * gcc.dg/vect/no-trapping-math-vect-111.c: Likewise. + * gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c: Likewise. + * gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c: Likewise. + * gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c: Likewise. + * gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c: Likewise. + * gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c: Likewise. + * gcc.dg/vect/no-vfa-vect-37.c: Likewise. + * gcc.dg/vect/no-vfa-vect-depend-1.c: Likewise. + * gcc.dg/vect/pr18400.c: Likewise. + * gcc.dg/vect/slp-12b.c: Likewise. + * gcc.dg/vect/slp-14.c: Likewise. + * gcc.dg/vect/slp-7.c: Likewise. + * gcc.dg/vect/slp-15.c: Likewise. + * gcc.dg/vect/slp-16.c: Likewise. + * gcc.dg/vect/slp-17.c: Likewise. + * gcc.dg/vect/slp-24.c: Likewise. + * gcc.dg/vect/slp-28.c: Likewise. + * gcc.dg/vect/slp-3.c: Likewise. + * gcc.dg/vect/slp-34.c: Likewise. + * gcc.dg/vect/slp-6.c: Likewise. + * gcc.dg/vect/slp-8.c: Likewise. + * gcc.dg/vect/vect-107.c: Likewise. + * gcc.dg/vect/vect-108.c: Likewise. + * gcc.dg/vect/vect-11.c: Likewise. + * gcc.dg/vect/vect-112.c: Likewise. + * gcc.dg/vect/vect-115.c: Likewise. + * gcc.dg/vect/vect-11a.c: Likewise. + * gcc.dg/vect/vect-34.c: Likewise. + * gcc.dg/vect/vect-9.c: Likewise. + * gcc.dg/vect/vect-97.c: Likewise. + * gcc.dg/vect/vect-align-1.c: Likewise. + * gcc.dg/vect/vect-float-extend-1.c: Likewise. + * gcc.dg/vect/vect-floatint-conversion-1.c: Likewise. + * gcc.dg/vect/vect-ifcvt-16.c: Likewise. + * gcc.dg/vect/vect-ifcvt-17.c: Likewise. + * gcc.dg/vect/vect-ifcvt-2.c: Likewise. + * gcc.dg/vect/vect-ifcvt-3.c: Likewise. + * gcc.dg/vect/vect-ifcvt-4.c: Likewise. + * gcc.dg/vect/vect-ifcvt-5.c: Likewise. + * gcc.dg/vect/vect-ifcvt-6.c: Likewise. + * gcc.dg/vect/vect-ifcvt-7.c: Likewise. + * gcc.dg/vect/vect-intfloat-conversion-1.c: Likewise. + * gcc.dg/vect/vect-intfloat-conversion-2.c: Likewise. + * gcc.dg/vect/vect-intfloat-conversion-3.c: Likewise. + * gcc.dg/vect/vect-intfloat-conversion-4a.c: Likewise. + * gcc.dg/vect/vect-intfloat-conversion-4b.c: Likewise. + * gcc.dg/vect/vect-multitypes-2.c: Likewise. + * gcc.dg/vect/vect-multitypes-5.c: Likewise. + * gcc.dg/vect/vect-reduc-1.c: Likewise. + * gcc.dg/vect/vect-reduc-1char.c: Likewise. + * gcc.dg/vect/vect-reduc-1short.c: Likewise. + * gcc.dg/vect/vect-reduc-2.c: Likewise. + * gcc.dg/vect/vect-reduc-3.c: Likewise. + * gcc.dg/vect/vect-shift-1.c: Likewise. + * gcc.dg/vect/vect-strided-float.c: Likewise. + * gcc.dg/vect/vect-strided-store-u32-i2.c: Likewise. + * gcc.dg/vect/wrapv-vect-reduc-2char.c: Likewise. + * gcc.dg/vect/wrapv-vect-reduc-2short.c: Likewise. + * gcc.dg/tree-ssa/gen-vect-11.c: Likewise. + * gcc.dg/tree-ssa/gen-vect-11a.c: Likewise. + * gcc.dg/tree-ssa/gen-vect-2.c: Likewise. + * gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c: Likewise. + +2008-08-19 Ira Rosen <irar@il.ibm.com> + + * gcc.dg/vect/slp-multitypes-1.c: New testcase. + * gcc.dg/vect/slp-multitypes-2.c, gcc.dg/vect/slp-multitypes-3.c, + gcc.dg/vect/slp-multitypes-4.c, gcc.dg/vect/slp-multitypes-5.c, + gcc.dg/vect/slp-multitypes-6.c, gcc.dg/vect/slp-multitypes-7.c, + gcc.dg/vect/slp-multitypes-8.c, gcc.dg/vect/slp-multitypes-9.c, + gcc.dg/vect/slp-multitypes-10.c, gcc.dg/vect/slp-multitypes-11.c, + gcc.dg/vect/slp-multitypes-12.c, gcc.dg/vect/slp-widen-mult-u8.c, + gcc.dg/vect/slp-widen-mult-s16.c, gcc.dg/vect/vect-multitypes-16.c, + gcc.dg/vect/vect-multitypes-17.c: Likewise. + * gcc.dg/vect/slp-9.c: Now vectorizable using SLP. + * gcc.dg/vect/slp-14.c, gcc.dg/vect/slp-5.c: Likewise. + * lib/target-supports.exp (check_effective_target_vect_long_long): New. + +2008-08-18 Adam Nemet <anemet@caviumnetworks.com> + + * gcc.target/mips/ext-1.c: Add -mgp64 to dg-mips-options. + +2008-08-18 Steve Ellcey <sje@cup.hp.com> + + * g++.dg/other/anon5.C: Skip on *-*-hpux*. + +2008-08-18 Steve Ellcey <sje@cup.hp.com> + + * gcc.dg/vect/no-vfa-pr29145.c: XFAIL if no_vect_align. + +2008-08-18 Steve Ellcey <sje@cup.hp.com> + + * gcc.target/ia64/types-1.c: Change error to message. + +2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR cpp/7263 + * gcc.dg/cpp/pr7263-2.c: New. + * gcc.dg/cpp/pr7263-2.h: New. + * gcc.dg/cpp/pr7263-3.c: New. + * gcc.dg/cpp/pr7263-3.h: New. + +2008-08-18 Robert Dewar <dewar@adacore.com> + + PR ada/30827 + * gnat.dg/test_version.adb: New. + +2008-08-18 Samuel Tardieu <sam@rfc1149.net> + + PR ada/15808 + * gnat.dg/specs/abstract_private.ads: New. + +2008-08-18 Richard Guenther <rguenther@suse.de> + + * gcc.dg/fold-alloca-1.c: Scan cfg dump instead of cleanup_cfg1. + * gcc.dg/fold-compare-3.c: Likewise. + * gcc.dg/tree-ssa/20030709-2.c: Scan cddce2 dump. + * gcc.dg/tree-ssa/20030808-1.c: Likewise. + * gcc.dg/tree-ssa/20040211-1.c: Likewise. + * gcc.dg/tree-ssa/20040305-1.c: Likewise. + * gcc.dg/tree-ssa/forwprop-1.c: Adjust pattern. + * gcc.dg/tree-ssa/forwprop-2.c: Likewise.. + * gcc.dg/tree-ssa/ssa-dce-3.c: Scan cddce1 dump. + +2008-08-16 Tobias Burnus <burnus@net-b.de> + + PR fortran/36825 + * gfortran.dg/rank_1.f90: Modify error message. + +2008-08-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/35863 + * gfortran.dg/utf8_1.f03: New test. + * gfortran.dg/utf8_2.f03: New test. + +2008-08-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + * gcc.dg/pr30551-6.c: Skip for SPU. + * gcc.dg/pr30551-3.c: Likewise. + * gcc.dg/pr30551.c: Likewise. + * g++.dg/warn/pr30551-2.C: Likewise. + * g++.dg/warn/pr30551.C: Likewise. + +2008-08-14 Janus Weil <janus@gcc.gnu.org> + + PR fortran/36705 + * gfortran.dg/argument_checking_7.f90: Modified. + * gfortran.dg/conflicts.f90: Modified. + * gfortran.dg/proc_decl_1.f90: Modified. + * gfortran.dg/proc_ptr_9.f90: New. + +2008-08-14 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/34485 + * g++.dg/template/crash81.C: New. + * g++.old-deja/g++.benjamin/tem03.C: Adjust. + * g++.old-deja/g++.benjamin/tem04.C: Likewise. + * g++.old-deja/g++.brendan/crash7.C: Likewise. + +2008-08-14 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/36886 + * gfortran.dg/cshift_char_3.f90: New test case. + * gfortran.dg/cshift_nan_1.f90: New test case. + 2008-08-14 Rafael Avila de Espindola <espindola@google.com> * gcc.dg/visibility-14.c: New test. @@ -14,7 +1528,7 @@ 2008-08-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> - PR c/28152 + PR c/28152 * gcc.dg/parser-pr28152.c: New. * gcc.dg/parser-pr28152-2.c: New. diff --git a/gcc/testsuite/g++.dg/abi/mangle-neon.C b/gcc/testsuite/g++.dg/abi/mangle-neon.C index 9f88f8baba3..a3fa65c104f 100644 --- a/gcc/testsuite/g++.dg/abi/mangle-neon.C +++ b/gcc/testsuite/g++.dg/abi/mangle-neon.C @@ -26,6 +26,8 @@ void f15 (float32x4_t a) {} void f16 (poly8x16_t a) {} void f17 (poly16x8_t a) {} +void f18 (int8x16_t, int8x16_t) {} + // { dg-final { scan-assembler "_Z2f015__simd64_int8_t:" } } // { dg-final { scan-assembler "_Z2f116__simd64_int16_t:" } } // { dg-final { scan-assembler "_Z2f216__simd64_int32_t:" } } @@ -44,4 +46,4 @@ void f17 (poly16x8_t a) {} // { dg-final { scan-assembler "_Z3f1519__simd128_float32_t:" } } // { dg-final { scan-assembler "_Z3f1617__simd128_poly8_t:" } } // { dg-final { scan-assembler "_Z3f1718__simd128_poly16_t:" } } - +// { dg-final { scan-assembler "_Z3f1816__simd128_int8_tS_:" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/auto2.C b/gcc/testsuite/g++.dg/cpp0x/auto2.C new file mode 100644 index 00000000000..a3df9d1927e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto2.C @@ -0,0 +1,72 @@ +// Positive test for auto +// { dg-do run } +// { dg-options "-std=c++0x" } + +#include <typeinfo> +extern "C" void abort(); + +int f() {} + +struct A +{ + int i; + int f() {} + A operator+(A a) { return a; } +}; + +template <class T> +void g(T t) +{ + auto x = t+t; + if (typeid(x) != typeid(t+t)) + abort(); + + auto p = new auto(&t); + if (typeid(p) != typeid(T**)) + abort(); +} + +int main() +{ + auto i = 42; + if (typeid (i) != typeid (int)) + abort(); + + auto *p = &i; + if (typeid (p) != typeid (int*)) + abort(); + + auto *p2 = &p; + if (typeid (p2) != typeid (int**)) + abort(); + + auto (*fp)() = f; + if (typeid (fp) != typeid (int (*)())) + abort(); + + auto A::* pm = &A::i; + if (typeid (pm) != typeid (int A::*)) + abort(); + + auto (A::*pmf)() = &A::f; + if (typeid (pmf) != typeid (int (A::*)())) + abort(); + + g(42); + g(10.f); + g(A()); + + auto *p3 = new auto (i); + if (typeid (p3) != typeid (int*)) + abort(); + + for (auto idx = i; idx != 0; idx = 0); + while (auto idx = 0); + if (auto idx = 1); + + switch (auto s = i) + { + case 42: + break; + } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/auto3.C b/gcc/testsuite/g++.dg/cpp0x/auto3.C new file mode 100644 index 00000000000..dc4218bf023 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto3.C @@ -0,0 +1,23 @@ +// Negative test for auto +// { dg-options "-std=c++0x" } + +#include <initializer_list> + +auto x; // { dg-error "auto" } + +// New CWG issue +auto a[2] = { 1, 2 }; // { dg-error "auto" } + +template<class T> +struct A { }; + +A<int> A1; +// CWG issue 625 +A<auto> A2 = A1; // { dg-error "auto" } + +auto foo() { } // { dg-error "auto" } + +void bar(auto i) // { dg-error "incomplete|auto" } +{ + (void)i; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/auto4.C b/gcc/testsuite/g++.dg/cpp0x/auto4.C new file mode 100644 index 00000000000..d47bca4369d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto4.C @@ -0,0 +1,28 @@ +// Testcase for deduction of std::initializer_list for auto. +// { dg-do run } +// { dg-options "-std=c++0x" } + +#include <typeinfo> +#include <initializer_list> +extern "C" void abort(); + +template <class T> +void f (T t) +{ + auto ilt = { &t, &t }; + if (typeid(ilt) != typeid(std::initializer_list<T*>)) + abort(); + + auto il = { 1, 2, 3 }; + if (typeid(il) != typeid(std::initializer_list<int>)) + abort(); +} + +int main() +{ + auto il = { 1, 2, 3 }; + if (typeid(il) != typeid(std::initializer_list<int>)) + abort(); + + f('c'); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/auto5.C b/gcc/testsuite/g++.dg/cpp0x/auto5.C new file mode 100644 index 00000000000..ebe2df22e6f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto5.C @@ -0,0 +1,22 @@ +// Testcase for non-dependent auto in templates +// { dg-options "-std=c++0x" } + +struct A +{ + template<class> void f(); +} a; + +template <class T> +void g() +{ + auto aa = a; + aa.f<int>(); + + auto p = new auto (a); + p->f<int>(); +} + +int main() +{ + g<double>(); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/enum_base.C b/gcc/testsuite/g++.dg/cpp0x/enum_base.C new file mode 100644 index 00000000000..5607961f242 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/enum_base.C @@ -0,0 +1,25 @@ +// { dg-options "-std=c++0x" } + +typedef unsigned volatile long long uvlonglong; + +enum E1 : char { }; +enum E2 : signed const short { }; +enum E3 : uvlonglong { }; +enum E4 : char { + val = 500 // { dg-error "too large" } +}; + +enum class E5 { + val = (unsigned long long)-1 // { dg-error "too large" } +}; + +typedef float Float; + +enum class E6 : Float { }; // { dg-error "must be an integral type" } + +static_assert (sizeof(E1) == sizeof(char), "char-sized enum"); +static_assert (sizeof(E2) == sizeof(signed short), "short-sized enum"); +static_assert (sizeof(E3) == sizeof(unsigned long long), + "long long-sized enum"); +static_assert (sizeof(E4) == sizeof(char), "char-sized enum"); +static_assert (sizeof(E5) == sizeof(int), "scoped enum with int size"); diff --git a/gcc/testsuite/g++.dg/cpp0x/enum_base_warn.C b/gcc/testsuite/g++.dg/cpp0x/enum_base_warn.C new file mode 100644 index 00000000000..4b14cf65e09 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/enum_base_warn.C @@ -0,0 +1,25 @@ +// { dg-do run } +// { dg-options "-O2 -Wtype-limits -std=c++0x" } +extern void link_error (void); + +enum Alpha : unsigned char { + ZERO = 0, ONE, TWO, THREE +}; + +Alpha a2; + +int m1 = -1; +int GetM1() { + return m1; +} + +int main() { + a2 = static_cast<Alpha>(GetM1()); + if (a2 == -1) { // { dg-warning "always false due" } + link_error (); + } + if (-1 == a2) { // { dg-warning "always false due" } + link_error (); + } + return 0; +} diff --git a/gcc/testsuite/g++.dg/cpp0x/scoped_enum.C b/gcc/testsuite/g++.dg/cpp0x/scoped_enum.C new file mode 100644 index 00000000000..d713c2779c8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/scoped_enum.C @@ -0,0 +1,76 @@ +// { dg-options "-std=c++0x" } +enum class Color1 { + Red, + Green, + Blue +}; + +enum struct Color2 { + Red, // { dg-error "previously declared here" } + Orange, + Yellow, + Green, + Blue, + Indigo = Green + 2, + Violet, + Red // { dg-error "redefinition" } +}; + +enum Color { + Red, Green, Blue +}; + +enum class Color3 { + Red +}; + +enum class Color color; +enum Color3 color3; + +void f(int); +void f2(Color3); + +void g() +{ + int i = 0; + f(color); // okay: unscoped enum + f(color3); // { dg-error "cannot convert" } + f2(color); // { dg-error "cannot convert" } + f2(color3); + f2(i); // { dg-error "cannot convert" } + i = color3; // { dg-error "cannot convert" } + color3 = i; // { dg-error "cannot convert" } + f(static_cast<int>(color3)); // okay + + int a[5]; + a[color3]; // { dg-error "array subscript is not an integer" } + + bool b = color3; // { dg-error "cannot convert" } +} + +void h() +{ + Color1 c1 = Color1::Red; + Color2 c2 = Color1::Red; // { dg-error "cannot convert" } + c2 = Color1::Red; // { dg-error "cannot convert" } + + c2 = Color2::Red; + int c3 = Color::Red; +} + +template<typename T, T value> +struct constant { }; + +template<typename T> +int& sfinae(constant<T, T::Green>*); + +float& sfinae(void*); + +void sfinae_test() +{ + int& test1 = sfinae((constant<Color1, Color1::Green>*)0); + int& test2 = sfinae((constant<Color2, Color2::Green>*)0); + float& test3 = sfinae((constant<Color1, Color1::Red>*)0); + int& test4 = sfinae((constant<Color, Green>*)0); + float& test5 = sfinae((constant<Color, Red>*)0); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/scoped_enum_98.C b/gcc/testsuite/g++.dg/cpp0x/scoped_enum_98.C new file mode 100644 index 00000000000..8c24e86bac2 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/scoped_enum_98.C @@ -0,0 +1,4 @@ +// { dg-do compile } +// { dg-options "-std=c++98" } +enum class E1 { e1 }; // { dg-warning "scoped enums" } +enum E2 : char { e2 }; // { dg-warning "scoped enums" } diff --git a/gcc/testsuite/g++.dg/cpp0x/scoped_enum_examples.C b/gcc/testsuite/g++.dg/cpp0x/scoped_enum_examples.C new file mode 100644 index 00000000000..67c3fcbebb1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/scoped_enum_examples.C @@ -0,0 +1,27 @@ +// { dg-do compile } +// { dg-options "-std=c++0x" } +enum class Col { red, yellow, green }; + +int x = Col::red; // { dg-error "cannot convert" } +Col y = Col::red; + +void f() +{ + if (y) { } // { dg-error "could not convert" } +} + +enum direction { left='l', right='r' }; +void g() { + // OK + direction d; + // OK + d = left; + // OK + d = direction::right; +} +enum class altitude { high='h', low='l' }; +void h() { + altitude a; + a = high; // { dg-error "not declared in this scope" } + a = altitude::low; +} diff --git a/gcc/testsuite/g++.dg/ext/altivec-2.C b/gcc/testsuite/g++.dg/ext/altivec-2.C index 6a404b266d8..268ff998946 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-2.C +++ b/gcc/testsuite/g++.dg/ext/altivec-2.C @@ -10,7 +10,7 @@ int main (int argc, const char * argv[]) { - int i; + int i = 0; const float cf = 1.0; vector float v; const vector float cv = (vector float){1.0, 2.0, 3.0, 4.0}; diff --git a/gcc/testsuite/g++.dg/ext/altivec-3.C b/gcc/testsuite/g++.dg/ext/altivec-3.C index da029eed77d..d42303d8140 100644 --- a/gcc/testsuite/g++.dg/ext/altivec-3.C +++ b/gcc/testsuite/g++.dg/ext/altivec-3.C @@ -120,16 +120,19 @@ void baz2 (int i, ... ) CHECK_INVARIANT (vec_all_eq (vxi.v, vx_g.v)); } -int main(void) +void main1(void) { CHECK_INVARIANT (sizeof(struct foo) == 8 && sizeof(struct vfoo) == 48); - altivec_check(); - bar(i_1, x_g, (short)i_2, (float)d_2, ld_1, (char)i_1, d_3); baz(i_1, v_g, i_1, vx_g, i_1, v2_g, i_1, vx2_g); quux(i_1, v_g, v_g); baz2(i_1, vx_g); - +} + +int main(void) +{ + altivec_check(); + main1(); return 0; } diff --git a/gcc/testsuite/g++.dg/gomp/pr35158.C b/gcc/testsuite/g++.dg/gomp/pr35158.C new file mode 100644 index 00000000000..933eba1ab2c --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr35158.C @@ -0,0 +1,14 @@ +// PR c++/35158 +// { dg-do compile } +// { dg-options "-fopenmp" } + +int main(int argc, char *argv[]) +{ +#pragma omp parallel for + for (int i(0) ; // { dg-error "error: parenthesized initialization is not allowed in OpenMP 'for' loop" } + i < 10 ; + i++) + ; + + return 0; +} diff --git a/gcc/testsuite/g++.dg/ipa/iinline-1.C b/gcc/testsuite/g++.dg/ipa/iinline-1.C index be3be71f96a..a7bb374f7f9 100644 --- a/gcc/testsuite/g++.dg/ipa/iinline-1.C +++ b/gcc/testsuite/g++.dg/ipa/iinline-1.C @@ -44,4 +44,4 @@ int main (int argc, char *argv[]) } /* { dg-final { scan-ipa-dump "String::funcOne\[^\\n\]*inline copy in int main" "inline" } } */ -/* { dg-final { cleanup-tree-dump "inline" } } */ +/* { dg-final { cleanup-ipa-dump "inline" } } */ diff --git a/gcc/testsuite/g++.dg/opt/anchor1.C b/gcc/testsuite/g++.dg/opt/anchor1.C index 5d30afbe8a3..e24b0a4fe6f 100644 --- a/gcc/testsuite/g++.dg/opt/anchor1.C +++ b/gcc/testsuite/g++.dg/opt/anchor1.C @@ -47,7 +47,7 @@ YCoreFont::~YCoreFont() { int foo(YCoreFont *ycf) { - ycf->ascent (); + return ycf->ascent (); } int main() diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C index 189cfa4624b..a82d3f7b50e 100644 --- a/gcc/testsuite/g++.dg/other/anon5.C +++ b/gcc/testsuite/g++.dg/other/anon5.C @@ -1,5 +1,5 @@ // PR c++/34094 -// { dg-do link { target { ! hppa*-*-hpux* } } } +// { dg-do link { target { ! *-*-hpux* } } } // { dg-options "-g" } namespace { diff --git a/gcc/testsuite/g++.dg/other/i386-5.C b/gcc/testsuite/g++.dg/other/i386-5.C new file mode 100644 index 00000000000..2556e7e021b --- /dev/null +++ b/gcc/testsuite/g++.dg/other/i386-5.C @@ -0,0 +1,9 @@ +/* Test that {,x,e,p,t,s,w,g,a,b}mmintrin.h, mm3dnow.h and mm_malloc.h are + usable with -O -fkeep-inline-functions. */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O -fkeep-inline-functions -march=k8 -m3dnow -maes -mpclmul -mavx -msse5" } */ + +#include <wmmintrin.h> +#include <bmmintrin.h> +#include <gmmintrin.h> +#include <mm3dnow.h> diff --git a/gcc/testsuite/g++.dg/other/i386-6.C b/gcc/testsuite/g++.dg/other/i386-6.C new file mode 100644 index 00000000000..905ac97b011 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/i386-6.C @@ -0,0 +1,11 @@ +/* Test that {,x,e,p,t,s,w,g,a,b}mmintrin.h, mm3dnow.h and mm_malloc.h are + usable with -O -pedantic-errors. */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O -pedantic-errors -march=k8 -m3dnow -mavx -msse5 -maes -mpclmul" } */ + +#include <wmmintrin.h> +#include <bmmintrin.h> +#include <gmmintrin.h> +#include <mm3dnow.h> + +int dummy; diff --git a/gcc/testsuite/g++.dg/other/new-size-type.C b/gcc/testsuite/g++.dg/other/new-size-type.C new file mode 100644 index 00000000000..04933fd4a2c --- /dev/null +++ b/gcc/testsuite/g++.dg/other/new-size-type.C @@ -0,0 +1,10 @@ +// Contributed by Dodji Seketeli <dodji@redhat.com> +// Origin: PR c++/36741 + +#include <stddef.h> +const char* +foo() +{ + return new char[~static_cast<size_t>(0)];// { dg-bogus "large" } +} + diff --git a/gcc/testsuite/g++.dg/parse/crash44.C b/gcc/testsuite/g++.dg/parse/crash44.C new file mode 100644 index 00000000000..abdf827cd4d --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash44.C @@ -0,0 +1,15 @@ +// PR c++/37260 +// { dg-options "" } + +struct pthread_once_t { }; +struct test { + pthread_once_t once; +}; + +int main(void) { + struct test foo = { + once: PTHREAD_ONCE_INITIALIZER // { dg-error "error: 'PTHREAD_ONCE_INITIALIZER' was not declared in this scope" } + }; + + return 0; +} diff --git a/gcc/testsuite/g++.dg/parse/offsetof8.C b/gcc/testsuite/g++.dg/parse/offsetof8.C new file mode 100644 index 00000000000..9add91e3768 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/offsetof8.C @@ -0,0 +1,16 @@ +// PR c++/35321 + +struct A +{ + A operator[] (int); +}; + +struct B +{ + A a; +}; + +void foo() +{ + __builtin_offsetof(B, a[0]); /* { dg-error "error: cannot apply 'offsetof' when 'operator\\\[\\\]' is overloaded" } */ +} diff --git a/gcc/testsuite/g++.dg/template/crash81.C b/gcc/testsuite/g++.dg/template/crash81.C new file mode 100644 index 00000000000..f2b76744f33 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash81.C @@ -0,0 +1,6 @@ +// PR c++/34485 + +struct A +{ + template<T::X> struct X; // { dg-error "error: 'T' has not been declared|error: declaration of 'template<int X> struct A::X'|error: shadows template parm 'int X'" } +}; diff --git a/gcc/testsuite/g++.dg/torture/pr36444.C b/gcc/testsuite/g++.dg/torture/pr36444.C new file mode 100644 index 00000000000..fd20bde3d47 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr36444.C @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +#define vector __attribute__((vector_size(16) )) +struct struct1 { + union {} vmx; + struct struct2 { + struct2(const struct2& r) {} + } w; +} __attribute__((aligned(16))); +struct struct3 { + vector float vmx; + operator const struct1& () const{ + return *reinterpret_cast<const struct1*>(this); + } +}; +struct3 func3( struct3 V1); +struct3 func2( void ); +void func1( ) { + struct1 vVec = func2() ; + func3 ( (struct3&)vVec ); +} + diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C index 6123e033c78..96790239693 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/pr31146.C +++ b/gcc/testsuite/g++.dg/tree-ssa/pr31146.C @@ -12,6 +12,5 @@ void foo (int j) *q = 1; } -/* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "i\\\[j.*\\\] = 1;" "forwprop2" } } */ +/* { dg-final { scan-tree-dump "i\\\[j.*\\\] =.* 1;" "forwprop1" } } */ /* { dg-final { cleanup-tree-dump "forwprop?" } } */ diff --git a/gcc/testsuite/g++.dg/vect/pr37143.C b/gcc/testsuite/g++.dg/vect/pr37143.C new file mode 100644 index 00000000000..70cdfd29b8b --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr37143.C @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +void +f(int NumberOfSideSets, int *ssNumDFperSide, float *ssDF) +{ + int i; + float *newssDF = __null; + int *newssNumDF = new int [NumberOfSideSets]; + int ndf, nextDF, numNewDF = 0; + int ii=0; + for (i=0; i<NumberOfSideSets; i++) + numNewDF += newssNumDF[i]; + if (numNewDF > 0) + newssDF = new float [numNewDF]; + nextDF = 0; + ndf = ssNumDFperSide[ii]; + for (i=0; i<ndf; i++) + newssDF[nextDF++] = ssDF[i]; +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/g++.dg/vect/pr37174.cc b/gcc/testsuite/g++.dg/vect/pr37174.cc new file mode 100644 index 00000000000..d720e4bfe9d --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr37174.cc @@ -0,0 +1,23 @@ +/* { dg-do compile } */ + +int* getFoo(); +struct Bar { + Bar(); + int* foo1; + int* foo2; + int* table[4][4][4]; +}; +Bar::Bar() { + foo1 = getFoo(); + foo2 = getFoo(); + for (int a = 0; a < 4; ++a) { + for (int b = 0; b < 4; ++b) { + for (int c = 0; c < 4; ++c) { + table[a][b][c] = foo1; + } + } + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C b/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C index f3cd3105386..a6df4035a62 100644 --- a/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C +++ b/gcc/testsuite/g++.dg/warn/Wconversion-pr34389.C @@ -1,7 +1,7 @@ /* PR 34389 */ /* { dg-do compile } */ /* { dg-options "-Wconversion -Wsign-conversion" } */ - +/* { dg-require-effective-target int32plus } */ short mask1(short x) { short y = 0x7fff; @@ -32,7 +32,8 @@ short mask3(int si, unsigned int ui) us = si & 0x7fff; us = si & 0xAAAA; /* { dg-warning "conversion" } */ us = ui & 0x7fff; - us = ui & 0xAAAA; /* { dg-warning "conversion" } */ + us = ui & 0xAAAA; /* 0xAAAA is zero-extended, thus it masks the + upper bits of 'ui' making it fit in 'us'. */ return ss; } diff --git a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C index 64d5199bcd5..282ac13da58 100644 --- a/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C +++ b/gcc/testsuite/g++.dg/warn/Wconversion-real-integer.C @@ -4,7 +4,7 @@ /* { dg-do compile } /* { dg-options "-Wconversion" } */ - +/* { dg-require-effective-target int32plus } */ #include <limits.h> void fsi (signed int x); @@ -71,3 +71,42 @@ void h (void) } +void fss (signed short x); +void fus (unsigned short x); +void fsc (signed char x); +void fuc (unsigned char x); + +void h2 (void) +{ + unsigned short int us; + short int ss; + unsigned char uc; + signed char sc; + + fss (4294967294.0); /* { dg-warning "conversion" } */ + ss = 4294967294.0; /* { dg-warning "conversion" } */ + fss (-4294967294.0); /* { dg-warning "conversion" } */ + ss = -4294967294.0; /* { dg-warning "conversion" } */ + fus (4294967294.0); /* { dg-warning "conversion" } */ + us = 4294967294.0; /* { dg-warning "conversion" } */ + fus (-4294967294.0); /* { dg-warning "conversion" } */ + us = -4294967294.0; /* { dg-warning "conversion" } */ + + fsc (500.0); /* { dg-warning "conversion" } */ + sc = 500.0; /* { dg-warning "conversion" } */ + fsc (-500.0); /* { dg-warning "conversion" } */ + sc = -500.0; /* { dg-warning "conversion" } */ + fuc (500.0); /* { dg-warning "conversion" } */ + uc = 500.0; /* { dg-warning "conversion" } */ + fuc (-500.0); /* { dg-warning "conversion" } */ + uc = -500.0; /* { dg-warning "conversion" } */ + + fss (500.0); + ss = 500.0; + fss (-500.0); + ss = -500.0; + fus (500.0); + us = 500.0; + fus (-500.0); /* { dg-warning "conversion" } */ + us = -500.0; /* { dg-warning "conversion" } */ +} diff --git a/gcc/testsuite/g++.dg/warn/Wsequence-point-pr18050.C b/gcc/testsuite/g++.dg/warn/Wsequence-point-pr18050.C new file mode 100644 index 00000000000..63aecd0f3ed --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wsequence-point-pr18050.C @@ -0,0 +1,24 @@ +/* PR 18050 : bogus warning with -Wsequence-point */ +/* { dg-do compile } */ +/* { dg-options "-Wsequence-point" } */ + +struct x +{ + int i; +}; +void bar(struct x*, int *); + +void foo(struct x *y) +{ + bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */ +} + +void zz(int a, int *b) +{ + *b = a; +} + +void baz(void) { + int a = 5; + zz(++a, &a); /* { dg-bogus "operation on 'a' may be undefined" } */ +} diff --git a/gcc/testsuite/g++.dg/warn/pr35602.C b/gcc/testsuite/g++.dg/warn/pr35602.C new file mode 100644 index 00000000000..66a569b3d27 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/pr35602.C @@ -0,0 +1,28 @@ +// PR 35602 Bogus warning with -Wsign-conversion +// { dg-do compile } +// { dg-options "-Wconversion -Wsign-conversion" } +struct c +{ + ~c(); + c(); +}; + +int + +main(const int, + const char * const * const) +{ + c x[0UL][0UL] = // { dg-bogus "warning: conversion to .long unsigned int. from .long int. may change the sign of the result" } + { + }; + + c y[0UL] = + { + }; + + int z[0ul][0UL] = + { + }; + + return 0; +} diff --git a/gcc/testsuite/g++.dg/warn/sequence-pt-1.C b/gcc/testsuite/g++.dg/warn/sequence-pt-1.C new file mode 100644 index 00000000000..3b9214233cd --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/sequence-pt-1.C @@ -0,0 +1,109 @@ +/* Test for sequence point warnings. */ +/* Origin: Michael Meeks in + <URL:http://gcc.gnu.org/ml/gcc-patches/1998-06/msg00316.html>, + adapted to a testcase by Joseph Myers <jsm28@cam.ac.uk>. */ +/* { dg-do compile } */ +/* { dg-options "-Wsequence-point" } */ + +struct s +{ + int a; +}; + +extern int fn (int); +extern int fnb (int, int); +extern int fnc (int *); +extern int sprintf (char *, const char *, ...); + +typedef __SIZE_TYPE__ size_t; + +void +foo (int a, int b, int n, int p, int *ptr, struct s *sptr, + int *ap, int *bp, int **cp, char *ans, int (*fnp[8])(int)) +{ + int len; + + a = a++; /* { dg-warning "undefined" "sequence point warning" } */ + a = --a; /* { dg-warning "undefined" "sequence point warning" } */ + a = ++a + b; /* { dg-warning "undefined" "sequence point warning" } */ + a = a-- + b; /* { dg-warning "undefined" "sequence point warning" } */ + ap[n] = bp[n++]; /* { dg-warning "undefined" "sequence point warning" } */ + ap[--n] = bp[n]; /* { dg-warning "undefined" "sequence point warning" } */ + ap[++n] = bp[--n]; /* { dg-warning "undefined" "sequence point warning" } */ + cp[n][n] = cp[n][n]++; /* { dg-warning "undefined" "sequence point warning" { xfail *-*-* } } */ + cp[n][p] = cp[n][n++]; /* { dg-warning "undefined" "sequence point warning" } */ + *ptr++ = (size_t)ptr++; /* { dg-warning "undefined" "sequence point warning" } */ + sptr->a = sptr->a++; /* { dg-warning "undefined" "sequence point warning" { xfail *-*-* } } */ + sptr->a = (size_t)(sptr++); /* { dg-warning "undefined" "sequence point warning" } */ + *ptr++ = fn (*ptr); /* { dg-warning "undefined" "sequence point warning" } */ + a = b = a++; /* { dg-warning "undefined" "sequence point warning" } */ + b = a = --b; /* { dg-warning "undefined" "sequence point warning" } */ + a = 1 + (a = 1); /* { dg-warning "undefined" "sequence point warning" } */ + a = (a = b); /* { dg-warning "undefined" "sequence point warning" } */ + a = (a = b) + 1; /* { dg-warning "undefined" "sequence point warning" } */ + a = (bp[a++] = b) + 1; /* { dg-warning "undefined" "sequence point warning" } */ + a = b++ * b++; /* { dg-warning "undefined" "sequence point warning" } */ + a = fnb (b++, b++); /* { dg-warning "undefined" "sequence point warning" } */ + a = (*fnp[b++]) (b++); /* { dg-warning "undefined" "sequence point warning" } */ + a = (*fnp[b]) (b++); /* { dg-warning "undefined" "sequence point warning" } */ + a = (*fnp[b++]) (b); /* { dg-warning "undefined" "sequence point warning" } */ + *ap = fnc (ap++); /* { dg-warning "undefined" "sequence point warning" } */ + (a += b) + (a += n); /* { dg-warning "undefined" "sequence point warning" } */ + a = (b, b++) + (b++, b); /* { dg-warning "undefined" "sequence point warning" } */ + ap[a++] += a; /* { dg-warning "undefined" "sequence point warning" } */ + ap[a+=1] += a; /* { dg-warning "undefined" "sequence point warning" } */ + ap[a++] += a++; /* { dg-warning "undefined" "sequence point warning" } */ + ap[a+=1] += a++; /* { dg-warning "undefined" "sequence point warning" } */ + a = a++, b = a; /* { dg-warning "undefined" "sequence point warning" } */ + b = a, a = a++; /* { dg-warning "undefined" "sequence point warning" } */ + a = (b++ ? n : a) + b; /* { dg-warning "undefined" "sequence point warning" } */ + b ? a = a++ : a; /* { dg-warning "undefined" "sequence point warning" } */ + b && (a = a++); /* { dg-warning "undefined" "sequence point warning" } */ + (a = a++) && b; /* { dg-warning "undefined" "sequence point warning" } */ + b, (a = a++); /* { dg-warning "undefined" "sequence point warning" } */ + (a = a++), b; /* { dg-warning "undefined" "sequence point warning" } */ + a ^= b ^= a ^= b; /* { dg-warning "undefined" "sequence point warning" } */ + + a = a; /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = ! (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = - (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = (double) (a++ && 4); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + len = sprintf (ans, "%d", len++); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = fn (a++); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + b++, (b + b); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + (a = b++), (a = b++); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = (b++, b++); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = b++ && b++; /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = b++ || b++; /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = (b++ ? b++ : a); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + a = (b++ ? a : b++); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + ap[a++] += bp[b]; /* { dg-bogus "undefined" "bogus sequence point warning" } */ + ap[a += 1] += 1; /* { dg-bogus "undefined" "bogus sequence point warning" } */ + *ptr < 128 ? *ptr++ : *(ptr += 2); /* { dg-bogus "undefined" "bogus sequence point warning" } */ + + /* The following will be represented internally with a tree consisting of + many duplicated SAVE_EXPRs. This caused the previous version of the + sequence point warning code to fail by running out of virtual memory. */ + a = ((b & 1 ? 21 : 0) + | (b & 2 ? 22 : 0) + | (b & 3 ? 23 : 0) + | (b & 4 ? 24 : 0) + | (b & 5 ? 25 : 0) + | (b & 6 ? 26 : 0) + | (b & 7 ? 27 : 0) + | (b & 8 ? 28 : 0) + | (b & 9 ? 29 : 0) + | (b & 10 ? 30 : 0) + | (b & 11 ? 31 : 0) + | (b & 12 ? 32 : 0) + | (b & 13 ? 1 : 0) + | (b & 14 ? 2 : 0) + | (b & 15 ? 3 : 0) + | (b & 16 ? 4 : 0) + | (b & 17 ? 5 : 0) + | (b & 18 ? 6 : 0) + | (b & 19 ? 7 : 0) + | (b & 20 ? 8 : 0) + | (b & 21 ? 9 : 0)); +} diff --git a/gcc/testsuite/g++.dg/warn/sequence-pt-pr17880.C b/gcc/testsuite/g++.dg/warn/sequence-pt-pr17880.C new file mode 100644 index 00000000000..01d87be8bbe --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/sequence-pt-pr17880.C @@ -0,0 +1,54 @@ +// PR 17880 +// { dg-do compile } +// { dg-options "-Wsequence-point" } + +int +foo (int x) +{ + unsigned int a; + int b; + + b = (a += 5) > a; // { dg-warning "undefined" "sequence point warning" } + b = (a += 5) + a == 10; // { dg-warning "undefined" "sequence point warning" } + b = (a -= 5) > a; // { dg-warning "undefined" "sequence point warning" } + b = (a -= 5) + a == 10; // { dg-warning "undefined" "sequence point warning" } + b = a-- > a; // { dg-warning "undefined" "sequence point warning" } + b = a-- + a == 10; // { dg-warning "undefined" "sequence point warning" } + b = ++a > a; // { dg-warning "undefined" "sequence point warning" } + b = ++a + a == 10; // { dg-warning "undefined" "sequence point warning" } + + if ((a += 5) > a) return -1; // { dg-warning "undefined" "sequence point warning" } + if ((a += 5) + a == 10) return -1; // { dg-warning "undefined" "sequence point warning" } + if ((a -= 5) > a) return -1; // { dg-warning "undefined" "sequence point warning" } + if ((a -= 5) + a == 10) return -1; // { dg-warning "undefined" "sequence point warning" } + if (a-- > a) return -1; // { dg-warning "undefined" "sequence point warning" } + if (a-- + a == 10) return -1; // { dg-warning "undefined" "sequence point warning" } + if (++a > a) return -1; // { dg-warning "undefined" "sequence point warning" } + if (++a + a == 10) return -1; // { dg-warning "undefined" "sequence point warning" } + do {} while ((a += 5) > a); // { dg-warning "undefined" "sequence point warning" } + while ((a += 5) > a); // { dg-warning "undefined" "sequence point warning" } + for ((a += 5) > a;;); // { dg-warning "undefined" "sequence point warning" } + for (b = (a += 5) > a;;); // { dg-warning "undefined" "sequence point warning" } + for (; (a += 5) > a;); // { dg-warning "undefined" "sequence point warning" } + for (;; b = (a += 5) > a); // { dg-warning "undefined" "sequence point warning" } + for (;; a++ + a++); // { dg-warning "undefined" "sequence point warning" } + if (a) a++ - a--; // { dg-warning "undefined" "sequence point warning" } + ((a +=5) > a) ? a : b; // { dg-warning "undefined" "sequence point warning" } + return (a++ - a--); // { dg-warning "undefined" "sequence point warning" } +} + +void bar (int i) +{ + int a = i++ - i++; // { dg-warning "undefined" "sequence point warning" } +} + +void baz (int i) +{ + switch (i++ + i++) // { dg-warning "undefined" "sequence point warning" } + { + case 1: + i++ - i++; // { dg-warning "undefined" "sequence point warning" } + case 2: + break; + } +} diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C index 73b99659e12..8f7459f17fb 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem03.C @@ -83,7 +83,7 @@ public: template <class T10, int i> struct Xfour {// { dg-error "" } .* int T10; // { dg-error "" } .* void f(){ - char T10; + char T10; // { dg-error "error: declaration of 'char T10'" } } }; @@ -123,11 +123,11 @@ public: template <class U> friend bool fooy(U u); - template <class T161> + template <class T161> // { dg-error "error: declaration of 'class T161'" } friend bool foo(T161 u) { - Xseven<T161, 5, int> obj; // { dg-error "" } .* - return (obj.inst == u.inst); // { dg-error "" } .* + Xseven<T161, 5, int> obj; + return (obj.inst == u.inst); } }; diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C b/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C index d486efbbaef..7dd7462c334 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/tem04.C @@ -91,7 +91,7 @@ public: template <typename T14, template <typename T15> class C12>// { dg-error "" } .* class Xeighteen { protected: - C12<T14> value; // { dg-error "" } + C12<T14> value; int C12; // { dg-error "" } .* }; diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C index 99fee519f52..d53dee77dd3 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash7.C @@ -44,5 +44,5 @@ void Sort<Comp>::sort (Vector<Comp::T> &v)// { dg-error "" } use of bad T void f (Vector<int> &vi) { - Sort<Comparator<int> >::sort (vi); + Sort<Comparator<int> >::sort (vi); // { dg-error "error: 'sort' is not a member of 'Sort<Comparator<int> >'" } } diff --git a/gcc/testsuite/gcc.c-torture/compile/20080820-1.c b/gcc/testsuite/gcc.c-torture/compile/20080820-1.c new file mode 100644 index 00000000000..a4d4375ad2e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20080820-1.c @@ -0,0 +1,5 @@ +extern unsigned long volatile jiffies; +void do_timer(void) +{ + (*(unsigned long *)&jiffies)++; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36817.c b/gcc/testsuite/gcc.c-torture/compile/pr36817.c new file mode 100644 index 00000000000..396f491ec05 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr36817.c @@ -0,0 +1,10 @@ +void xxx() +{ + unsigned i; + unsigned *p=0; + for(i=0; i<4; ++i) + *p++=0; + for(i=0; i<4; ++i) + *p++=0; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37078.c b/gcc/testsuite/gcc.c-torture/compile/pr37078.c new file mode 100644 index 00000000000..1cc1659f1c8 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37078.c @@ -0,0 +1,6 @@ +int foo (int b) +{ + if (b == (int)0x80000000) + return __builtin_abs (b); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37207.c b/gcc/testsuite/gcc.c-torture/compile/pr37207.c new file mode 100644 index 00000000000..72333d26f6c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37207.c @@ -0,0 +1,21 @@ +void +func_18 ( int t ) +{ + unsigned l_889; + int l_895 = 1; + for (0; 1; ++l_889) + { + int t1 = 0; + if (func_81 (1)) + { + int rhs = l_895; + if (rhs == 0) + rhs = 1; + if (1 & (t % rhs)) + t1 = 1; + } + func_98 (t1); + l_895 = 0; + } +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/vector-4.c b/gcc/testsuite/gcc.c-torture/compile/vector-4.c new file mode 100644 index 00000000000..b0d8e81c82d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/vector-4.c @@ -0,0 +1,10 @@ +/* Make sure that vector of size 8 of signed char works. This used to crash with AVX on x86 + as we would produce try to extract the chars inside the vector mode using the vector mode of V8SI + which was wrong. */ +__attribute__ ((vector_size (8))) signed char v4, v5, v6; +void +two (void) +{ + v4 = v5 + v6; +} + diff --git a/gcc/testsuite/gcc.c-torture/execute/pr37125.c b/gcc/testsuite/gcc.c-torture/execute/pr37125.c new file mode 100644 index 00000000000..f29209eb7aa --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr37125.c @@ -0,0 +1,23 @@ +extern void abort (void); + +static inline unsigned int +mod_rhs(int rhs) +{ + if (rhs == 0) return 1; + return rhs; +} + +void func_44 (unsigned int p_45); +void func_44 (unsigned int p_45) +{ + if (!((p_45 * -9) % mod_rhs (-9))) { + abort(); + } +} + +int main (void) +{ + func_44 (2); + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/20011008-1.c b/gcc/testsuite/gcc.dg/20011008-1.c index e5c9e2cf0ee..e3991471a9f 100644 --- a/gcc/testsuite/gcc.dg/20011008-1.c +++ b/gcc/testsuite/gcc.dg/20011008-1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O0" } */ +/* { dg-options "-O0 -fshow-column" } */ -struct { int; int q; } a; /* { dg-warning "does not declare anything" } */ +struct { int; int q; } a; /* { dg-warning "13:does not declare anything" } */ struct { union {int x;}; int q; } b; struct { struct {int x;}; int q; } c; union { union {int x;}; int q; } d; diff --git a/gcc/testsuite/gcc.dg/20080410-1.c b/gcc/testsuite/gcc.dg/20080410-1.c new file mode 100644 index 00000000000..ebd783dd05d --- /dev/null +++ b/gcc/testsuite/gcc.dg/20080410-1.c @@ -0,0 +1,28 @@ +/* { dg-do compile { target "sh-*-*" } } */ +/* { dg-options "-O0 -m4 -ml -fira" } */ +/* { dg-final { scan-assembler-not "add\tr0,r0" } } */ + +/* This test checks that chain reloads conflict. I they don't + conflict, the same hard register R0 is used for the both reloads + but in this case the second reload needs an intermediate register + (which is the reload register). As the result we have the + following code + + mov #4,r0 -- first reload + mov r14,r0 -- second reload + add r0,r0 -- second reload + + The right code should be + + mov #4,r0 -- first reload + mov r14,r1 -- second reload + add r0,r1 -- second reload + +*/ + +_Complex float foo_float (); + +void bar_float () +{ + __real foo_float (); +} diff --git a/gcc/testsuite/gcc.dg/20080820.c b/gcc/testsuite/gcc.dg/20080820.c new file mode 100644 index 00000000000..b9dd8a7c897 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20080820.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-fshow-column -fms-extensions -pedantic" } */ + +struct { struct a { int x; }; int bar; } hot; /* { dg-warning "29:ISO C doesn't support unnamed" } */ diff --git a/gcc/testsuite/gcc.dg/Wconversion-pr34389.c b/gcc/testsuite/gcc.dg/Wconversion-pr34389.c index 45cdf19ef71..1a433680260 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-pr34389.c +++ b/gcc/testsuite/gcc.dg/Wconversion-pr34389.c @@ -1,6 +1,7 @@ /* PR 34389 */ /* { dg-do compile } */ /* { dg-options "-Wconversion -Wsign-conversion" } */ +/* { dg-require-effective-target int32plus } */ short mask1(short x) { @@ -32,7 +33,8 @@ short mask3(int si, unsigned int ui) us = si & 0x7fff; us = si & 0xAAAA; /* { dg-warning "conversion" } */ us = ui & 0x7fff; - us = ui & 0xAAAA; /* { dg-warning "conversion" } */ + us = ui & 0xAAAA; /* 0xAAAA is zero-extended, thus it masks the + upper bits of 'ui' making it fit in 'us'. */ return ss; } diff --git a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c index 1c03ba487e3..1625fc03581 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c +++ b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c @@ -4,7 +4,7 @@ /* { dg-do compile } /* { dg-skip-if "doubles are floats,ints are 16bits" { "avr-*-*" } { "*" } { "" } } */ /* { dg-options "-std=c99 -Wconversion" } */ - +/* { dg-require-effective-target int32plus } */ #include <limits.h> void fsi (signed int x); @@ -71,4 +71,42 @@ void h (void) } +void fss (signed short x); +void fus (unsigned short x); +void fsc (signed char x); +void fuc (unsigned char x); + +void h2 (void) +{ + unsigned short int us; + short int ss; + unsigned char uc; + signed char sc; + + fss (4294967294.0); /* { dg-warning "conversion" } */ + ss = 4294967294.0; /* { dg-warning "conversion" } */ + fss (-4294967294.0); /* { dg-warning "conversion" } */ + ss = -4294967294.0; /* { dg-warning "conversion" } */ + fus (4294967294.0); /* { dg-warning "conversion" } */ + us = 4294967294.0; /* { dg-warning "conversion" } */ + fus (-4294967294.0); /* { dg-warning "conversion" } */ + us = -4294967294.0; /* { dg-warning "conversion" } */ + fsc (500.0); /* { dg-warning "conversion" } */ + sc = 500.0; /* { dg-warning "conversion" } */ + fsc (-500.0); /* { dg-warning "conversion" } */ + sc = -500.0; /* { dg-warning "conversion" } */ + fuc (500.0); /* { dg-warning "conversion" } */ + uc = 500.0; /* { dg-warning "conversion" } */ + fuc (-500.0); /* { dg-warning "conversion" } */ + uc = -500.0; /* { dg-warning "conversion" } */ + + fss (500.0); + ss = 500.0; + fss (-500.0); + ss = -500.0; + fus (500.0); + us = 500.0; + fus (-500.0); /* { dg-warning "conversion" } */ + us = -500.0; /* { dg-warning "conversion" } */ +} diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c index e72d37a18ce..302d50e5cf1 100644 --- a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c @@ -2,7 +2,8 @@ /* { dg-options "-Wall" } */ -void foo(unsigned long* ulp); +void foo(unsigned long* ulp); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 5 } */ + void bar(long* lp) { foo(lp); /* { dg-warning "differ in signedness" } */ diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c index 25e25209e52..8b92110988d 100644 --- a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c +++ b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c @@ -2,7 +2,7 @@ /* { dg-options "-pedantic" } */ -void foo(unsigned long* ulp); +void foo(unsigned long* ulp);/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */ void bar(long* lp) { foo(lp); /* { dg-warning "differ in signedness" } */ diff --git a/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c b/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c new file mode 100644 index 00000000000..63aecd0f3ed --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c @@ -0,0 +1,24 @@ +/* PR 18050 : bogus warning with -Wsequence-point */ +/* { dg-do compile } */ +/* { dg-options "-Wsequence-point" } */ + +struct x +{ + int i; +}; +void bar(struct x*, int *); + +void foo(struct x *y) +{ + bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */ +} + +void zz(int a, int *b) +{ + *b = a; +} + +void baz(void) { + int a = 5; + zz(++a, &a); /* { dg-bogus "operation on 'a' may be undefined" } */ +} diff --git a/gcc/testsuite/gcc.dg/assign-warn-1.c b/gcc/testsuite/gcc.dg/assign-warn-1.c index 1587c20d7b4..4c603829d59 100644 --- a/gcc/testsuite/gcc.dg/assign-warn-1.c +++ b/gcc/testsuite/gcc.dg/assign-warn-1.c @@ -121,3 +121,6 @@ TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 o TESTASS(istrc, int, struct s); /* { dg-error "incompatible types in assignment" } */ TESTINI(istrd, int, struct s); /* { dg-error "incompatible types in initialization" } */ TESTRET(istre, int, struct s); /* { dg-error "incompatible types in return" } */ + +/* Match all extra informative notes. */ +/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/assign-warn-2.c b/gcc/testsuite/gcc.dg/assign-warn-2.c index 0ef6ebe33b3..4656961f6c4 100644 --- a/gcc/testsuite/gcc.dg/assign-warn-2.c +++ b/gcc/testsuite/gcc.dg/assign-warn-2.c @@ -122,3 +122,4 @@ TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 o TESTASS(istrc, int, struct s); /* { dg-error "incompatible types in assignment" } */ TESTINI(istrd, int, struct s); /* { dg-error "incompatible types in initialization" } */ TESTRET(istre, int, struct s); /* { dg-error "incompatible types in return" } */ +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1.c b/gcc/testsuite/gcc.dg/autopar/reduc-1.c index c7f53e1e50d..ac08d3d2e47 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-1.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-1.c @@ -7,13 +7,14 @@ #define N 16 #define DIFF 242 +unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + /* Reduction of unsigned-int. */ void main1 (unsigned int x, unsigned int max_result, unsigned int min_result) { int i; - unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned int udiff = 2; unsigned int umax = x; unsigned int umin = x; diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1char.c b/gcc/testsuite/gcc.dg/autopar/reduc-1char.c index 87f758a4e46..228e97995a7 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-1char.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-1char.c @@ -7,12 +7,13 @@ #define N 16 #define DIFF 242 +unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (unsigned char x, unsigned char max_result, unsigned char min_result) { int i; - unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char udiff = 2; unsigned char umax = x; unsigned char umin = x; diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-1short.c b/gcc/testsuite/gcc.dg/autopar/reduc-1short.c index 75d09544f8c..45d96fdc926 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-1short.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-1short.c @@ -7,13 +7,14 @@ #define N 16 #define DIFF 242 +unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (unsigned short x, unsigned short max_result, unsigned short min_result) { int i; - unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - unsigned short udiff = 2; + unsigned short udiff = 2; unsigned short umax = x; unsigned short umin = x; diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2.c b/gcc/testsuite/gcc.dg/autopar/reduc-2.c index d462f894f2e..684094d6319 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-2.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-2.c @@ -7,14 +7,15 @@ #define N 16 #define DIFF 240 +int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + /* Reduction of signed-int. */ __attribute__ ((noinline)) void main1 (int x, int max_result, int min_result) { int i; - int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; int diff = 0; int max = x; int min = x; diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2char.c b/gcc/testsuite/gcc.dg/autopar/reduc-2char.c index 15acb3bcc9a..78e5b13aca2 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-2char.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-2char.c @@ -7,12 +7,13 @@ #define N 16 #define DIFF 121 +signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30}; +signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (signed char x, signed char max_result, signed char min_result) { int i; - signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30}; - signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; signed char diff = 2; signed char max = x; signed char min = x; diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-2short.c b/gcc/testsuite/gcc.dg/autopar/reduc-2short.c index f98402ee251..cef179b7f53 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-2short.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-2short.c @@ -7,12 +7,13 @@ #define N 16 #define DIFF 242 +short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (short x, short max_result, short min_result) { int i; - short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; short diff = 2; short max = x; short min = x; diff --git a/gcc/testsuite/gcc.dg/autopar/reduc-3.c b/gcc/testsuite/gcc.dg/autopar/reduc-3.c index 31ed2bc11c2..97501c61584 100644 --- a/gcc/testsuite/gcc.dg/autopar/reduc-3.c +++ b/gcc/testsuite/gcc.dg/autopar/reduc-3.c @@ -6,14 +6,15 @@ #define N 16 +unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + /* Reduction of unsigned-int. */ __attribute__ ((noinline)) int main1 (int n, int res) { int i; - unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned int udiff; udiff = 0; diff --git a/gcc/testsuite/gcc.dg/c90-fordecl-1.c b/gcc/testsuite/gcc.dg/c90-fordecl-1.c index 8e48dd61752..4aa3c583022 100644 --- a/gcc/testsuite/gcc.dg/c90-fordecl-1.c +++ b/gcc/testsuite/gcc.dg/c90-fordecl-1.c @@ -9,5 +9,6 @@ foo (void) int j = 0; for (int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */ j += i; - /* { dg-error "parse|decl" "declaration in for loop" { target *-*-* } 10 } */ + /* { dg-error "'for' loop initial declarations are only allowed in C99 mode" "declaration in for loop" { target *-*-* } 10 } */ + /* { dg-message "note: use option -std=c99 or -std=gnu99 to compile your code" "note" { target *-*-* } 10 }} */ } diff --git a/gcc/testsuite/gcc.dg/cleanup-1.c b/gcc/testsuite/gcc.dg/cleanup-1.c index e5853c4baa8..dd571635baf 100644 --- a/gcc/testsuite/gcc.dg/cleanup-1.c +++ b/gcc/testsuite/gcc.dg/cleanup-1.c @@ -10,10 +10,10 @@ static void f2() { } static void f3(void) { } static void f4(void *x U) { } static void f5(int *x U) { } -static void f6(double *x U) { } +static void f6(double *x U) { } /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */ static void f7(const int *x U) { } static void f8(const int *x U, int y U) { } -static void f9(int x U) { } +static void f9(int x U) { } /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */ void test(void) { diff --git a/gcc/testsuite/gcc.dg/compat/vector-1b_main.c b/gcc/testsuite/gcc.dg/compat/vector-1b_main.c new file mode 100644 index 00000000000..fb5a5a93d79 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-1b_main.c @@ -0,0 +1,27 @@ +/* { dg-skip-if "test AVX vector" { ! { i?86-*-* x86_64-*-* } } } */ +/* { dg-require-effective-target avx } */ + +/* Test compatibility of vector types: layout between separately-compiled + modules, parameter passing, and function return. This test uses + vectors of integer values. */ + +#include "cpuid.h" + +extern void vector_1_x (void); +extern void exit (int); +int fails; + +int +main () +{ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run AVX vector test only if host has AVX support. */ + if (ecx & bit_AVX) + vector_1_x (); + + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/compat/vector-1b_x.c b/gcc/testsuite/gcc.dg/compat/vector-1b_x.c new file mode 100644 index 00000000000..fe2565cc65a --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-1b_x.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -mavx" } */ + +#include "vector-1_x.c" diff --git a/gcc/testsuite/gcc.dg/compat/vector-1b_y.c b/gcc/testsuite/gcc.dg/compat/vector-1b_y.c new file mode 100644 index 00000000000..3212bf55d35 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-1b_y.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -mavx" } */ + +#include "vector-1_y.c" diff --git a/gcc/testsuite/gcc.dg/compat/vector-2b_main.c b/gcc/testsuite/gcc.dg/compat/vector-2b_main.c new file mode 100644 index 00000000000..c5a9300c8ac --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-2b_main.c @@ -0,0 +1,27 @@ +/* { dg-skip-if "test AVX support" { ! { i?86-*-* x86_64-*-* } } } */ +/* { dg-require-effective-target avx } */ + +/* Test compatibility of vector types: layout between separately-compiled + modules, parameter passing, and function return. This test uses + vectors of floating points values. */ + +#include "cpuid.h" + +extern void vector_2_x (void); +extern void exit (int); +int fails; + +int +main () +{ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run AVX vector test only if host has AVX support. */ + if (ecx & bit_AVX) + vector_2_x (); + + exit (0); +} diff --git a/gcc/testsuite/gcc.dg/compat/vector-2b_x.c b/gcc/testsuite/gcc.dg/compat/vector-2b_x.c new file mode 100644 index 00000000000..4dd343615e3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-2b_x.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -mavx" } */ + +#include "vector-2_x.c" diff --git a/gcc/testsuite/gcc.dg/compat/vector-2b_y.c b/gcc/testsuite/gcc.dg/compat/vector-2b_y.c new file mode 100644 index 00000000000..2820e0badf4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/vector-2b_y.c @@ -0,0 +1,3 @@ +/* { dg-options "-w -mno-mmx -mavx" } */ + +#include "vector-2_y.c" diff --git a/gcc/testsuite/gcc.dg/conv-2.c b/gcc/testsuite/gcc.dg/conv-2.c index ac95584e3a6..388dee3d746 100644 --- a/gcc/testsuite/gcc.dg/conv-2.c +++ b/gcc/testsuite/gcc.dg/conv-2.c @@ -1,8 +1,8 @@ /* { dg-do compile } */ /* { dg-options "-Wpointer-sign" } */ -void f1(long *); -void f2(unsigned long *); +void f1(long *); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */ +void f2(unsigned long *); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */ int main() { diff --git a/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc/testsuite/gcc.dg/cpp/cpp.exp index acf0898407b..1dc504e30ba 100644 --- a/gcc/testsuite/gcc.dg/cpp/cpp.exp +++ b/gcc/testsuite/gcc.dg/cpp/cpp.exp @@ -37,7 +37,7 @@ dg-init # Main loop. dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \ - "" $DEFAULT_CFLAGS + "-fno-show-column" $DEFAULT_CFLAGS # All done. dg-finish diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-2.c b/gcc/testsuite/gcc.dg/cpp/pr7263-2.c new file mode 100644 index 00000000000..5ed10d0202a --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr7263-2.c @@ -0,0 +1,28 @@ +/* PR 7263: __extension__ keyword doesn't suppress warning on LL or ULL constants. */ +/* { dg-do compile } */ +/* { dg-options "-std=c89 -pedantic-errors" } */ +#include "pr7263-2.h" +unsigned long long /* { dg-error "ISO C90 does not support .long long." } */ +bar () +{ + return BIG_EXT; +} + +unsigned long long /* { dg-error "ISO C90 does not support .long long." } */ +bar2 () +{ + return 0x1b27da572ef3cd86ULL; /* { dg-error "use of C99 long long integer constant" } */ +} + + +unsigned long long /* { dg-error "ISO C90 does not support .long long." } */ +bar3 () +{ + return __extension__ (0x1b27da572ef3cd86ULL); +} + +__extension__ unsigned long long +bar4 () +{ + return BIG; +} diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-2.h b/gcc/testsuite/gcc.dg/cpp/pr7263-2.h new file mode 100644 index 00000000000..54f1757c5e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr7263-2.h @@ -0,0 +1,4 @@ +#define BIG_EXT __extension__(0x1b27da572ef3cd86ULL) + +#define BIG 0x1b27da572ef3cd86ULL + diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-3.c b/gcc/testsuite/gcc.dg/cpp/pr7263-3.c new file mode 100644 index 00000000000..efa619ad3cd --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr7263-3.c @@ -0,0 +1,19 @@ +/* PR 7263: __extension__ keyword doesn't suppress warning on LL or ULL constants. */ +/* { dg-do compile } */ +/* { dg-options "-std=c99 -pedantic-errors" } */ +#include "pr7263-3.h" +__complex__ bar () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */ +{ + return _Complex_I_ext; +} + +__extension__ __complex__ +bar2 () +{ + return _Complex_I; +} + +__complex__ bar3 () /* { dg-error "ISO C does not support plain .complex. meaning .double complex." } */ +{ + return _Complex_I; /* { dg-error "imaginary constants are a GCC extension" } */ +} diff --git a/gcc/testsuite/gcc.dg/cpp/pr7263-3.h b/gcc/testsuite/gcc.dg/cpp/pr7263-3.h new file mode 100644 index 00000000000..ad6690e2b86 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr7263-3.h @@ -0,0 +1,3 @@ +#define _Complex_I_ext (__extension__ 1.0iF) + +#define _Complex_I (1.0iF) diff --git a/gcc/testsuite/gcc.dg/cpp/trad/trad.exp b/gcc/testsuite/gcc.dg/cpp/trad/trad.exp index 190cfcfdee6..22225e51915 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/trad.exp +++ b/gcc/testsuite/gcc.dg/cpp/trad/trad.exp @@ -37,7 +37,7 @@ dg-init # Main loop. dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ - "" $DEFAULT_TRADCPPFLAGS + "-fno-show-column" $DEFAULT_TRADCPPFLAGS # All done. dg-finish diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c index 56991add7f3..b2e7632e62a 100644 --- a/gcc/testsuite/gcc.dg/dfp/composite-type.c +++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c @@ -33,8 +33,16 @@ do \ } while(0) DECIMAL_COMPOSITE_DECL(32); /* { dg-error "incompatible types in assignment" } */ +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 35 } */ + + DECIMAL_COMPOSITE_DECL(64); /* { dg-error "incompatible types in assignment" } */ +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 39 } */ + + DECIMAL_COMPOSITE_DECL(128); /* { dg-error "incompatible types in assignment" } */ +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 43 } */ + int main() { diff --git a/gcc/testsuite/gcc.dg/fltconst-1.c b/gcc/testsuite/gcc.dg/fltconst-1.c index bf922270644..85e1d34a583 100644 --- a/gcc/testsuite/gcc.dg/fltconst-1.c +++ b/gcc/testsuite/gcc.dg/fltconst-1.c @@ -1,16 +1,16 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99" } */ -double a = 1.ld; /* { dg-error "invalid suffix" } */ -double b = 1.fd; /* { dg-error "invalid suffix" } */ -double c = 1.di; /* { dg-error "invalid suffix" } */ -double d = 1.dj; /* { dg-error "invalid suffix" } */ -double e = 1.id; /* { dg-error "invalid suffix" } */ -double f = 1.jd; /* { dg-error "invalid suffix" } */ -double g = 1.ddd; /* { dg-error "invalid suffix" } */ -double h = 1.ldd; /* { dg-error "invalid suffix" } */ -double i = 1.dld; /* { dg-error "invalid suffix" } */ -double j = 1.ddl; /* { dg-error "invalid suffix" } */ -double k = 1.fdd; /* { dg-error "invalid suffix" } */ -double l = 1.dfd; /* { dg-error "invalid suffix" } */ -double m = 1.ddf; /* { dg-error "invalid suffix" } */ +double a = 1.ld; /* { dg-error "12:invalid suffix" } */ +double b = 1.fd; /* { dg-error "12:invalid suffix" } */ +double c = 1.di; /* { dg-error "12:invalid suffix" } */ +double d = 1.dj; /* { dg-error "12:invalid suffix" } */ +double e = 1.id; /* { dg-error "12:invalid suffix" } */ +double f = 1.jd; /* { dg-error "12:invalid suffix" } */ +double g = 1.ddd; /* { dg-error "12:invalid suffix" } */ +double h = 1.ldd; /* { dg-error "12:invalid suffix" } */ +double i = 1.dld; /* { dg-error "12:invalid suffix" } */ +double j = 1.ddl; /* { dg-error "12:invalid suffix" } */ +double k = 1.fdd; /* { dg-error "12:invalid suffix" } */ +double l = 1.dfd; /* { dg-error "12:invalid suffix" } */ +double m = 1.ddf; /* { dg-error "12:invalid suffix" } */ diff --git a/gcc/testsuite/gcc.dg/fold-alloca-1.c b/gcc/testsuite/gcc.dg/fold-alloca-1.c index c4645364701..93f28cfa1ae 100644 --- a/gcc/testsuite/gcc.dg/fold-alloca-1.c +++ b/gcc/testsuite/gcc.dg/fold-alloca-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-cleanup_cfg1" } */ +/* { dg-options "-fdump-tree-cfg" } */ void *alloca (__SIZE_TYPE__); void link_error (); @@ -10,5 +10,5 @@ int main (int argc, char *argv[]) { link_error (); return 0; } -/* { dg-final { scan-tree-dump-times "link_error" 0 "cleanup_cfg1" } } */ -/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "cfg" } } */ +/* { dg-final { cleanup-tree-dump "cfg" } } */ diff --git a/gcc/testsuite/gcc.dg/fold-compare-3.c b/gcc/testsuite/gcc.dg/fold-compare-3.c index 011bf47bd6e..d38a945aeec 100644 --- a/gcc/testsuite/gcc.dg/fold-compare-3.c +++ b/gcc/testsuite/gcc.dg/fold-compare-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cleanup_cfg1" } */ +/* { dg-options "-O2 -fdump-tree-cfg" } */ #include <limits.h> @@ -151,9 +151,9 @@ void bla4ge (int var) this_comparison_is_not_decidable (); } -/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cleanup_cfg1" } } */ -/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cleanup_cfg1" } } */ -/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cleanup_cfg1" } } */ -/* { dg-final { scan-tree-dump-times "if " 12 "cleanup_cfg1" } } */ +/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cfg" } } */ +/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cfg" } } */ +/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cfg" } } */ +/* { dg-final { scan-tree-dump-times "if " 12 "cfg" } } */ -/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */ +/* { dg-final { cleanup-tree-dump "cfg" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/iinline-1.c b/gcc/testsuite/gcc.dg/ipa/iinline-1.c index da548f46648..9f0ad68e9fa 100644 --- a/gcc/testsuite/gcc.dg/ipa/iinline-1.c +++ b/gcc/testsuite/gcc.dg/ipa/iinline-1.c @@ -23,4 +23,4 @@ int main (int argc, int *argv[]) } /* { dg-final { scan-ipa-dump "hooray\[^\\n\]*inline copy in main" "inline" } } */ -/* { dg-final { cleanup-tree-dump "inline" } } */ +/* { dg-final { cleanup-ipa-dump "inline" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-1.c index 65fd7b8ba71..76ef9a643d6 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-1.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ #include <stdio.h> @@ -23,7 +23,8 @@ int main () /* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "replacing param with const" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-2.c index 281c457eb36..454927a2c19 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-2.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ #include <stdio.h> @@ -21,5 +21,6 @@ int main () /* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "replacing param with const" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-3.c index 9487aae7f3b..c476b925050 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-3.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ @@ -25,5 +25,7 @@ int main () /* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "replacing param with const" 3 "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-4.c index 55599a24048..9f716f13936 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-4.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp" } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp" } */ /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ #include <stdio.h> @@ -24,5 +24,5 @@ int main () /* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "replacing param with const" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-5.c index b5106d95343..9352e19ab65 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-5.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ /* Float & short constants. */ @@ -23,5 +23,6 @@ int main () /* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "replacing param with const" 2 "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */ +/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc/testsuite/gcc.dg/ipa/ipa-7.c index 60fc9c0b06f..1c4a1709df6 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-7.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */ /* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */ #include <stdio.h> @@ -25,7 +25,7 @@ int main () /* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */ -/* { dg-final { scan-ipa-dump-times "propagating const" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-1.c b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c new file mode 100644 index 00000000000..ac013a72350 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipacost-1.c @@ -0,0 +1,58 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -fipa-cp -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */ + +int array[100]; + +int t(int); + +static int +i_can_be_propagated_fully (int *a) +{ + int i; + for (i=0;i<50;i++) + { + t(a[i]); + t(a[i+1]); + t(a[i+2]); + t(a[i+3]); + } +} +static int +i_can_be_propagated_fully2 (int *a) +{ + i_can_be_propagated_fully (a); + i_can_be_propagated_fully (a); + i_can_be_propagated_fully (a); +} +static int +i_can_not_be_propagated_fully (int *a) +{ + int i; + for (i=0;i<50;i++) + { + t(a[i]); + t(a[i+1]); + t(a[i+2]); + t(a[i+3]); + } +} +int +i_can_not_be_propagated_fully2 (int *a) +{ + i_can_not_be_propagated_fully (a); + i_can_not_be_propagated_fully (a); + i_can_not_be_propagated_fully (a); +} +main() +{ + i_can_be_propagated_fully2 (array); + i_can_not_be_propagated_fully2 (array); +} + +/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully2" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully2" "cp" } } */ +/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully " "cp" } } */ +/* { dg-final { scan-tree-dump-not "i_can_be_propagated" "optimized" } } */ +/* { dg-final { cleanup-ipa-dump "cp" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c new file mode 100644 index 00000000000..c2861baa369 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c @@ -0,0 +1,59 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */ + +int array[100]; + +int t(int); + +static int +i_can_be_propagated_fully (int *a) +{ + int i; + for (i=0;i<50;i++) + { + t(a[i]); + t(a[i+1]); + t(a[i+2]); + t(a[i+3]); + } +} +static int +i_can_be_propagated_fully2 (int *a) +{ + i_can_be_propagated_fully (a); + i_can_be_propagated_fully (a); + i_can_be_propagated_fully (a); +} +static int +i_can_not_be_propagated_fully (int *a) +{ + int i; + for (i=0;i<50;i++) + { + t(a[i]); + t(a[i+1]); + t(a[i+2]); + t(a[i+3]); + } +} +int +i_can_not_be_propagated_fully2 (int *a) +{ + i_can_not_be_propagated_fully (a); + i_can_not_be_propagated_fully (a); + i_can_not_be_propagated_fully (a); +} +main() +{ + i_can_be_propagated_fully2 (array); + i_can_not_be_propagated_fully2 (array); +} + +/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully2" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "versioned function i_can_not_be_propagated_fully2" 1 "cp" } } */ +/* { dg-final { scan-ipa-dump-times "versioned function i_can_not_be_propagated_fully " 1 "cp" } } */ +/* { dg-final { scan-tree-dump-not "i_can_be_propagated" "optimized" } } */ +/* { dg-final { scan-tree-dump-not "i_can_be_propagated" "optimized" } } */ +/* { dg-final { cleanup-ipa-dump "cp" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/modif-1.c b/gcc/testsuite/gcc.dg/ipa/modif-1.c index 7d160cb7e74..bc1706c5650 100644 --- a/gcc/testsuite/gcc.dg/ipa/modif-1.c +++ b/gcc/testsuite/gcc.dg/ipa/modif-1.c @@ -1,6 +1,6 @@ /* Verify that modification analysis detects modfications. */ /* { dg-do compile } */ -/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */ +/* { dg-options "-O3 -c -fdump-ipa-inline-details -fno-early-inlining" } */ struct whatever { @@ -33,12 +33,12 @@ void the_test (struct whatever u, struct whatever v, func4 (&l); } -/* { dg-final { scan-ipa-dump-not "param 0 flags:\[^\\n\]*modified" "inline" } } */ -/* { dg-final { scan-ipa-dump "param 1 flags:\[^\\n\]*modified" "inline" } } */ -/* { dg-final { scan-ipa-dump "param 2 flags:\[^\\n\]*modified" "inline" } } */ -/* { dg-final { scan-ipa-dump "param 3 flags:\[^\\n\]*modified" "inline" } } */ -/* { dg-final { scan-ipa-dump-not "param 4 flags:\[^\\n\]*modified" "inline" } } */ -/* { dg-final { scan-ipa-dump "param 5 flags:\[^\\n\]*modified" "inline" } } */ -/* { dg-final { scan-ipa-dump "param 6 flags:\[^\\n\]*modified" "inline" } } */ -/* { dg-final { scan-ipa-dump "param 7 flags:\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump-not "param 0\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump "param 1\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump "param 2\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump "param 3\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump-not "param 4\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump "param 5\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump "param 6\[^\\n\]*modified" "inline" } } */ +/* { dg-final { scan-ipa-dump "param 7\[^\\n\]*modified" "inline" } } */ /* { dg-final { cleanup-ipa-dump "inline" } } */ diff --git a/gcc/testsuite/gcc.dg/noncompile/20020213-1.c b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c index c1de5663ace..41480f0794d 100644 --- a/gcc/testsuite/gcc.dg/noncompile/20020213-1.c +++ b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c @@ -25,7 +25,10 @@ int main () } /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 15 } */ +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */ /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 16 } */ /* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 16 } */ /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 18 } */ +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 6 } */ /* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 20 } */ +/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 7 } */ diff --git a/gcc/testsuite/gcc.dg/pr17506.c b/gcc/testsuite/gcc.dg/pr17506.c deleted file mode 100644 index 7cca74613e7..00000000000 --- a/gcc/testsuite/gcc.dg/pr17506.c +++ /dev/null @@ -1,24 +0,0 @@ -/* PR tree-optimization/17506 - We issue an uninitialized variable warning at a wrong location at - line 11, which is very confusing. Make sure we print out a note to - make it less confusing. */ -/* { dg-do compile } */ -/* { dg-options "-O1 -Wuninitialized" } */ - -inline int -foo (int i) -{ - if (i) /* { dg-warning "used uninitialized in this function" } */ - return 1; - return 0; -} - -void baz (void); - -void -bar (void) -{ - int j; /* { dg-message "note: 'j' was declared here" } */ - for (; foo (j); ++j) - baz (); -} diff --git a/gcc/testsuite/gcc.dg/pr30457.c b/gcc/testsuite/gcc.dg/pr30457.c new file mode 100644 index 00000000000..f52332d0a1e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr30457.c @@ -0,0 +1,26 @@ +/* PR 30457 warn about va_start(ap, invalid) */ +/* { dg-do compile } */ +/* { dg-options "-std=c99" } */ + +/* Undefined by C99 7.15.1.4p4 (va_start): + "If the parameter parmN is declared with the register storage + class, with a function or array type, or with a type that is + not compatible with the type that results after application of + the default argument promotions, the behavior is undefined." */ + +#include <stdarg.h> + +void foo(register short paramN, ...) +{ + va_list ap; + + va_start(ap, paramN); /* { dg-warning "undefined behaviour when second parameter of 'va_start' is declared with 'register' storage" } */ + + /* Undefined by C99 7.15.1.1p2: */ + (void) va_arg(ap, char); /* { dg-warning "'char' is promoted to 'int' when passed through '...'" } */ + /* { dg-message "note: .so you should pass .int. not .char. to .va_arg.." "" { target *-*-* } 20 } */ + /* { dg-message "note: if this code is reached, the program will abort" "" { target *-*-* } 20 } */ + + va_end(ap); +} + diff --git a/gcc/testsuite/gcc.dg/pr30949.c b/gcc/testsuite/gcc.dg/pr30949.c new file mode 100644 index 00000000000..a3f6a14132c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr30949.c @@ -0,0 +1,11 @@ +/* PR30949 */ +/* { dg-do compile } */ +/* { dg-options "-pedantic-errors" } */ + +int func (int x); +void recv (int (* funcptr) (double x)); /* { dg-message "note: expected 'int .\\\*..double.' but argument is of type 'int .\\\*..int.'" } */ +void call (void) +{ + recv (func); /* { dg-error "passing argument 1 of 'recv' from incompatible pointer type" } */ +} + diff --git a/gcc/testsuite/gcc.dg/pr35701.c b/gcc/testsuite/gcc.dg/pr35701.c new file mode 100644 index 00000000000..4144430977d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr35701.c @@ -0,0 +1,31 @@ +/* PR 35701 */ +/* { dg-do compile } */ +/* { dg-options "-Wconversion -Wsign-conversion" } */ +/* { dg-require-effective-target int32plus } */ + +typedef struct _my_struct_t { + unsigned int small:1; + unsigned int big:31; +} my_struct_t, *my_struct_p_t; + +void +my_func1(unsigned int sm, unsigned int bi, my_struct_p_t msp) +{ + msp->small = sm; /* { dg-warning "conversion" } */ + msp->big = bi; /* { dg-warning "conversion" } */ +} + +void +my_func2(unsigned int sm, unsigned int bi, my_struct_p_t msp) +{ + msp->small = sm & 1U; + msp->big = bi & 0x7fffffffU; +} + +unsigned short +my_func3(unsigned int sm) +{ + unsigned short res; + res = sm & 0xff20U; + return res; +} diff --git a/gcc/testsuite/gcc.dg/pr36997.c b/gcc/testsuite/gcc.dg/pr36997.c index 34ee54a6827..b7b892d8176 100644 --- a/gcc/testsuite/gcc.dg/pr36997.c +++ b/gcc/testsuite/gcc.dg/pr36997.c @@ -1,5 +1,5 @@ /* { dg-do compile { target x86_64-*-* i?86-*-* } } */ -/* { dg-options "-std=c99" } */ +/* { dg-options "-std=c99 -msse2" } */ typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); __m64 _mm_add_si64 (__m64 __m1, __m64 __m2) diff --git a/gcc/testsuite/gcc.dg/pr37156.c b/gcc/testsuite/gcc.dg/pr37156.c new file mode 100644 index 00000000000..e86f5950f73 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37156.c @@ -0,0 +1,21 @@ +/* PR debug/37156 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ + +__attribute__ ((warning ("is experimental"))) int bar (int, int *, int *, int); + +long long foo (void) +{ + int n, m; + long long r; + bar (0, &n, &m, 0); /* { dg-warning "is experimental" } */ + r = (long long) n; + return r; +} + +void +baz (int n) +{ + int o; + o = foo () - n; +} diff --git a/gcc/testsuite/gcc.dg/pr37171.c b/gcc/testsuite/gcc.dg/pr37171.c new file mode 100644 index 00000000000..9be44dfaffd --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37171.c @@ -0,0 +1,19 @@ +/* PR c/37171 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +unsigned int f1 (void) __attribute__((const)); +unsigned int f2 (void) __attribute__((__const)); +unsigned int f3 (void) __attribute__((__const__)); + +unsigned int f4 (void) +{ + return f1 () + f1 () + f1 () + f1 () + + f2 () + f2 () + f2 () + f2 () + + f3 () + f3 () + f3 () + f3 (); +} + +/* { dg-final { scan-tree-dump-times "= f1 \\(\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= f2 \\(\\)" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "= f3 \\(\\)" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/pr37186.c b/gcc/testsuite/gcc.dg/pr37186.c new file mode 100644 index 00000000000..7fa52ffe83d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37186.c @@ -0,0 +1,9 @@ +/* PR 37186 */ +/* { dg-do compile } */ +/* { dg-options "-Wall -Werror -Wno-error=pointer-sign" } */ + +int foo(signed char *); +int bar(unsigned char *p) +{ + return foo(p); /* { dg-warning "pointer targets in passing argument 1 of 'foo' differ in signedness" } */ +} diff --git a/gcc/testsuite/gcc.dg/pr37217.c b/gcc/testsuite/gcc.dg/pr37217.c new file mode 100644 index 00000000000..989eda2cd88 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37217.c @@ -0,0 +1,10 @@ +/* PR 37217 ICE with -Wconversion */ +/* { dg-do compile } */ +/* { dg-options "-Wconversion" } */ +typedef struct Tcl_ResolvedVarInfo { + char *re_guts; +} regex_t; +void TclReComp(regex_t *re) +{ + if (re->re_guts == ((void *)0)) ; +} diff --git a/gcc/testsuite/gcc.dg/pr37261.c b/gcc/testsuite/gcc.dg/pr37261.c new file mode 100644 index 00000000000..a05ada148c1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr37261.c @@ -0,0 +1,15 @@ +/* PR c/37261 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +unsigned +foo (int x) +{ + unsigned a = ((x & 1) | 2) & 0x80000000; /* { dg-bogus "integer overflow in expression" } */ + unsigned b = ((x & 2) | 2) & 0x80000000; /* { dg-bogus "integer overflow in expression" } */ + unsigned c = ((x & 4) | 2) & 0x80000000; /* { dg-bogus "integer overflow in expression" } */ + return a + b + c; +} + +/* { dg-final { scan-tree-dump "return 0" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c index ca5a4f8b6d7..7fca1df7adf 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float.c @@ -2,7 +2,6 @@ /* Origin: Joseph Myers <joseph@codesourcery.com> */ /* { dg-do run } */ /* { dg-options "" } */ -/* { dg-skip-if "Round to zero" { spu-*-* } } */ #include <float.h> #include "fp-int-convert.h" diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c index faeae6050d1..2b27153044c 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode.c @@ -9,10 +9,7 @@ int main (void) { -#ifndef __SPU__ - /* Single-precision floating point on SPU always rounds to zero. */ TEST_I_F(TItype, UTItype, float, FLT_MANT_DIG); -#endif TEST_I_F(TItype, UTItype, double, DBL_MANT_DIG); /* Disable the long double tests when using IBM Extended Doubles. They have variable precision, but constants calculated by gcc's diff --git a/gcc/testsuite/gcc.dg/transparent-union-1.c b/gcc/testsuite/gcc.dg/transparent-union-1.c index a43e07953d3..2360912e3c5 100644 --- a/gcc/testsuite/gcc.dg/transparent-union-1.c +++ b/gcc/testsuite/gcc.dg/transparent-union-1.c @@ -81,3 +81,5 @@ main (void) f13 (&l); return 0; } + +/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c b/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c index ac54ab13851..2139972ce8b 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c +++ b/gcc/testsuite/gcc.dg/tree-prof/ic-misattribution-1a.c @@ -18,3 +18,5 @@ main () #endif return 0; } + +/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c index fc5a1c8fae1..3d4ba4f9157 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ typedef struct rs6000_stack { @@ -16,12 +16,12 @@ rs6000_emit_prologue (int i, rs6000_stack_t *info) /* There should be precisely one load of first_gp_reg_save. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "first_gp_reg_save" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "first_gp_reg_save" 1 "dom2"} } */ /* There should be precisely one addition. If there is more than one, then the dominator optimizations failed, most likely due to not handling commutative operands correctly. */ -/* { dg-final { scan-tree-dump-times "\\+" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "\\+" 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c index 87c4e47487c..fac91be70c5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern int square (int) __attribute__ ((__const__)); shit(int a) @@ -10,5 +10,5 @@ shit(int a) /* There should be precisely one call to square. If there is more than one, then the dominator optimizations failed to remove the redundant call. */ -/* { dg-final { scan-tree-dump-times "square" 1 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "square" 1 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c index 1ba57daa668..fa599237246 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); extern int blah[]; @@ -14,9 +14,9 @@ foo(int index) /* There should be precisely one load of blah. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "blah" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "blah" 1 "dom2"} } */ /* There should be exactly one IF conditional. */ -/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c index c2873acc1d0..4a64b90db1a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -29,16 +29,16 @@ get_alias_set (t) /* There should be precisely one load of {t,__t}->code. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "->code" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "->code" 1 "dom2"} } */ /* There should be precisely one load of tree_code_type. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "tree_code_type" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "tree_code_type" 1 "dom2"} } */ /* There should be one IF conditional. If 'tree_code_type[t->code]' is zero, then the third if() conditional is unnecessary. That should cause the call to abort() to be removed, which in turn causes the whole second if() to disappear. */ -/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c index 4a9496c2537..b3be8a9394e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); struct rtx_def; typedef struct rtx_def *rtx; @@ -35,9 +35,9 @@ nonlocal_mentioned_p (x) /* There should be no casts to a short unsigned int since the entire set of conditionals should optimize away. */ -/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom2"} } */ /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c index 4712a3b9fb3..f99598d73cf 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce" } */ +/* { dg-options "-O2 -fdump-tree-cddce2" } */ struct rtx_def; typedef struct rtx_def *rtx; @@ -41,14 +41,14 @@ get_alias_set (t) /* There should be precisely one load of ->decl.rtl. If there is more than, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce2"} } */ /* There should be no loads of .rtmem since the complex return statement is just "return 0". */ -/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce"} } */ +/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce2"} } */ /* There should be one IF statement (the complex return statement should collapse down to a simple return 0 without any conditionals). */ -/* { dg-final { scan-tree-dump-times "if " 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "cddce2"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c index 1d69e5c5977..4f9847852bf 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -36,13 +36,13 @@ record_component_aliases (type) /* There should be precisely one load of type.binfo. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom2"} } */ /* There should be precisely one load of common.code. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "common\\.code" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "common\\.code" 1 "dom2"} } */ /* There should be one IF conditional. */ -/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c index 8ed9b4c3df7..c344d48e919 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); union tree_node; @@ -41,15 +41,15 @@ record_component_aliases (type) /* The call to blah should have been eliminated. If the call is not eliminated, then dominator optimizations failed and it'll be impossible to delete other unnecessary code. */ -/* { dg-final { scan-tree-dump-not "blah \\(\\)" "dom3" } } */ +/* { dg-final { scan-tree-dump-not "blah \\(\\)" "dom2" } } */ /* There should be two IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */ /* There should be a single load of type.binfo. */ -/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "type\\.binfo" 1 "dom2"} } */ /* There should be two loads of vec.length. */ -/* { dg-final { scan-tree-dump-times "vec.length" 2 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "vec.length" 2 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c index 20a660c59fb..1855580d571 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -41,15 +41,15 @@ record_component_aliases (type) } /* The call to blah can not be eliminated. */ -/* { dg-final { scan-tree-dump-times "blah \\(\\)" 1 "dom3" } } */ +/* { dg-final { scan-tree-dump-times "blah \\(\\)" 1 "dom2" } } */ /* There should be four IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 4 "dom2"} } */ /* There should be two loads of type.binfo. */ -/* { dg-final { scan-tree-dump-times "type\\.binfo" 2 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "type\\.binfo" 2 "dom2"} } */ /* There should be four loads of vec.length. */ -/* { dg-final { scan-tree-dump-times "vec.length" 3 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "vec.length" 4 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c index c5840a39665..44dd2535577 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom3" } */ +/* { dg-options "-O2 -fdump-tree-dom2" } */ struct rtx_def; @@ -49,21 +49,21 @@ get_alias_set (t,z) } /* The calls to make_decl_rtl should be eliminated -/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom3" } } */ +/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom2" } } */ /* There should be three IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */ /* There should be one loads of decl.rtl. */ -/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom2"} } */ /* There should be one load of code. */ -/* { dg-final { scan-tree-dump-times "code" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "code" 1 "dom2"} } */ /* There should be one load of rtmem. */ -/* { dg-final { scan-tree-dump-times "rtmem" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "rtmem" 1 "dom2"} } */ /* There should be one load of alias. */ -/* { dg-final { scan-tree-dump-times "->alias" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "->alias" 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c index ea6d5a4122c..ec04e17541e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ struct rtx_def; @@ -44,18 +44,18 @@ get_alias_set (t) } /* The calls to make_decl_rtl should be eliminated. */ -/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom3" } } */ +/* { dg-final { scan-tree-dump-not "make_decl_rtl \\(\\)" "dom2" } } */ /* There should be two IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */ /* There should be one load of decl.rtl. */ -/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "decl\\.rtl" 1 "dom2"} } */ /* There should be two loads of rtmem. */ -/* { dg-final { scan-tree-dump-times "rtmem" 2 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "rtmem" 2 "dom2"} } */ /* There should be one load of alias. */ -/* { dg-final { scan-tree-dump-times "->alias" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "->alias" 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c index cfc5aa74c26..397036f25b9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ struct rtx_def; typedef struct rtx_def *rtx; @@ -35,6 +35,6 @@ find_base_value (src) /* There should be no casts to short unsigned int. */ -/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "\\(short unsigned int\\)" 0 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c index 42f3a38d051..cac64868726 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ union tree_node; @@ -34,6 +34,6 @@ get_alias_set (t) /* There should be exactly three IF conditionals if we thread jumps properly. */ -/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c index dc581715bb3..59b48397c4b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); union tree_node; @@ -45,10 +45,10 @@ readonly_fields_p (type) /* A good optimizer would realize that the cast to (unsigned int) is useless as the earlier cast of the same value of (unsigned char) will always produce the same result. */ -/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 0 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 0 "dom2"} } */ /* There should be one load of ->common.code. We currently fail this because we load from ->common.code using different types. */ -/* { dg-final { scan-tree-dump-times "common\.code" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "common\.code" 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c index f8ee97c7213..bb474ff4b1b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom3" } */ +/* { dg-options "-O2 -fdump-tree-dom2" } */ extern void exit (int); extern void *ggc_alloc (__SIZE_TYPE__); @@ -19,7 +19,7 @@ foo (int attr_kind, unsigned long offset) } /* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */ -/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump "if " "dom2" { target { keeps_null_pointer_checks } } } } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c index 90359ed8cc7..1768d4523d2 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom3" } */ +/* { dg-options "-O2 -fdump-tree-dom2" } */ extern void exit (int); extern void *ggc_alloc (__SIZE_TYPE__); @@ -19,7 +19,7 @@ foo (int attr_kind, unsigned long offset) } /* There should be no IF conditionals, unless target has fno-delete-null-pointer-checks */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3" { target { ! keeps_null_pointer_checks } } } } */ -/* { dg-final { scan-tree-dump "if " "dom3" { target { keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump "if " "dom2" { target { keeps_null_pointer_checks } } } } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c index 1eb1617162a..a16f49dbb21 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -63,5 +63,5 @@ store_expr (exp, target, want_value) (B) only looks at immediate dominators, and only queued_subexp_p immediately dominates the comparison in question. We need something stronger. */ -/* { dg-final { scan-tree-dump-times "target.*!= 0" 0 "dom3" { xfail *-*-* } } } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "target.*!= 0" 0 "dom2" { xfail *-*-* } } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c index 679d9527c9e..84344e36cf9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ struct rtx_def; typedef struct rtx_def *rtx; @@ -41,5 +41,5 @@ bar (rtx r) are threaded to the return 0. Which in turn means the path which combines the result of those two tests into a new test must always be true and it is optimized appropriately. */ -/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c index b6603338dd7..0711053bc37 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); struct rtx_def; @@ -17,5 +17,5 @@ foo (reg) } /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c index 06a8a83ba9e..a12d718408b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -ftree-vrp -fdump-tree-dom3" } */ +/* { dg-options "-O1 -ftree-vrp -fdump-tree-dom2" } */ extern void abort (void); @@ -24,5 +24,5 @@ foo(int n) /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3" } } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c index 8255b581aee..9a3c23163f8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ typedef unsigned int cppchar_t; cppchar_t @@ -23,5 +23,5 @@ cpp_parse_escape (pstr, limit, wide) /* There should be precisely three IF statements. If there is more than two, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "if " 3 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "if " 3 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c index e9decac0810..424b5583bb8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); struct rtx_def; @@ -30,10 +30,10 @@ foo () /* There should be precisely one load of ->code. If there is more than, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "->code" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "->code" 1 "dom2"} } */ /* There should be two IF statements. One for 'current_sym_addr->code == 42'. The other one for '(EXPR)->unchanging'. */ -/* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 2 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c index 27f25eb99ad..77fd3e59a1f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ struct die_struct; typedef struct die_struct *dw_die_ref; @@ -51,5 +51,5 @@ output_location_lists (die) } /* There should be exactly one IF conditional, in output_location_lists. */ -/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c index b2c3c890a33..4f0b7cbafe9 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ static void bar () @@ -16,5 +16,5 @@ ooof () } /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c index f7057bfe822..27e2c7105f6 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-cddce" } */ +/* { dg-options "-O1 -fdump-tree-cddce2" } */ extern void abort (void); @@ -33,9 +33,9 @@ delete_dead_jumptables () /* There should be no loads of ->code. If any exist, then we failed to optimize away all the IF statements and the statements feeding their conditions. */ -/* { dg-final { scan-tree-dump-times "->code" 0 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "->code" 0 "cddce2"} } */ /* There should be no IF statements. */ -/* { dg-final { scan-tree-dump-times "if " 0 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "if " 0 "cddce2"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c index d7b44a64bef..aad53c33907 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -16,6 +16,6 @@ com(int *blah) /* There should be precisely one load of blah. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "\\*blah" 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "\\*blah" 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c index 1e65ffadece..7f60b27830d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -17,6 +17,6 @@ foo (int value) } /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c index 852b43823fb..2746415e59b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -18,6 +18,6 @@ foo (int value) } /* There should be one IF conditional. */ -/* { dg-final { scan-tree-dump-times "if " 1 "dom3"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "dom2"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c index e04a668f7ee..2c2142cbcaa 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3 -fdump-tree-optimized" } */ +/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */ extern void abort (void); union tree_node; @@ -34,8 +34,8 @@ blah (decl, set) /* There should be precisely one reference to pointer_alias_set. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ /* The assignment set = -1 in the ELSE clause of the last IF statement should be removed by the final cleanup phase. */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c index 8335239d926..41aa1482d43 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3 -fdump-tree-optimized" } */ +/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */ extern void abort (void); union tree_node; @@ -34,8 +34,8 @@ blah (decl, set) /* There should be precisely one reference to pointer_alias_set. If there is more than one, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ /* The assignment set = -1 in the ELSE clause of the last IF statement should be removed by the final cleanup phase. */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c index 1c2995ed6d7..170526547d2 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); union tree_node; @@ -41,5 +41,5 @@ foo (t, set) more than one, then the dominator optimizations failed. */ /* ??? Will fail until we properly distinguish member stores. At present the write to type.alias_set kills the previous load. */ -/* { dg-final { scan-tree-dump-times "common.code" 1 "dom3" { xfail *-*-* } } } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "common.code" 1 "dom2" { xfail *-*-* } } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c index fce0e2af337..711bab25168 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); struct rtx_def; @@ -38,5 +38,5 @@ mark_constant_function (void) and the temporary used as the argument to cgraph_rtl_info. This if we find current_function_decl used as an argument, then we have failed. */ -/* { dg-final { scan-tree-dump-times "\\(current_function_decl\\)" 0 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "\\(current_function_decl\\)" 0 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c index b3663572a67..96db1bd1d3a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ extern void abort (void); @@ -30,5 +30,5 @@ voidify_wrapper_expr (tree wrapper) /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dom3"} } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dom2"} } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c index aaeab53a2cf..34a5926796e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c @@ -1,8 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce" } */ - - - +/* { dg-options "-O2 -fdump-tree-cddce2" } */ struct rtx_def; typedef struct rtx_def *rtx; @@ -37,5 +34,5 @@ com (rtx insn, int blah) /* Cddce cannot remove possibly infinite loops and there is no way how to determine whether the loop in can_move_up ends. */ -/* { dg-final { scan-tree-dump "if " "cddce"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { scan-tree-dump "if " "cddce2"} } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c index acde4b3116c..8e9f61da60a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce -fdump-tree-forwprop1-details" } */ +/* { dg-options "-O2 -fdump-tree-cddce2 -fdump-tree-forwprop1-details" } */ int abarney[2]; int afred[1]; @@ -28,5 +28,5 @@ void foo(int edx, int eax) /* After cddce we should have two IF statements remaining as the other two tests can be threaded. */ -/* { dg-final { scan-tree-dump-times "if " 2 "cddce"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { scan-tree-dump-times "if " 2 "cddce2"} } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c index e8674e4bc76..ef94096fa0d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dce3" } */ +/* { dg-options "-O1 -fdump-tree-dce2" } */ foo () { @@ -15,5 +15,5 @@ foo () compiler was mistakenly thinking that the statement had volatile operands. But 'p' itself is not volatile and taking the address of a volatile does not constitute a volatile operand. */ -/* { dg-final { scan-tree-dump-times "&x" 0 "dce3"} } */ -/* { dg-final { cleanup-tree-dump "dce3" } } */ +/* { dg-final { scan-tree-dump-times "&x" 0 "dce2"} } */ +/* { dg-final { cleanup-tree-dump "dce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c index ea0fb7ef1bf..d5cabb0bd37 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dom3" } */ +/* { dg-options "-O1 -fdump-tree-dom2" } */ typedef unsigned int size_t; @@ -34,5 +34,5 @@ find_unreachable_blocks (int frobit) able to determine that modifying e->dest->flags does not modify e or e->dest. The net result is that we only need one load of e->dest. */ -/* { dg-final { scan-tree-dump-times "->dest" 1 "dom3" { xfail *-*-* } } } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "->dest" 1 "dom2" { xfail *-*-* } } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c b/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c index 92b60999495..5eb71d9be9e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c @@ -25,5 +25,5 @@ int foo (int n, int m) outermost "k" loop: the 4 comes from the instantiation of the number of iterations of loop "j". */ -/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" } } */ /* { dg-final { cleanup-tree-dump "ltrans" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c index c1fa43543c1..ee3cb0ebfe5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c @@ -15,5 +15,5 @@ void f(struct a * b, __SIZE_TYPE__ i) c[i] = 1; } -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */ +/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */ /* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c new file mode 100644 index 00000000000..0b865245a96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-10.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-forwprop1" } */ + +int b; +unsigned a; + +static inline int *g(void) +{ + a = 1; + return (int*)&a; +} +void test2(void) +{ + b = *g(); +} + +/* The indirect load should be replaced by a load from a and a + conversion to int. */ + +/* { dg-final { scan-tree-dump "= a;" "forwprop1" } } */ +/* { dg-final { scan-tree-dump "= \\\(int\\\) " "forwprop1" } } */ +/* { dg-final { scan-tree-dump-not "= \\\*" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c index 434d86c65d5..fe04e66fa1a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c @@ -17,5 +17,5 @@ void f(__SIZE_TYPE__ i) c[i] = 1; } -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */ +/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */ /* { dg-final { cleanup-tree-dump "forwprop?" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c index 70630d01a34..4469fe7312e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c @@ -1,6 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-final_cleanup -W -Wall -fno-early-inlining" } */ - +/* { dg-options "-O1 -fdump-tree-final_cleanup -fdump-tree-fre -W -Wall -fno-early-inlining" } */ int b; unsigned a; @@ -13,6 +12,10 @@ void f(void) { b = *g(); } -/* We should have converted the assignments to two = 1. */ + +/* We should have converted the assignments to two = 1. FRE does this. */ + /* { dg-final { scan-tree-dump-times " = 1" 2 "final_cleanup"} } */ +/* { dg-final { scan-tree-dump-not " = a;" "fre"} } */ +/* { dg-final { cleanup-tree-dump "fre" } } */ /* { dg-final { cleanup-tree-dump "final_cleanup" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c index c0d6b20f0c8..7fdcf750675 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c @@ -6,12 +6,13 @@ #define N 16 +char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + int main () { int i; char ia[N]; - char ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - char ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; for (i = 0; i < N; i++) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c index b0394c6519a..d147b81158b 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c @@ -14,12 +14,13 @@ typedef short half_word; typedef int half_word; #endif +half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + int main () { int i; half_word ia[N]; - half_word ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - half_word ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; for (i = 0; i < N; i++) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c index 5c4e9735bbd..84248ee87fd 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c @@ -14,9 +14,10 @@ typedef short half_word; typedef int half_word; #endif +half_word cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + int main () { - half_word cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; half_word ca[N]; int i; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c index 691026d7905..e7b13b54096 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c @@ -6,12 +6,12 @@ #define N 16 #define MAX 42 +int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; + extern void abort(void); int main1 () { - int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - int i, j; for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c index 5f2f5ca1334..51508f98a61 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c @@ -17,5 +17,5 @@ int foo(int N, int *res) *res = sum + N; } -/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans" } } */ /* { dg-final { cleanup-tree-dump "ltrans" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c index d20b1022f0b..3ddf48e6f00 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20701.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-vrp2 -fno-early-inlining" } */ +/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */ typedef struct { int code; @@ -36,6 +36,6 @@ can_combine_p (rtx insn, rtx elt) } /* Target with fno-delete-null-pointer-checks should not fold checks */ -/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" { target { ! keeps_null_pointer_checks } } } } */ -/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp2" { target { keeps_null_pointer_checks } } } } */ -/* { dg-final { cleanup-tree-dump "vrp2" } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */ +/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c index e6320071daf..4a2c82143ec 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom3-details" } */ +/* { dg-options "-O2 -fdump-tree-dom2-details" } */ struct tree_common { @@ -49,6 +49,6 @@ L23: /* We should thread the backedge to the top of the loop; ie we only execute the if (expr->common.code != 142) test once per loop iteration. */ -/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "dom3" } } */ -/* { dg-final { cleanup-tree-dump "dom3" } } */ +/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "dom2" } } */ +/* { dg-final { cleanup-tree-dump "dom2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c index d7b72f9f754..c1a48c04b96 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21658.c @@ -3,7 +3,7 @@ statement below from being folded. */ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-ccp-details" } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-ccp1-details" } */ void link_error (void); @@ -18,4 +18,4 @@ f (void) } /* { dg-final { scan-tree-dump-times "Folded into: if " 1 "ccp1"} } */ -/* { dg-final { cleanup-tree-dump "ccp\[1-2\]" } } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c index d0e8b133e82..6b5c4bbf1ce 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21829.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-phicprop-details" } */ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-cddce2" } */ int test(int v) { @@ -16,6 +16,33 @@ int test(int v) return x; } -/* { dg-final { scan-tree-dump-times "Original statement:.*% 2\[ \t\n]*Updated statement.*=1" 0 "phicprop3" } } */ -/* { dg-final { cleanup-tree-dump "phicprop\[1-3\]" } } */ +/* This should be optimized to + if (v <= 0) goto <L1>; else goto <L3>; + + <L1>:; + + # x_1 = PHI <0(3), 1(1)>; + <L3>:; + return x_1; + + retaining only a single conditional. This doesn't work as nobody + combines the two tests + + if (v < 0) goto <bb 4>; else goto <bb 3>; + + <bb 3>: + + if (v <= 0) goto <bb 4>; else goto <bb 5>; + + this late in the game. tree-ssa-ifcombine.c would do it if we would + unroll the loop during early loop unrolling though. + + For now vrp2 does all the needed folding and threading and cddce2 + provides a nice IL to scan. */ + +/* { dg-final { scan-tree-dump-times "if " 1 "optimized" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "if " 2 "cddce2" } } */ +/* { dg-final { scan-tree-dump "x_. = PHI <0\\\(.\\\), 1\\\(.\\\)>" "cddce2" } } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c index 6e0a8f14478..3be025f079f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-14.c @@ -17,5 +17,5 @@ void bar (void) } /* Everything except for the "i = 0" assignment should get removed. */ -/* { dg-final { scan-tree-dump-times "if" 0 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "if" 0 "optimized" { xfail *-*-* } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c index 3a1cad1b8bc..12d9826293f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-dce3" } */ +/* { dg-options "-O1 -fdump-tree-dce2" } */ int t() __attribute__ ((const)); q() @@ -9,5 +9,5 @@ q() i = t(); } /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dce3"} } */ -/* { dg-final { cleanup-tree-dump "dce3" } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dce2"} } */ +/* { dg-final { cleanup-tree-dump "dce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c index 655f61c6f73..5e5302486d0 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dce3" } */ +/* { dg-options "-O2 -fdump-tree-dce2" } */ /* We should notice constantness of this function. */ static int __attribute__((noinline)) t(int a) @@ -13,5 +13,5 @@ void q(void) i = t(1); } /* There should be no IF conditionals. */ -/* { dg-final { scan-tree-dump-times "if " 0 "dce3"} } */ -/* { dg-final { cleanup-tree-dump "dce3" } } */ +/* { dg-final { scan-tree-dump-times "if " 0 "dce2"} } */ +/* { dg-final { cleanup-tree-dump "dce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c index 847d4209b58..f7645c353de 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce" } */ +/* { dg-options "-O2 -fdump-tree-cddce1" } */ int main(void) { @@ -23,9 +23,9 @@ int main(void) /* We should eliminate the inner condition, but the loop must be preserved as it is infinite. Therefore there should be just one phi node (for i): */ -/* { dg-final { scan-tree-dump-times "PHI " 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "PHI " 1 "cddce1"} } */ /* And one if (for the exit condition of the loop): */ -/* { dg-final { scan-tree-dump-times "if " 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "cddce1"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { cleanup-tree-dump "cddce1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c index d89394a2698..7671e93ad10 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom1-details" } */ +/* { dg-options "-O2 -fno-tree-vrp -fdump-tree-dom1-details" } */ void t(void); void q(void); void q1(void); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c index bb48c0a391b..3253afe2927 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-13.c @@ -25,6 +25,6 @@ void foo(double (*q)[4], struct Foo *tmp1) } } -/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced tmp1_.\\\(D\\\)->data" "fre" } } */ /* { dg-final { cleanup-tree-dump "fre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c index 61c5e00b554..d2d5e01bcc4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-14.c @@ -27,6 +27,6 @@ void foo(double (*q)[4]) } } -/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "Inserted .* &a" "fre" } } */ +/* { dg-final { scan-tree-dump "Replaced tmp1.data" "fre" } } */ /* { dg-final { cleanup-tree-dump "fre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c index 68fbb454c76..aced64977ea 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-17.c @@ -18,6 +18,6 @@ int foo(int i, int j, int k) return f.doms[0LL].dom; } -/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" } } */ /* { dg-final { cleanup-tree-dump "fre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c new file mode 100644 index 00000000000..0fd0dc5425c --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-19.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre-stats" } */ + +struct Loc { + int x[3]; +}; + +void bar (struct Loc *); + +int foo (int i, int j, int k, int b) +{ + struct Loc IND; + int res; + + if (b) + { + IND.x[0] = i; + IND.x[1] = j; + IND.x[2] = k-1; + } + else + { + IND.x[0] = i; + IND.x[1] = j; + IND.x[2] = k; + } + + /* This should be optimized to i + j + {k, k + 1}. */ + res = IND.x[0] + IND.x[1] + IND.x[2]; + + /* This is just to prevent SRA. */ + bar (&IND); + + return res; +} + +/* All three loads should be eliminated. */ +/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */ +/* { dg-final { cleanup-tree-dump "pre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c new file mode 100644 index 00000000000..6361b679c44 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-20.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-pre-stats" } */ + +double pcheck; + +void foo(int n, int m, int b) +{ + int i, j; + + goto bb18; + +start: + i = 1; + do { + j = 1; + do { + double x = pcheck; + x = x + 1; + pcheck = x; + j = j + 1; + } while (j != m); + i = i + 1; + } while (i != n); + +bb18: + pcheck = 0.0; + goto start; +} + +/* We should have inserted two PHI nodes and the one in the i-loop + should have 0.0 in the argument coming from the bb18 block. */ + +/* { dg-final { scan-tree-dump "New PHIs: 2" "pre" } } */ +/* { dg-final { scan-tree-dump "PHI <.*0\\\.0" "pre" } } */ +/* { dg-final { cleanup-tree-dump "pre" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp46.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp46.c new file mode 100644 index 00000000000..a67e839ded5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp46.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-vrp1" } */ + +void +func_18 ( int t ) +{ + unsigned l_889; + int l_895 = 1; + for (0; 1; ++l_889) + { + int t1 = 0; + if (func_81 (1)) + { + int rhs = l_895; + if (rhs == 0) + rhs = 1; + if (1 & (t % rhs)) + t1 = 1; + } + func_98 (t1); + l_895 = 0; + } +} + +/* There should be a single if left. */ + +/* { dg-final { scan-tree-dump-times "if" 1 "vrp1" } } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/uninit-15.c b/gcc/testsuite/gcc.dg/uninit-15.c index dee7a3b211c..20bea95acd8 100644 --- a/gcc/testsuite/gcc.dg/uninit-15.c +++ b/gcc/testsuite/gcc.dg/uninit-15.c @@ -1,17 +1,26 @@ +/* PR tree-optimization/17506 + We issue an uninitialized variable warning at a wrong location at + line 11, which is very confusing. Make sure we print out a note to + make it less confusing. (xfailed alternative) + But it is of course ok if we warn in bar about uninitialized use + of j. (not xfailed alternative) */ /* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ +/* { dg-options "-O1 -Wuninitialized" } */ -inline int foo (int i) +inline int +foo (int i) { - if (i) return 1; /* { dg-warning "is used uninitialized" } */ - return 0; + if (i) /* { dg-warning "used uninitialized in this function" "" { xfail *-*-* } } */ + return 1; + return 0; } -void baz(); +void baz (void); -void bar() +void +bar (void) { - int j; /* { dg-message "was declared here" } */ - for (; foo(j); ++j) - baz(); + int j; /* { dg-message "note: 'j' was declared here" "" { xfail *-*-* } } */ + for (; foo (j); ++j) /* { dg-warning "'j' is used uninitialized" } */ + baz (); } diff --git a/gcc/testsuite/gcc.dg/uninit-6-O0.c b/gcc/testsuite/gcc.dg/uninit-6-O0.c index e3fefe5e1c5..f4588305ffa 100644 --- a/gcc/testsuite/gcc.dg/uninit-6-O0.c +++ b/gcc/testsuite/gcc.dg/uninit-6-O0.c @@ -39,7 +39,7 @@ make_something(int a, int b, int c) rv = malloc (sizeof (struct tree)); rv->car = 0; - APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */ + APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" } */ APPEND(rv, field, PTR_T, b); APPEND(rv, field, INTEGER_T, c); diff --git a/gcc/testsuite/gcc.dg/uninit-6.c b/gcc/testsuite/gcc.dg/uninit-6.c index b0f2083ab4b..009e124fccf 100644 --- a/gcc/testsuite/gcc.dg/uninit-6.c +++ b/gcc/testsuite/gcc.dg/uninit-6.c @@ -39,7 +39,7 @@ make_something(int a, int b, int c) rv = malloc (sizeof (struct tree)); rv->car = 0; - APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */ + APPEND(rv, field, INTEGER_T, a); /* { dg-bogus "field" "uninitialized variable warning" } */ APPEND(rv, field, PTR_T, b); APPEND(rv, field, INTEGER_T, c); diff --git a/gcc/testsuite/gcc.dg/uninit-B-2.c b/gcc/testsuite/gcc.dg/uninit-B-2.c new file mode 100644 index 00000000000..ee8a885817b --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-B-2.c @@ -0,0 +1,16 @@ +/* Origin: PR c/179 inverse of uninit-B-O0.c, we should not warn. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wuninitialized" } */ +extern void foo (int *); +extern void bar (int); + +void +baz (void) +{ + int i; + foo (&i); /* { dg-bogus "is used uninitialized" "uninit i warning" } */ + if (i) + bar (i); +} + + diff --git a/gcc/testsuite/gcc.dg/uninit-B-O0-2.c b/gcc/testsuite/gcc.dg/uninit-B-O0-2.c new file mode 100644 index 00000000000..dfa3de97e0c --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-B-O0-2.c @@ -0,0 +1,16 @@ +/* Origin: PR c/179 inverse of uninit-B-O0.c, we should not warn. */ +/* { dg-do compile } */ +/* { dg-options "-O0 -Wuninitialized" } */ +extern void foo (int *); +extern void bar (int); + +void +baz (void) +{ + int i; + foo (&i); /* { dg-bogus "is used uninitialized" "uninit i warning" } */ + if (i) + bar (i); +} + + diff --git a/gcc/testsuite/gcc.dg/uninit-B.c b/gcc/testsuite/gcc.dg/uninit-B.c index 450bb388da6..adb1461d951 100644 --- a/gcc/testsuite/gcc.dg/uninit-B.c +++ b/gcc/testsuite/gcc.dg/uninit-B.c @@ -9,7 +9,7 @@ void baz (void) { int i; - if (i) /* { dg-warning "uninit" "uninit i warning" { xfail *-*-* } } */ + if (i) /* { dg-warning "is used uninitialized" "uninit i warning" } */ bar (i); foo (&i); } diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430-2.c b/gcc/testsuite/gcc.dg/uninit-pr19430-2.c new file mode 100644 index 00000000000..361a6a0bbda --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr19430-2.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +int *p, *q; + +int foo (int b) +{ + int i, j = 0; + int *x; + p = &i; + q = &j; + if (b) + x = p; + else + x = q; + return *x; +} + diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c b/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c new file mode 100644 index 00000000000..4ce258653d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr19430-O0.c @@ -0,0 +1,43 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -Wuninitialized" } */ +extern int bar (int); +extern void baz (int *); + +int +foo (int i) +{ + int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 9 } */ + + if (bar (i)) { + baz (&j); + } else { + } + + return j; +} + + +int foo2( void ) { + int rc; /* { dg-warning "'rc' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 21 } */ + return rc; + *&rc = 0; +} + +extern int printf(const char *, ...); +void frob(int *pi); + +int main(void) +{ + int i; + printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 32 } */ + frob(&i); + + return 0; +} + +void foo3(int*); +void bar3(void) { + int x; + if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 41 } */ + foo3(&x); +} diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430.c b/gcc/testsuite/gcc.dg/uninit-pr19430.c new file mode 100644 index 00000000000..ecf9c009627 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-pr19430.c @@ -0,0 +1,43 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ +extern int bar (int); +extern void baz (int *); +int +foo (int i) +{ + int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 8 } */ + + if (bar (i)) { + baz (&j); + } else { + } + + return j; +} + + + +int foo2( void ) { + int rc; /* { dg-warning "'rc' is used uninitialized in this function" } */ + return rc; + *&rc = 0; +} + +extern int printf(const char *, ...); +void frob(int *pi); + +int main(void) +{ + int i; + printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" } */ + frob(&i); + + return 0; +} + +void foo3(int*); +void bar3(void) { + int x; + if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" } */ + foo3(&x); +} diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c index 55334fdd20d..a7b86cebd9c 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-reduc-1char.c @@ -6,12 +6,13 @@ #define N 16 #define DIFF 242 +unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + void main1 (unsigned char x, unsigned char max_result, unsigned char min_result) { int i; - unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char udiff = 2; unsigned char umax = x; unsigned char umin = x; diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c index d18f416a07c..1142e7a2717 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-76c.c @@ -11,12 +11,12 @@ more involved than just an ssa_name. */ int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; +int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; int main1 (int *pib) { int i; int ia[N+OFF]; - int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; for (i = OFF; i < N; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c index 55334fdd20d..a7b86cebd9c 100644 --- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c +++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-reduc-1char.c @@ -6,12 +6,13 @@ #define N 16 #define DIFF 242 +unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + void main1 (unsigned char x, unsigned char max_result, unsigned char min_result) { int i; - unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char udiff = 2; unsigned char umax = x; unsigned char umin = x; diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c index 2c788606771..6a01782bb3d 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target vect_float } */ /* { dg-require-effective-target vect_int } */ +/* { dg-require-effective-target vect_intfloat_cvt } */ struct mem { diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c index 74bdd262319..377d74b7779 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-5.c @@ -9,11 +9,12 @@ #define N 16 #define DIFF 242 +float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + int main1 (float x, float max_result) { int i; - float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; float diff = 2; float max = x; float min = 10; diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c index b25e1145b1e..9f36db2e701 100644 --- a/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c +++ b/gcc/testsuite/gcc.dg/vect/fast-math-vect-reduc-7.c @@ -9,11 +9,12 @@ #define N 16 #define DIFF 242 +double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + int main1 (double x, double max_result) { int i; - double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; double diff = 2; double max = x; double min = 10; diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c index cc3142efd68..3971c920afa 100644 --- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c +++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-2.c @@ -6,12 +6,13 @@ #define N 16 +float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + __attribute__ ((noinline)) int main1 (void) { int i; float a[N]; - float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; /* Condition in loop. */ /* This loop is vectorized on platforms that support vect_condition. */ diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c index 413c7ef4226..673346a675c 100644 --- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c +++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-111.c @@ -5,12 +5,13 @@ #define N 16 +float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + __attribute__ ((noinline)) int main1 (void) { int i; float a[N]; - float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; /* Condition in loop. */ /* This loop is vectorized on platforms that support vect_condition. */ diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c index 560b5bc73df..a35b7ade8e6 100644 --- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c +++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-11.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +float B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0}; + extern void abort(void); int main () { - float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - float B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c index 5f132b8ba81..485e88cf383 100644 --- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c +++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-12.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +float B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0}; + extern void abort(void); int main () { - float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - float B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c index a5a59366bdc..58e6dc0a9ca 100644 --- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c +++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-13.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42}; + extern void abort(void); int main () { - float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c index a5a59366bdc..58e6dc0a9ca 100644 --- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c +++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-14.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42}; + extern void abort(void); int main () { - float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - float B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c index 67d7ebe60c6..a15a0b1278c 100644 --- a/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c +++ b/gcc/testsuite/gcc.dg/vect/no-trapping-math-vect-ifcvt-15.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +float B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42}; + extern void abort(void); int main () { - float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - float B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c index 283e74f7cab..954fe25df04 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-pr29145.c @@ -47,6 +47,6 @@ int main(void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { xfail vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c index 09df31f7c3b..bfa0802c0ce 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-37.c @@ -5,6 +5,7 @@ #define N 16 char x[N] __attribute__ ((__aligned__(16))); +char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; __attribute__ ((noinline)) int main1 (char *y) @@ -13,7 +14,6 @@ int main1 (char *y) char *p; char *q; } s; - char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; int i; /* Not vectorized - can't antialias the pointer s.p from the array cb. */ diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c index 2c3ac296ff8..329478d39fe 100644 --- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c +++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c @@ -5,13 +5,14 @@ #define N 17 +int ia[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48}; +int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48}; +int res[N] = {12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,48}; + __attribute__ ((noinline)) int main1 () { int i; - int ia[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48}; - int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48}; - int res[N] = {12,24,36,48,60,72,84,96,108,120,132,144,156,168,180,192,48}; /* Not vectorizable due to data dependence: dependence distance 1. */ for (i = 0; i < N - 1; i++) diff --git a/gcc/testsuite/gcc.dg/vect/pr18400.c b/gcc/testsuite/gcc.dg/vect/pr18400.c index e2ad18cec7d..6bc3b5c831b 100644 --- a/gcc/testsuite/gcc.dg/vect/pr18400.c +++ b/gcc/testsuite/gcc.dg/vect/pr18400.c @@ -4,11 +4,12 @@ #include "tree-vect.h" #define N 8 + +int b[N] = {0,3,6,9,12,15,18,21}; +int a[N]; int main1 () { - int b[N] = {0,3,6,9,12,15,18,21}; - int a[N]; int i; for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/slp-11.c b/gcc/testsuite/gcc.dg/vect/slp-11.c index d606438fd20..1e87eef4344 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-11.c +++ b/gcc/testsuite/gcc.dg/vect/slp-11.c @@ -106,7 +106,8 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { vect_strided_wide && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { { vect_intfloat_cvt && vect_strided_wide } && vect_int_mult } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { { ! vect_intfloat_cvt } && vect_strided_wide } && vect_int_mult } } } } */ /* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_int_mult && vect_strided_wide } } } } } */ /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-12b.c b/gcc/testsuite/gcc.dg/vect/slp-12b.c index 7b65dfcfe35..9f7c7606b46 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-12b.c +++ b/gcc/testsuite/gcc.dg/vect/slp-12b.c @@ -6,11 +6,12 @@ #define N 64 +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + int main1 () { int i; - unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; float out2[N*8], fa[N*4]; for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/slp-14.c b/gcc/testsuite/gcc.dg/vect/slp-14.c index 62610dc0233..98a203cf5ca 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-14.c +++ b/gcc/testsuite/gcc.dg/vect/slp-14.c @@ -6,16 +6,17 @@ #define N 8 +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + int main1 (int n) { int i; unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; - unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; unsigned short out2[N*16]; - /* Multiple types are not SLPable yet. */ + /* Multiple types are now SLPable. */ for (i = 0; i < n; i++) { a0 = in[i*8] + 5; @@ -110,9 +111,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided && vect_int_mult } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_strided && vect_int_mult } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_int_mult } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_int_mult } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-15.c b/gcc/testsuite/gcc.dg/vect/slp-15.c index 08b6f84b209..dde0b746fae 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-15.c +++ b/gcc/testsuite/gcc.dg/vect/slp-15.c @@ -6,14 +6,16 @@ #define N 8 +unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned int out2[N*16]; + int main1 (int n) { int i; - unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; - unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned int out2[N*16]; + unsigned int a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; for (i = 0; i < n; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-16.c b/gcc/testsuite/gcc.dg/vect/slp-16.c index cbc47cd1f2b..5ca698f7d36 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-16.c +++ b/gcc/testsuite/gcc.dg/vect/slp-16.c @@ -6,14 +6,16 @@ #define N 8 +unsigned int out[N*8]; +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned int out2[N*16]; + int main1 () { int i; - unsigned int out[N*8], a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; - unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned int in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned int out2[N*16]; + unsigned int a0, a1, a2, a3, a4, a5, a6, a7, b1, b0, b2, b3, b4, b5, b6, b7; /* SLP group of size that is not a multiple of vector size. Unrolling by 2. */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-17.c b/gcc/testsuite/gcc.dg/vect/slp-17.c index 0a760bf2c68..0939f74d4db 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-17.c +++ b/gcc/testsuite/gcc.dg/vect/slp-17.c @@ -6,14 +6,15 @@ #define N 8 +unsigned short out[N*8]; +unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned short out2[N*8]; + int main1 () { int i; - unsigned short out[N*8]; - unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned short out2[N*8]; for (i = 0; i < N*2; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-18.c b/gcc/testsuite/gcc.dg/vect/slp-18.c index b8e122c6cfa..91e1e114c1b 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-18.c +++ b/gcc/testsuite/gcc.dg/vect/slp-18.c @@ -1,4 +1,5 @@ /* { dg-require-effective-target vect_int } */ +/* { dg-require-effective-target vect_intfloat_cvt } */ #include <stdarg.h> #include <stdio.h> diff --git a/gcc/testsuite/gcc.dg/vect/slp-24.c b/gcc/testsuite/gcc.dg/vect/slp-24.c index b3bf0735b02..bd9c7515e44 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-24.c +++ b/gcc/testsuite/gcc.dg/vect/slp-24.c @@ -14,12 +14,13 @@ typedef struct { unsigned char d; } s; +unsigned char ub[N*2] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + void main1 (unsigned char x, unsigned char max_result, unsigned char min_result, s *arr) { int i; - unsigned char ub[N*2] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char udiff = 2; unsigned char umax = x; unsigned char umin = x; diff --git a/gcc/testsuite/gcc.dg/vect/slp-28.c b/gcc/testsuite/gcc.dg/vect/slp-28.c index 069116ac58e..780a4472b81 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-28.c +++ b/gcc/testsuite/gcc.dg/vect/slp-28.c @@ -6,15 +6,16 @@ #define N 32 +unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; +unsigned short in2[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; +unsigned short in3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; +unsigned short check[N] = {0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38}; +unsigned short check3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,10,11,12,13,14,15,16,17}; + int main1 () { int i; - unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; - unsigned short in2[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; - unsigned short in3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; - unsigned short check[N] = {0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38}; - unsigned short check3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,10,11,12,13,14,15,16,17}; for (i = 0; i < N/4; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-3.c b/gcc/testsuite/gcc.dg/vect/slp-3.c index cf39bf17a31..070715371bb 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-3.c +++ b/gcc/testsuite/gcc.dg/vect/slp-3.c @@ -6,12 +6,13 @@ #define N 8 +unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + int main1 () { int i; unsigned short out[N*8]; - unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; for (i = 0; i < N; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/slp-34.c b/gcc/testsuite/gcc.dg/vect/slp-34.c index d25eef02101..3ed56eae4ec 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-34.c +++ b/gcc/testsuite/gcc.dg/vect/slp-34.c @@ -6,13 +6,14 @@ #define N 8 +unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + int main1 () { int i; unsigned short out[N*8]; - unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned short in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; unsigned short out2[N*8]; /* SLP with unrolling by 8. */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-5.c b/gcc/testsuite/gcc.dg/vect/slp-5.c index 57e9e5df55f..033de778d27 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-5.c +++ b/gcc/testsuite/gcc.dg/vect/slp-5.c @@ -15,7 +15,7 @@ main1 () unsigned short ia[N]; unsigned int ib[N*2]; - /* Not SLPable for now: multiple types with SLP of the smaller type. */ + /* Multiple types with SLP of the smaller type. */ for (i = 0; i < N; i++) { out[i*8] = in[i*8]; @@ -121,8 +121,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { vect_strided_wide } } } } */ -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! { vect_strided_wide } } } } } */ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-6.c b/gcc/testsuite/gcc.dg/vect/slp-6.c index 5e86410588a..672b1d6e28a 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-6.c +++ b/gcc/testsuite/gcc.dg/vect/slp-6.c @@ -6,13 +6,14 @@ #define N 8 +unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned int in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + int main1 () { int i; unsigned short out[N*8]; - unsigned short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned int in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; unsigned int out2[N*8]; for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/slp-7.c b/gcc/testsuite/gcc.dg/vect/slp-7.c index f000fc9059f..72ec0cd1ea2 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-7.c +++ b/gcc/testsuite/gcc.dg/vect/slp-7.c @@ -6,13 +6,14 @@ #define N 8 +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + int main1 () { int i; unsigned int out[N*8], ia[N*2]; - unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; - unsigned short in2[N*16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; unsigned short sa[N], out2[N*16]; for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/slp-8.c b/gcc/testsuite/gcc.dg/vect/slp-8.c index 1260ddce504..76db4e1c28a 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-8.c +++ b/gcc/testsuite/gcc.dg/vect/slp-8.c @@ -5,10 +5,11 @@ #define N 32 +int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + int main1 () { int i; - int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; float fa[N]; /* int -> float */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-9.c b/gcc/testsuite/gcc.dg/vect/slp-9.c index cfb30bd718b..461f32e8241 100644 --- a/gcc/testsuite/gcc.dg/vect/slp-9.c +++ b/gcc/testsuite/gcc.dg/vect/slp-9.c @@ -41,7 +41,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_strided && vect_widen_mult_hi_to_si } } } }*/ -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_hi_to_si } } }*/ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_widen_mult_hi_to_si } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c new file mode 100644 index 00000000000..a3b93b5f015 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-1.c @@ -0,0 +1,58 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 128 + +__attribute__ ((noinline)) int +main1 () +{ + int i; + unsigned short sout[N*8]; + unsigned int iout[N*8]; + + for (i = 0; i < N; i++) + { + sout[i*4] = 8; + sout[i*4 + 1] = 18; + sout[i*4 + 2] = 28; + sout[i*4 + 3] = 38; + + iout[i*4] = 8; + iout[i*4 + 1] = 18; + iout[i*4 + 2] = 28; + iout[i*4 + 3] = 38; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (sout[i*4] != 8 + || sout[i*4 + 1] != 18 + || sout[i*4 + 2] != 28 + || sout[i*4 + 3] != 38 + || iout[i*4] != 8 + || iout[i*4 + 1] != 18 + || iout[i*4 + 2] != 28 + || iout[i*4 + 3] != 38) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c new file mode 100644 index 00000000000..28274017d6f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-10.c @@ -0,0 +1,52 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 + +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +struct s +{ + unsigned char a; + unsigned char b; +}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + struct s out[N*4]; + + for (i = 0; i < N*4; i++) + { + out[i].a = (unsigned char) in[i*2] + 1; + out[i].b = (unsigned char) in[i*2 + 1] + 2; + } + + /* check results: */ + for (i = 0; i < N*4; i++) + { + if (out[i].a != (unsigned char) in[i*2] + 1 + || out[i].b != (unsigned char) in[i*2 + 1] + 2) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c new file mode 100644 index 00000000000..2a04ce0c6d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-11.c @@ -0,0 +1,55 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 18 + +struct s +{ + int a; + int b; + int c; +}; + +char in[N*3] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + struct s out[N]; + + for (i = 0; i < N; i++) + { + out[i].a = (int) in[i*3] + 1; + out[i].b = (int) in[i*3 + 1] + 2; + out[i].c = (int) in[i*3 + 2] + 3; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (out[i].a != (int) in[i*3] + 1 + || out[i].b != (int) in[i*3 + 1] + 2 + || out[i].c != (int) in[i*3 + 2] + 3) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c new file mode 100644 index 00000000000..5d2140fda96 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-12.c @@ -0,0 +1,68 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 128 + +__attribute__ ((noinline)) int +main1 () +{ + int i; + unsigned short sout[N*8]; + unsigned int iout[N*8]; + unsigned char cout[N*8]; + + for (i = 0; i < N; i++) + { + sout[i*4] = 8; + sout[i*4 + 1] = 18; + sout[i*4 + 2] = 28; + sout[i*4 + 3] = 38; + + iout[i*4] = 8; + iout[i*4 + 1] = 18; + iout[i*4 + 2] = 28; + iout[i*4 + 3] = 38; + + cout[i*4] = 1; + cout[i*4 + 1] = 2; + cout[i*4 + 2] = 3; + cout[i*4 + 3] = 4; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (sout[i*4] != 8 + || sout[i*4 + 1] != 18 + || sout[i*4 + 2] != 28 + || sout[i*4 + 3] != 38 + || iout[i*4] != 8 + || iout[i*4 + 1] != 18 + || iout[i*4 + 2] != 28 + || iout[i*4 + 3] != 38 + || cout[i*4] != 1 + || cout[i*4 + 1] != 2 + || cout[i*4 + 2] != 3 + || cout[i*4 + 3] != 4) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c new file mode 100644 index 00000000000..02faec741df --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c @@ -0,0 +1,83 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 128 + +__attribute__ ((noinline)) int +main1 (unsigned short a0, unsigned short a1, unsigned short a2, + unsigned short a3, unsigned short a4, unsigned short a5, + unsigned short a6, unsigned short a7, unsigned short a8, + unsigned short a9, unsigned short a10, unsigned short a11, + unsigned short a12, unsigned short a13, unsigned short a14, + unsigned short a15, unsigned char b0, unsigned char b1) +{ + int i; + unsigned short out[N*16]; + unsigned char out2[N*16]; + + for (i = 0; i < N; i++) + { + out[i*16] = a8; + out[i*16 + 1] = a7; + out[i*16 + 2] = a1; + out[i*16 + 3] = a2; + out[i*16 + 4] = a8; + out[i*16 + 5] = a5; + out[i*16 + 6] = a5; + out[i*16 + 7] = a4; + out[i*16 + 8] = a12; + out[i*16 + 9] = a13; + out[i*16 + 10] = a14; + out[i*16 + 11] = a15; + out[i*16 + 12] = a6; + out[i*16 + 13] = a9; + out[i*16 + 14] = a0; + out[i*16 + 15] = a7; + + out2[i*2] = b1; + out2[i*2+1] = b0; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (out[i*16] != a8 + || out[i*16 + 1] != a7 + || out[i*16 + 2] != a1 + || out[i*16 + 3] != a2 + || out[i*16 + 4] != a8 + || out[i*16 + 5] != a5 + || out[i*16 + 6] != a5 + || out[i*16 + 7] != a4 + || out[i*16 + 8] != a12 + || out[i*16 + 9] != a13 + || out[i*16 + 10] != a14 + || out[i*16 + 11] != a15 + || out[i*16 + 12] != a6 + || out[i*16 + 13] != a9 + || out[i*16 + 14] != a0 + || out[i*16 + 15] != a7 + || out2[i*2] != b1 + || out2[i*2 + 1] != b0) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,20,21); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c new file mode 100644 index 00000000000..0764441c140 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-3.c @@ -0,0 +1,94 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; +unsigned char in2[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + unsigned int out[N*8]; + unsigned char out2[N*8]; + + for (i = 0; i < N/2; i++) + { + out[i*8] = in[i*8] + 5; + out[i*8 + 1] = in[i*8 + 1] + 6; + out[i*8 + 2] = in[i*8 + 2] + 7; + out[i*8 + 3] = in[i*8 + 3] + 8; + out[i*8 + 4] = in[i*8 + 4] + 9; + out[i*8 + 5] = in[i*8 + 5] + 10; + out[i*8 + 6] = in[i*8 + 6] + 11; + out[i*8 + 7] = in[i*8 + 7] + 12; + + out2[i*16] = in2[i*16] + 2; + out2[i*16 + 1] = in2[i*16 + 1] + 3; + out2[i*16 + 2] = in2[i*16 + 2] + 4; + out2[i*16 + 3] = in2[i*16 + 3] + 3; + out2[i*16 + 4] = in2[i*16 + 4] + 2; + out2[i*16 + 5] = in2[i*16 + 5] + 3; + out2[i*16 + 6] = in2[i*16 + 6] + 2; + out2[i*16 + 7] = in2[i*16 + 7] + 4; + out2[i*16 + 8] = in2[i*16 + 8] + 2; + out2[i*16 + 9] = in2[i*16 + 9] + 5; + out2[i*16 + 10] = in2[i*16 + 10] + 2; + out2[i*16 + 11] = in2[i*16 + 11] + 3; + out2[i*16 + 12] = in2[i*16 + 12] + 4; + out2[i*16 + 13] = in2[i*16 + 13] + 4; + out2[i*16 + 14] = in2[i*16 + 14] + 3; + out2[i*16 + 15] = in2[i*16 + 15] + 2; + + } + + /* check results: */ + for (i = 0; i < N/2; i++) + { + if (out[i*8] != in[i*8] + 5 + || out[i*8 + 1] != in[i*8 + 1] + 6 + || out[i*8 + 2] != in[i*8 + 2] + 7 + || out[i*8 + 3] != in[i*8 + 3] + 8 + || out[i*8 + 4] != in[i*8 + 4] + 9 + || out[i*8 + 5] != in[i*8 + 5] + 10 + || out[i*8 + 6] != in[i*8 + 6] + 11 + || out[i*8 + 7] != in[i*8 + 7] + 12 + || out2[i*16] != in2[i*16] + 2 + || out2[i*16 + 1] != in2[i*16 + 1] + 3 + || out2[i*16 + 2] != in2[i*16 + 2] + 4 + || out2[i*16 + 3] != in2[i*16 + 3] + 3 + || out2[i*16 + 4] != in2[i*16 + 4] + 2 + || out2[i*16 + 5] != in2[i*16 + 5] + 3 + || out2[i*16 + 6] != in2[i*16 + 6] + 2 + || out2[i*16 + 7] != in2[i*16 + 7] + 4 + || out2[i*16 + 8] != in2[i*16 + 8] + 2 + || out2[i*16 + 9] != in2[i*16 + 9] + 5 + || out2[i*16 + 10] != in2[i*16 + 10] + 2 + || out2[i*16 + 11] != in2[i*16 + 11] + 3 + || out2[i*16 + 12] != in2[i*16 + 12] + 4 + || out2[i*16 + 13] != in2[i*16 + 13] + 4 + || out2[i*16 + 14] != in2[i*16 + 14] + 3 + || out2[i*16 + 15] != in2[i*16 + 15] + 2) + + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c new file mode 100644 index 00000000000..770ccfcea50 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-4.c @@ -0,0 +1,58 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 + +short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + int out[N*8]; + + for (i = 0; i < N; i++) + { + out[i*8] = (int) in[i*8] + 1; + out[i*8 + 1] = (int) in[i*8 + 1] + 2; + out[i*8 + 2] = (int) in[i*8 + 2] + 3; + out[i*8 + 3] = (int) in[i*8 + 3] + 4; + out[i*8 + 4] = (int) in[i*8 + 4] + 5; + out[i*8 + 5] = (int) in[i*8 + 5] + 6; + out[i*8 + 6] = (int) in[i*8 + 6] + 7; + out[i*8 + 7] = (int) in[i*8 + 7] + 8; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (out[i*8] != (int) in[i*8] + 1 + || out[i*8 + 1] != (int) in[i*8 + 1] + 2 + || out[i*8 + 2] != (int) in[i*8 + 2] + 3 + || out[i*8 + 3] != (int) in[i*8 + 3] + 4 + || out[i*8 + 4] != (int) in[i*8 + 4] + 5 + || out[i*8 + 5] != (int) in[i*8 + 5] + 6 + || out[i*8 + 6] != (int) in[i*8 + 6] + 7 + || out[i*8 + 7] != (int) in[i*8 + 7] + 8) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c new file mode 100644 index 00000000000..869d87dbcf2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-5.c @@ -0,0 +1,58 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 + +short in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + int out[N*8]; + + for (i = 0; i < N; i++) + { + out[i*8] = (short) in[i*8] + 1; + out[i*8 + 1] = (short) in[i*8 + 1] + 2; + out[i*8 + 2] = (short) in[i*8 + 2] + 3; + out[i*8 + 3] = (short) in[i*8 + 3] + 4; + out[i*8 + 4] = (short) in[i*8 + 4] + 5; + out[i*8 + 5] = (short) in[i*8 + 5] + 6; + out[i*8 + 6] = (short) in[i*8 + 6] + 7; + out[i*8 + 7] = (short) in[i*8 + 7] + 8; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (out[i*8] != (short) in[i*8] + 1 + || out[i*8 + 1] != (short) in[i*8 + 1] + 2 + || out[i*8 + 2] != (short) in[i*8 + 2] + 3 + || out[i*8 + 3] != (short) in[i*8 + 3] + 4 + || out[i*8 + 4] != (short) in[i*8 + 4] + 5 + || out[i*8 + 5] != (short) in[i*8 + 5] + 6 + || out[i*8 + 6] != (short) in[i*8 + 6] + 7 + || out[i*8 + 7] != (short) in[i*8 + 7] + 8) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c new file mode 100644 index 00000000000..34f4f0b845a --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-6.c @@ -0,0 +1,58 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 + +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + unsigned char out[N*8]; + + for (i = 0; i < N; i++) + { + out[i*8] = (unsigned char) in[i*8] + 1; + out[i*8 + 1] = (unsigned char) in[i*8 + 1] + 2; + out[i*8 + 2] = (unsigned char) in[i*8 + 2] + 3; + out[i*8 + 3] = (unsigned char) in[i*8 + 3] + 4; + out[i*8 + 4] = (unsigned char) in[i*8 + 4] + 5; + out[i*8 + 5] = (unsigned char) in[i*8 + 5] + 6; + out[i*8 + 6] = (unsigned char) in[i*8 + 6] + 7; + out[i*8 + 7] = (unsigned char) in[i*8 + 7] + 8; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (out[i*8] != (unsigned char) in[i*8] + 1 + || out[i*8 + 1] != (unsigned char) in[i*8 + 1] + 2 + || out[i*8 + 2] != (unsigned char) in[i*8 + 2] + 3 + || out[i*8 + 3] != (unsigned char) in[i*8 + 3] + 4 + || out[i*8 + 4] != (unsigned char) in[i*8 + 4] + 5 + || out[i*8 + 5] != (unsigned char) in[i*8 + 5] + 6 + || out[i*8 + 6] != (unsigned char) in[i*8 + 6] + 7 + || out[i*8 + 7] != (unsigned char) in[i*8 + 7] + 8) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c new file mode 100644 index 00000000000..8021c494650 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-7.c @@ -0,0 +1,58 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 + +char in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + int out[N*8]; + + for (i = 0; i < N; i++) + { + out[i*8] = (int) in[i*8] + 1; + out[i*8 + 1] = (int) in[i*8 + 1] + 2; + out[i*8 + 2] = (int) in[i*8 + 2] + 3; + out[i*8 + 3] = (int) in[i*8 + 3] + 4; + out[i*8 + 4] = (int) in[i*8 + 4] + 5; + out[i*8 + 5] = (int) in[i*8 + 5] + 6; + out[i*8 + 6] = (int) in[i*8 + 6] + 7; + out[i*8 + 7] = (int) in[i*8 + 7] + 8; + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (out[i*8] != (int) in[i*8] + 1 + || out[i*8 + 1] != (int) in[i*8 + 1] + 2 + || out[i*8 + 2] != (int) in[i*8 + 2] + 3 + || out[i*8 + 3] != (int) in[i*8 + 3] + 4 + || out[i*8 + 4] != (int) in[i*8 + 4] + 5 + || out[i*8 + 5] != (int) in[i*8 + 5] + 6 + || out[i*8 + 6] != (int) in[i*8 + 6] + 7 + || out[i*8 + 7] != (int) in[i*8 + 7] + 8) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c new file mode 100644 index 00000000000..3d3340ae83b --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-8.c @@ -0,0 +1,46 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 + +char in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + int out[N*8]; + + for (i = 0; i < N*4; i++) + { + out[i*2] = (int) in[i*2] + 1; + out[i*2 + 1] = (int) in[i*2 + 1] + 2; + } + + /* check results: */ + for (i = 0; i < N*4; i++) + { + if (out[i*2] != (int) in[i*2] + 1 + || out[i*2 + 1] != (int) in[i*2 + 1] + 2) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c b/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c new file mode 100644 index 00000000000..7d317e2e65f --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-multitypes-9.c @@ -0,0 +1,46 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 8 + +unsigned int in[N*8] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63}; + +__attribute__ ((noinline)) int +main1 () +{ + int i; + unsigned char out[N*8]; + + for (i = 0; i < N*4; i++) + { + out[i*2] = (unsigned char) in[i*2] + 1; + out[i*2 + 1] = (unsigned char) in[i*2 + 1] + 2; + } + + /* check results: */ + for (i = 0; i < N*4; i++) + { + if (out[i*2] != (unsigned char) in[i*2] + 1 + || out[i*2 + 1] != (unsigned char) in[i*2 + 1] + 2) + abort (); + } + + return 0; +} + +int main (void) +{ + check_vect (); + + main1 (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-1.c b/gcc/testsuite/gcc.dg/vect/slp-perm-1.c new file mode 100644 index 00000000000..410758ce293 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-1.c @@ -0,0 +1,60 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define M00 100 +#define M10 216 +#define M20 23 +#define M01 1322 +#define M11 13 +#define M21 27271 +#define M02 74 +#define M12 191 +#define M22 500 + +#define N 16 + +void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) +{ + unsigned int i, a, b, c; + + for (i = 0; i < N / 3; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + + *pOutput++ = M00 * a + M01 * b + M02 * c; + *pOutput++ = M10 * a + M11 * b + M12 * c; + *pOutput++ = M20 * a + M21 * b + M22 * c; + } +} + +int main (int argc, const char* argv[]) +{ + unsigned int input[N], output[N], i; + unsigned int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; + + for (i = 0; i < N; i++) + { + input[i] = i%256; + if (input[i] > 200) + abort(); + output[i] = 0; + } + + foo (input, output); + + for (i = 0; i < N; i++) + if (output[i] != check_results[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-2.c b/gcc/testsuite/gcc.dg/vect/slp-perm-2.c new file mode 100644 index 00000000000..da38a8dd5d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-2.c @@ -0,0 +1,55 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define M00 100 +#define M10 216 +#define M01 1322 +#define M11 13 +#define M02 74 +#define M12 191 + +#define N 16 + +void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) +{ + unsigned int i, a, b; + + for (i = 0; i < N / 2; i++) + { + a = *pInput++; + b = *pInput++; + + *pOutput++ = M00 * a + M01 * b; + *pOutput++ = M10 * a + M11 * b; + } +} + +int main (int argc, const char* argv[]) +{ + unsigned int input[N], output[N], i; + unsigned int check_results[N] = {1322, 13, 4166, 471, 7010, 929, 9854, 1387, 12698, 1845, 15542, 2303, 18386, 2761, 21230, 3219}; + + for (i = 0; i < N; i++) + { + input[i] = i%256; + if (input[i] > 200) + abort(); + output[i] = 0; + } + + foo (input, output); + + for (i = 0; i < N; i++) + if (output[i] != check_results[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-3.c b/gcc/testsuite/gcc.dg/vect/slp-perm-3.c new file mode 100644 index 00000000000..312db31e30c --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-3.c @@ -0,0 +1,70 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define M00 100 +#define M10 216 +#define M20 23 +#define M30 237 +#define M01 1322 +#define M11 13 +#define M21 27271 +#define M31 2280 +#define M02 74 +#define M12 191 +#define M22 500 +#define M32 111 +#define M03 134 +#define M13 117 +#define M23 11 +#define M33 771 + +#define N 16 + +void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) +{ + unsigned int i, a, b, c, d; + + for (i = 0; i < N / 4; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + d = *pInput++; + + *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d; + *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d; + *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d; + *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d; + } +} + +int main (int argc, const char* argv[]) +{ + unsigned int input[N], output[N], i; + unsigned int check_results[N] = {1872, 746, 28304, 4815, 8392, 2894, 139524, 18411, 14912, 5042, 250744, 32007, 21432, 7190, 361964, 45603}; + + for (i = 0; i < N; i++) + { + input[i] = i%256; + if (input[i] > 200) + abort(); + output[i] = 0; + } + + foo (input, output); + + for (i = 0; i < N - N; i++) + if (output[i] != check_results[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-4.c b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c new file mode 100644 index 00000000000..f4db75d000e --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-4.c @@ -0,0 +1,85 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define M00 100 +#define M10 216 +#define M20 23 +#define M30 237 +#define M40 437 + +#define M01 1322 +#define M11 13 +#define M21 27271 +#define M31 2280 +#define M41 284 + +#define M02 74 +#define M12 191 +#define M22 500 +#define M32 111 +#define M42 1114 + +#define M03 134 +#define M13 117 +#define M23 11 +#define M33 771 +#define M43 71 + +#define M04 334 +#define M14 147 +#define M24 115 +#define M34 7716 +#define M44 16 + +#define N 16 + +void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput) +{ + unsigned int i, a, b, c, d, e; + + for (i = 0; i < N / 5; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + d = *pInput++; + e = *pInput++; + + *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e; + *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e; + *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e; + *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e; + *pOutput++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e; + } +} + +int main (int argc, const char* argv[]) +{ + unsigned int input[N], output[N], i; + unsigned int check_results[N] = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, 22848, 8174, 307964, 146829, 22009, 0}; + + for (i = 0; i < N; i++) + { + input[i] = i%256; + if (input[i] > 200) + abort(); + output[i] = 0; + } + + foo (input, output); + + for (i = 0; i < N - N; i++) + if (output[i] != check_results[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-5.c b/gcc/testsuite/gcc.dg/vect/slp-perm-5.c new file mode 100644 index 00000000000..ca59a5e014b --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-5.c @@ -0,0 +1,77 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define M00 100 +#define M10 216 +#define M20 23 +#define M01 1322 +#define M11 13 +#define M21 27271 +#define M02 74 +#define M12 191 +#define M22 500 + +#define K00 405 +#define K10 112 +#define K01 4322 +#define K11 135 + +#define N 16 + +void foo (int *__restrict__ pInput, int *__restrict__ pOutput, + int *__restrict__ pInput2, int *__restrict__ pOutput2) +{ + int i, a, b, c, d, e; + + for (i = 0; i < N / 3; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + + d = *pInput2++; + e = *pInput2++; + + *pOutput++ = M00 * a + M01 * b + M02 * c; + *pOutput++ = M10 * a + M11 * b + M12 * c; + *pOutput++ = M20 * a + M21 * b + M22 * c; + + *pOutput2++ = K00 * d + K01 * e; + *pOutput2++ = K10 * d + K11 * e; + } +} + +int main (int argc, const char* argv[]) +{ + int input[N], output[N], i; + int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; + int input2[N], output2[N]; + int check_results2[N] = {4322, 135, 13776, 629, 23230, 1123, 32684, 1617, 42138, 2111, 0, 0, 0, 0, 0, 0}; + + for (i = 0; i < N; i++) + { + input[i] = i%256; + input2[i] = i%256; + output[i] = 0; + output2[i] = 0; + if (input[i] > 256) + abort (); + } + + foo (input, output, input2, output2); + + for (i = 0; i < N; i++) + if (output[i] != check_results[i] || output2[i] != check_results2[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-6.c b/gcc/testsuite/gcc.dg/vect/slp-perm-6.c new file mode 100644 index 00000000000..ff9be8aa8e2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-6.c @@ -0,0 +1,77 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define M00 100 +#define M10 216 +#define M20 23 +#define M01 1322 +#define M11 13 +#define M21 27271 +#define M02 74 +#define M12 191 +#define M22 500 + +#define K00 405 +#define K10 112 +#define K01 4322 +#define K11 135 + +#define N 16 + +void foo (int *__restrict__ pInput, int *__restrict__ pOutput, + int *__restrict__ pInput2, int *__restrict__ pOutput2) +{ + int i, a, b, c, d, e; + + for (i = 0; i < N / 3; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + + d = *pInput2++; + e = *pInput2++; + + *pOutput++ = M00 * a + M01 * b + M02 * c; + *pOutput++ = M10 * a + M11 * b + M12 * c; + *pOutput++ = M20 * a + M21 * b + M22 * c; + + /* Regular SLP - no permutation required. */ + *pOutput2++ = K00 * d; + *pOutput2++ = K10 * e; + } +} + +int main (int argc, const char* argv[]) +{ + int input[N], output[N], i; + int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; + int input2[N], output2[N]; + int check_results2[N] = {0, 112, 810, 336, 1620, 560, 2430, 784, 3240, 1008, 0, 0, 0, 0, 0, 0}; + + for (i = 0; i < N; i++) + { + input[i] = i%256; + input2[i] = i%256; + output[i] = 0; + output2[i] = 0; + if (input[i] > 256) + abort (); + } + + foo (input, output, input2, output2); + + for (i = 0; i < N; i++) + if (output[i] != check_results[i] || output2[i] != check_results2[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-7.c b/gcc/testsuite/gcc.dg/vect/slp-perm-7.c new file mode 100644 index 00000000000..0065407e238 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-7.c @@ -0,0 +1,76 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define M00 100 +#define M10 216 +#define M20 23 +#define M01 1322 +#define M11 13 +#define M21 27271 +#define M02 74 +#define M12 191 +#define M22 500 + +#define K00 405 +#define K10 112 +#define K01 4322 +#define K11 135 + +#define N 16 + +/* SLP with load permutation and loop-based vectorization. */ +void foo (int *__restrict__ pInput, int *__restrict__ pOutput, + int *__restrict__ pInput2, int *__restrict__ pOutput2) +{ + int i, a, b, c, d; + + for (i = 0; i < N / 3; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + d = *pInput2++; + + *pOutput++ = M00 * a + M01 * b + M02 * c; + *pOutput++ = M10 * a + M11 * b + M12 * c; + *pOutput++ = M20 * a + M21 * b + M22 * c; + + /* Loop-based vectorization. */ + *pOutput2++ = K00 * d; + } +} + +int main (int argc, const char* argv[]) +{ + int input[N], output[N], i; + int check_results[N] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0}; + int input2[N], output2[N]; + int check_results2[N] = {0, 405, 810, 1215, 1620, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + + for (i = 0; i < N; i++) + { + input[i] = i%256; + input2[i] = i%256; + output[i] = 0; + output2[i] = 0; + if (input[i] > 200) + abort (); + } + + foo (input, output, input2, output2); + + for (i = 0; i < N; i++) + if (output[i] != check_results[i] || output2[i] != check_results2[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-8.c b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c new file mode 100644 index 00000000000..8c60d44ed0c --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-8.c @@ -0,0 +1,57 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 200 + +void foo (unsigned char *__restrict__ pInput, unsigned char *__restrict__ pOutput) +{ + unsigned char i, a, b, c; + + for (i = 0; i < N / 3; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + + *pOutput++ = a + b + c + 3; + *pOutput++ = a + b + c + 12; + *pOutput++ = a + b + c + 1; + } +} + +int main (int argc, const char* argv[]) +{ + unsigned char input[N], output[N], i; + unsigned char check_results[N]; + + for (i = 0; i < N; i++) + { + input[i] = i; + output[i] = 0; + if (input[i] > 256) + abort (); + } + + for (i = 0; i < N / 3; i++) + { + check_results[3*i] = 9 * i + 6; + check_results[3*i+1] = 9 * i + 15; + check_results[3*i+2] = 9 * i + 4; + } + + foo (input, output); + + for (i = 0; i < N - (N % 3); i++) + if (output[i] != check_results[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_perm } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c new file mode 100644 index 00000000000..964e691cc68 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c @@ -0,0 +1,58 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include <stdio.h> +#include "tree-vect.h" + +#define N 200 + +void foo (unsigned short *__restrict__ pInput, unsigned short *__restrict__ pOutput) +{ + unsigned short i, a, b, c; + + for (i = 0; i < N / 3; i++) + { + a = *pInput++; + b = *pInput++; + c = *pInput++; + + *pOutput++ = a + b + c + 3; + *pOutput++ = a + b + c + 12; + *pOutput++ = a + b + c + 1; + } +} + +int main (int argc, const char* argv[]) +{ + unsigned short input[N], output[N], i; + unsigned short check_results[N]; + + for (i = 0; i < N; i++) + { + input[i] = i; + output[i] = 0; + if (input[i] > 256) + abort (); + } + + for (i = 0; i < N / 3; i++) + { + check_results[3*i] = 9 * i + 6; + check_results[3*i+1] = 9 * i + 15; + check_results[3*i+2] = 9 * i + 4; + } + + foo (input, output); + + for (i = 0; i < N - (N % 3); i++) + if (output[i] != check_results[i]) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c new file mode 100644 index 00000000000..ebc4b5069b5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-s16.c @@ -0,0 +1,47 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 64 + +short X[N] __attribute__ ((__aligned__(16))); +short Y[N] __attribute__ ((__aligned__(16))); +int result[N]; + +/* short->int widening-mult */ +__attribute__ ((noinline)) int +foo1(int len) { + int i; + + for (i=0; i<len/2; i++) { + result[2*i] = X[2*i] * Y[2*i]; + result[2*i+1] = X[2*i+1] * Y[2*i+1]; + } +} + +int main (void) +{ + int i; + + check_vect (); + + for (i=0; i<N; i++) { + X[i] = i; + Y[i] = 64-i; + } + + foo1 (N); + + for (i=0; i<N; i++) { + if (result[i] != X[i] * Y[i]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_inpack } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_inpack } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c new file mode 100644 index 00000000000..16bf5781684 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c @@ -0,0 +1,49 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 64 + +unsigned char X[N] __attribute__ ((__aligned__(16))); +unsigned char Y[N] __attribute__ ((__aligned__(16))); +unsigned short result[N]; + +/* char->short widening-mult */ +__attribute__ ((noinline)) int +foo1(int len) { + int i; + + for (i=0; i<len/2; i++) { + result[2*i] = X[2*i] * Y[2*i]; + result[2*i+1] = X[2*i+1] * Y[2*i+1]; + } +} + +int main (void) +{ + int i; + + check_vect (); + + for (i=0; i<N; i++) { + X[i] = i; + Y[i] = 64-i; + if (i % 5) + X[i] = i; + } + + foo1 (N); + + for (i=0; i<N; i++) { + if (result[i] != X[i] * Y[i]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_qi_to_hi || vect_unpack } } } } */ +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_widen_mult_hi_to_si || vect_unpack } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/vect-107.c b/gcc/testsuite/gcc.dg/vect/vect-107.c index 514fc362068..201d4ab4e34 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-107.c +++ b/gcc/testsuite/gcc.dg/vect/vect-107.c @@ -5,14 +5,15 @@ #define N 16 +float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; +float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30}; + __attribute__ ((noinline)) int main1 (void) { int i; float a[N]; - float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; - float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30}; /* Strided access. Vectorizable on platforms that support load of strided accesses (extract of even/odd vector elements). */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-108.c b/gcc/testsuite/gcc.dg/vect/vect-108.c index 56700aa18b6..28e85b2e9c0 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-108.c +++ b/gcc/testsuite/gcc.dg/vect/vect-108.c @@ -5,13 +5,14 @@ #define N 16 +int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +int ia[N]; + __attribute__ ((noinline)) int main1 (void) { int i; - int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - int ia[N]; /* This loop is vectorized on platforms that support vect_int_mult. */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-11.c b/gcc/testsuite/gcc.dg/vect/vect-11.c index 46cc19ad337..3df8f47b5f5 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-11.c +++ b/gcc/testsuite/gcc.dg/vect/vect-11.c @@ -6,13 +6,14 @@ #define N 16 +int ia[N]; +int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + __attribute__ ((noinline)) int main1 () { int i; - int ia[N]; - int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; /* Not vectorizable yet (integer mult). */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-112.c b/gcc/testsuite/gcc.dg/vect/vect-112.c index 0bc185b361e..4d954d10829 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-112.c +++ b/gcc/testsuite/gcc.dg/vect/vect-112.c @@ -5,13 +5,14 @@ #define N 16 +char cb[N] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}; +char cc[N] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; + __attribute__ ((noinline)) int main1 (void) { int i; int diff = 0; - char cb[N] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}; - char cc[N] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; /* Cross-iteration cycle. */ diff = 0; diff --git a/gcc/testsuite/gcc.dg/vect/vect-115.c b/gcc/testsuite/gcc.dg/vect/vect-115.c index ed1d6794fb1..ce6eaf45488 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-115.c +++ b/gcc/testsuite/gcc.dg/vect/vect-115.c @@ -23,12 +23,13 @@ struct test1{ int l; }; +int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) int main1 () { int i; struct test1 tmp1; - int a[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; struct t tmp2; tmp1.ptr_t = &tmp2; diff --git a/gcc/testsuite/gcc.dg/vect/vect-11a.c b/gcc/testsuite/gcc.dg/vect/vect-11a.c index 75b1035df4d..2da903b1bc4 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-11a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-11a.c @@ -6,16 +6,17 @@ extern void abort (void); +unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001, + 0x08000000,0xffffffff,0xff0000ff,0xf0000001}; +unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001, + 0x08000000,0x08000001,0xff0000ff,0xf0000001}; +unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001, + 0,0xf7ffffff,0x0200fe01,0xe0000001}; +unsigned int C[8]; + __attribute__ ((noinline)) void u () { - unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001, - 0x08000000,0xffffffff,0xff0000ff,0xf0000001}; - unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001, - 0x08000000,0x08000001,0xff0000ff,0xf0000001}; - unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001, - 0,0xf7ffffff,0x0200fe01,0xe0000001}; - unsigned int C[8]; int i, j; for (i=0; i<8; i++) @@ -25,22 +26,23 @@ void u () abort (); } +signed int D[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001, + 0x08000000,0xffffffff,0xff0000ff,0xf0000001}; +signed int E[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001, + 0x08000000,0x08000001,0xff0000ff,0xf0000001}; +signed int Dnswer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001, + 0,0xf7ffffff,0x0200fe01, 0xe0000001}; +signed int F[8]; + __attribute__ ((noinline)) void s() { - signed int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001, - 0x08000000,0xffffffff,0xff0000ff,0xf0000001}; - signed int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001, - 0x08000000,0x08000001,0xff0000ff,0xf0000001}; - signed int Answer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001, - 0,0xf7ffffff,0x0200fe01, 0xe0000001}; - signed int C[8]; int i, j; for (i=0; i<8; i++) - C[i] = A[i] * B[i]; + F[i] = D[i] * E[i]; for (i=0; i<8; i++) - if (C[i] != Answer[i]) + if (F[i] != Dnswer[i]) abort (); } diff --git a/gcc/testsuite/gcc.dg/vect/vect-34.c b/gcc/testsuite/gcc.dg/vect/vect-34.c index 4e80bd4cbf2..df18f774e5d 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-34.c +++ b/gcc/testsuite/gcc.dg/vect/vect-34.c @@ -4,15 +4,16 @@ #include "tree-vect.h" #define N 16 + +struct { + char ca[N]; +} s; +char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; __attribute__ ((noinline)) int main1 () { int i; - struct { - char ca[N]; - } s; - char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; for (i = 0; i < N; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/vect-9.c b/gcc/testsuite/gcc.dg/vect/vect-9.c index 3a4036765fa..c11784a4b2b 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-9.c +++ b/gcc/testsuite/gcc.dg/vect/vect-9.c @@ -5,12 +5,13 @@ #define N 16 +short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +int ia[N]; + __attribute__ ((noinline)) int main1 () { int i; - short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - int ia[N]; /* Requires type promotion (vector unpacking) support. */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-97.c b/gcc/testsuite/gcc.dg/vect/vect-97.c index 527aeef14aa..c95c503c941 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-97.c +++ b/gcc/testsuite/gcc.dg/vect/vect-97.c @@ -5,6 +5,9 @@ #define N 16 +char x[N] __attribute__ ((__aligned__(16))); +char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + __attribute__ ((noinline)) int main1 () { @@ -13,8 +16,6 @@ int main1 () char *q; } s; int i; - char x[N] __attribute__ ((__aligned__(16))); - char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; /* Check that datarefs analysis can determine that the access via pointer s.p is based off array x, which enables us to antialias this access from diff --git a/gcc/testsuite/gcc.dg/vect/vect-align-1.c b/gcc/testsuite/gcc.dg/vect/vect-align-1.c index a0f078c31f0..f6bf22da93e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-align-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-align-1.c @@ -14,11 +14,12 @@ struct foo { int y[N]; } __attribute__((packed)); +int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) int main1 (struct foo * __restrict__ p) { int i; - int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; for (i = 0; i < N; i++) { diff --git a/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c b/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c index 1647193bd63..3035ee392b3 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c @@ -5,12 +5,13 @@ #define N 32 +float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5}; +double da[N]; + __attribute__ ((noinline)) int main1 () { int i; - float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5}; - double da[N]; /* float -> double */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c index d9b22288145..e5b72f1acab 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-1.c @@ -5,12 +5,13 @@ #define N 32 +float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5}; +int ia[N]; + __attribute__ ((noinline)) int main1 () { int i; - float fb[N] = {0.4,3.5,6.6,9.4,12.5,15.6,18.4,21.5,24.6,27.4,30.5,33.6,36.4,39.5,42.6,45.4,0.5,3.6,6.4,9.5,12.6,15.4,18.5,21.6,24.4,27.5,30.6,33.4,36.5,39.6,42.4,45.5}; - int ia[N]; /* float -> int */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-fold-1.c b/gcc/testsuite/gcc.dg/vect/vect-fold-1.c index 88b68b7cf4a..8aca1e42063 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-fold-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-fold-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom1" } */ +/* { dg-options "-O2 -fdump-tree-ccp1" } */ typedef unsigned char v4qi __attribute__ ((vector_size (4))); @@ -12,5 +12,5 @@ void foo() c = a + b; } -/* { dg-final { scan-tree-dump-times "c = { 6, 8, 10, 12 }" 1 "dom1" } } */ -/* { dg-final { cleanup-tree-dump "dom1" } } */ +/* { dg-final { scan-tree-dump-times "c =.* { 6, 8, 10, 12 }" 1 "ccp1" } } */ +/* { dg-final { cleanup-tree-dump "ccp1" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c index de7da97efa3..8071c87d09c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-16.c @@ -10,10 +10,11 @@ extern void abort(void); +float A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11}; +float B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42}; + int main () { - float A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11}; - float B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c index 0a497b524bd..a02c8984e58 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-17.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11}; +float B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42}; + extern void abort(void); int main () { - float A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11}; - float B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c index a89bd8f88f7..e899f126d8c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0}; + extern void abort(void); int main () { - int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c index 902b1549fa0..1d8e9f52b23 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +int B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0}; + extern void abort(void); int main () { - int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - int B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c index a057ccbd0c0..1680cba8a88 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +int B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42}; + extern void abort(void); int main () { - int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - int B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c index 879741062aa..5fc9674b317 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; +int B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42}; + extern void abort(void); int main () { - int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11}; - int B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c index f2330bd6aa9..24e8c969e1c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +int A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11}; +int B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42}; + extern void abort(void); int main () { - int A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11}; - int B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c index fa89d832890..fa4cf3a58fa 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c +++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c @@ -8,12 +8,13 @@ #define N 16 #define MAX 42 +int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11}; +int B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42}; + extern void abort(void); int main () { - int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11}; - int B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42}; int i, j; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c index d3d049186b0..90f33a508a6 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-1.c @@ -5,11 +5,12 @@ #define N 32 +int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +float fa[N]; + __attribute__ ((noinline)) int main1 () { int i; - int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - float fa[N]; /* int -> float */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c index 10c49d6279e..87f200119d6 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-2.c @@ -5,12 +5,13 @@ #define N 32 +int int_arr[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +float float_arr[N]; +char char_arr[N]; + __attribute__ ((noinline)) int main1 () { int i; - int int_arr[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - float float_arr[N]; - char char_arr[N]; for (i = 0; i < N; i++){ float_arr[i] = (float) int_arr[i]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c index 0da79774967..d5f25df7190 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c +++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c @@ -5,11 +5,12 @@ #define N 32 +int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +double da[N]; + __attribute__ ((noinline)) int main1 () { int i; - int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - double da[N]; /* int -> double */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c index 4223c378d42..af8344ba600 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c +++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4a.c @@ -5,11 +5,12 @@ #define N 32 +short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,-3,-6,-9,-12,-15,-18,-21,-24,-27,-30,-33,-36,-39,-42,-45}; +float fa[N]; + __attribute__ ((noinline)) int main1 () { int i; - short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,-3,-6,-9,-12,-15,-18,-21,-24,-27,-30,-33,-36,-39,-42,-45}; - float fa[N]; /* short -> float */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c index 29af8e5f53a..51ea056fa1d 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c +++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-4b.c @@ -5,11 +5,12 @@ #define N 32 +unsigned short usb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,65533,65530,65527,65524,65521,65518,65515,65512,65509,65506,65503,65500,65497,65494,65491}; +float fa[N]; + __attribute__ ((noinline)) int main1 () { int i; - unsigned short usb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,65533,65530,65527,65524,65521,65518,65515,65512,65509,65506,65503,65500,65497,65494,65491}; - float fa[N]; /* unsigned short -> float */ for (i = 0; i < N; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c new file mode 100644 index 00000000000..b5347ebecc3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-16.c @@ -0,0 +1,46 @@ +/* { dg-require-effective-target vect_long_long } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 64 + +char x[N] __attribute__ ((__aligned__(16))); + +__attribute__ ((noinline)) int +foo (int len, long long *z) { + int i; + + for (i=0; i<len; i++) { + z[i] = x[i]; + } +} + + +int main (void) +{ + char i; + long long z[N+4]; + + check_vect (); + + for (i=0; i<N; i++) { + x[i] = i; + if (i % 5) + x[i] = i; + } + + foo (N,z+2); + + for (i=0; i<N; i++) { + if (z[i+2] != x[i]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_unpack } } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c new file mode 100644 index 00000000000..61670e6995e --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-17.c @@ -0,0 +1,52 @@ +/* { dg-require-effective-target vect_long_long } */ + +#include <stdarg.h> +#include "tree-vect.h" + +#define N 64 + +unsigned char uX[N] __attribute__ ((__aligned__(16))); +unsigned char uresultX[N]; +unsigned long long uY[N] __attribute__ ((__aligned__(16))); +unsigned char uresultY[N]; + +/* Unsigned type demotion (si->qi) */ + +__attribute__ ((noinline)) int +foo1(int len) { + int i; + + for (i=0; i<len; i++) { + uresultX[i] = uX[i]; + uresultY[i] = (unsigned char)uY[i]; + } +} + +int main (void) +{ + int i; + + check_vect (); + + for (i=0; i<N; i++) { + uX[i] = 16-i; + uY[i] = 16-i; + if (i%5 == 0) + uX[i] = 16-i; + } + + foo1 (N); + + for (i=0; i<N; i++) { + if (uresultX[i] != uX[i]) + abort (); + if (uresultY[i] != (unsigned char)uY[i]) + abort (); + } + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_pack_trunc } } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c index 6abe9f5fb06..4ae47f2c58e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-2.c @@ -5,15 +5,16 @@ #define N 32 +int ia[N]; +int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +short sa[N]; +short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +char ca[N]; +char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + __attribute__ ((noinline)) int main1 () { int i; - int ia[N]; - int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - short sa[N]; - short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - char ca[N]; - char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; /* Multiple types with different sizes, used in independent cmputations. Vectorizable. All accesses aligned. */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c index 33da531bb54..bfa95524b54 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c +++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-5.c @@ -5,19 +5,20 @@ #define N 32 +unsigned int ia[N]; +unsigned int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned short sa[N]; +unsigned short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char ca[N]; +unsigned char cc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + __attribute__ ((noinline)) int main1 () { int i; - unsigned int ia[N]; - unsigned int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned short sa[N]; - unsigned short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char ca[N]; - unsigned char cc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; /* Multiple types with different sizes, used in independent computations. Vectorizable. All accesses aligned. */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c index 63cd3c03baf..dbb154d1233 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1.c @@ -6,14 +6,15 @@ #define N 16 #define DIFF 242 +unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + /* Test vectorization of reduction of unsigned-int. */ __attribute__ ((noinline)) void main1 (unsigned int x, unsigned int max_result, unsigned int min_result) { int i; - unsigned int ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned int uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned int udiff = 2; unsigned int umax = x; unsigned int umin = x; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c index bf053dc0b27..5a1c03d113f 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c @@ -6,12 +6,13 @@ #define N 16 #define DIFF 242 +unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (unsigned char x, unsigned char max_result, unsigned char min_result) { int i; - unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned char udiff = 2; unsigned char umax = x; unsigned char umin = x; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c index 0947ca3c70e..145722a1946 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-1short.c @@ -6,12 +6,13 @@ #define N 16 #define DIFF 242 +unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (unsigned short x, unsigned short max_result, unsigned short min_result) { int i; - unsigned short ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned short uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned short udiff = 2; unsigned short umax = x; unsigned short umin = x; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c index b23dfbaf7ea..912e69c93c2 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-2.c @@ -6,14 +6,15 @@ #define N 16 #define DIFF 240 +int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + /* Test vectorization of reduction of signed-int. */ __attribute__ ((noinline)) void main1 (int x, int max_result, int min_result) { int i; - int b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - int c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; int diff = 0; int max = x; int min = x; diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c index 49214201fb3..3e6f17c485a 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-3.c @@ -5,6 +5,9 @@ #define N 16 +unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + /* Test vectorization of reduction of unsigned-int in the presence of unknown-loop-bound. */ @@ -12,8 +15,6 @@ __attribute__ ((noinline)) int main1 (int n, int res) { int i; - unsigned int ub[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - unsigned int uc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; unsigned int udiff; udiff = 0; diff --git a/gcc/testsuite/gcc.dg/vect/vect-shift-1.c b/gcc/testsuite/gcc.dg/vect/vect-shift-1.c index 346fffee102..79699047eda 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-shift-1.c +++ b/gcc/testsuite/gcc.dg/vect/vect-shift-1.c @@ -6,12 +6,13 @@ #define N 8 +unsigned int A[N] = { 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001, + 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001 }; +unsigned int B[N] = { 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000, + 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000 }; + int main () { - unsigned int A[N] = { 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001, - 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001 }; - unsigned int B[N] = { 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000, - 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000 }; int i; check_vect (); diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-float.c b/gcc/testsuite/gcc.dg/vect/vect-strided-float.c index 2417f2acd39..38c50b9cd43 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-float.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-float.c @@ -5,13 +5,14 @@ #define N 16 +float b[N*2] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93}; +float c[N*2] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; + __attribute__ ((noinline)) int main1 (void) { int i; float a[N*2]; - float b[N*2] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93}; - float c[N*2] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; /* Strided access pattern. */ for (i = 0; i < N/2; i++) diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c index ecc567c1944..1eaad435416 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-store-u32-i2.c @@ -6,13 +6,14 @@ #define N 16 +int a[N*2]; +int b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30}; +int c[N] = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31}; + __attribute__ ((noinline)) int main1 (void) { int i; - int a[N*2]; - int b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30}; - int c[N] = {1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31}; /* Strided access pattern. */ for (i = 0; i < N/2; i++) diff --git a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c index 560229f1ebb..4b04a9d41c3 100644 --- a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c +++ b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2char.c @@ -6,12 +6,13 @@ #define N 16 #define DIFF 121 +signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30}; +signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (signed char x, signed char max_result, signed char min_result) { int i; - signed char b[N] = {1,2,3,6,8,10,12,14,16,18,20,22,24,26,28,30}; - signed char c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; signed char diff = 2; signed char max = x; signed char min = x; diff --git a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c index e6e8c6ffe95..0468b1966b9 100644 --- a/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c +++ b/gcc/testsuite/gcc.dg/vect/wrapv-vect-reduc-2short.c @@ -6,12 +6,13 @@ #define N 16 #define DIFF 242 +short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; +short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + __attribute__ ((noinline)) void main1 (short x, short max_result, short min_result) { int i; - short b[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; - short c[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; short diff = 2; short max = x; short min = x; diff --git a/gcc/testsuite/gcc.target/i386/aes-avx-check.h b/gcc/testsuite/gcc.target/i386/aes-avx-check.h new file mode 100644 index 00000000000..e73e36eab25 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/aes-avx-check.h @@ -0,0 +1,31 @@ +#ifdef DEBUG +#include <stdio.h> +#endif +#include <stdlib.h> +#include "cpuid.h" + +static void aes_avx_test (void); + +int +main () +{ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run AES + AVX test only if host has AES + AVX support. */ + if ((ecx & (bit_AVX | bit_AES)) == (bit_AVX | bit_AES)) + { + aes_avx_test (); +#ifdef DEBUG + printf ("PASSED\n"); +#endif + } +#ifdef DEBUG + else + printf ("SKIPPED\n"); +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/aesdec.c b/gcc/testsuite/gcc.target/i386/aesdec.c index 0cf0d855d22..affe3d19ccc 100644 --- a/gcc/testsuite/gcc.target/i386/aesdec.c +++ b/gcc/testsuite/gcc.target/i386/aesdec.c @@ -2,11 +2,19 @@ /* { dg-require-effective-target aes } */ /* { dg-options "-O2 -maes" } */ +#ifndef CHECK_H +#define CHECK_H "aes-check.h" +#endif + +#ifndef TEST +#define TEST aes_test +#endif + +#include CHECK_H + #include <wmmintrin.h> #include <string.h> -#include "aes-check.h" - extern void abort (void); #define NUM 1024 @@ -35,7 +43,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d) } static void -aes_test (void) +TEST (void) { int i; diff --git a/gcc/testsuite/gcc.target/i386/aesdeclast.c b/gcc/testsuite/gcc.target/i386/aesdeclast.c index 3bf360ec624..417264a134f 100644 --- a/gcc/testsuite/gcc.target/i386/aesdeclast.c +++ b/gcc/testsuite/gcc.target/i386/aesdeclast.c @@ -2,11 +2,19 @@ /* { dg-require-effective-target aes } */ /* { dg-options "-O2 -maes" } */ +#ifndef CHECK_H +#define CHECK_H "aes-check.h" +#endif + +#ifndef TEST +#define TEST aes_test +#endif + +#include CHECK_H + #include <wmmintrin.h> #include <string.h> -#include "aes-check.h" - extern void abort (void); #define NUM 1024 @@ -37,7 +45,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d) } static void -aes_test (void) +TEST (void) { int i; diff --git a/gcc/testsuite/gcc.target/i386/aesenc.c b/gcc/testsuite/gcc.target/i386/aesenc.c index f94a5bcccb1..d2a8b603188 100644 --- a/gcc/testsuite/gcc.target/i386/aesenc.c +++ b/gcc/testsuite/gcc.target/i386/aesenc.c @@ -2,11 +2,19 @@ /* { dg-require-effective-target aes } */ /* { dg-options "-O2 -maes" } */ +#ifndef CHECK_H +#define CHECK_H "aes-check.h" +#endif + +#ifndef TEST +#define TEST aes_test +#endif + +#include CHECK_H + #include <wmmintrin.h> #include <string.h> -#include "aes-check.h" - extern void abort (void); #define NUM 1024 @@ -36,7 +44,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d) } static void -aes_test (void) +TEST (void) { int i; diff --git a/gcc/testsuite/gcc.target/i386/aesenclast.c b/gcc/testsuite/gcc.target/i386/aesenclast.c index 0786316bc57..fd72597e9a4 100644 --- a/gcc/testsuite/gcc.target/i386/aesenclast.c +++ b/gcc/testsuite/gcc.target/i386/aesenclast.c @@ -2,11 +2,19 @@ /* { dg-require-effective-target aes } */ /* { dg-options "-O2 -maes" } */ +#ifndef CHECK_H +#define CHECK_H "aes-check.h" +#endif + +#ifndef TEST +#define TEST aes_test +#endif + +#include CHECK_H + #include <wmmintrin.h> #include <string.h> -#include "aes-check.h" - extern void abort (void); #define NUM 1024 @@ -36,7 +44,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d) } static void -aes_test (void) +TEST (void) { int i; diff --git a/gcc/testsuite/gcc.target/i386/aesimc.c b/gcc/testsuite/gcc.target/i386/aesimc.c index ea56fe870dc..676f919f597 100644 --- a/gcc/testsuite/gcc.target/i386/aesimc.c +++ b/gcc/testsuite/gcc.target/i386/aesimc.c @@ -2,11 +2,19 @@ /* { dg-require-effective-target aes } */ /* { dg-options "-O2 -maes" } */ +#ifndef CHECK_H +#define CHECK_H "aes-check.h" +#endif + +#ifndef TEST +#define TEST aes_test +#endif + +#include CHECK_H + #include <wmmintrin.h> #include <string.h> -#include "aes-check.h" - extern void abort (void); #define NUM 1024 @@ -34,7 +42,7 @@ init_data (__m128i *s1, __m128i *d) } static void -aes_test (void) +TEST (void) { int i; diff --git a/gcc/testsuite/gcc.target/i386/aeskeygenassist.c b/gcc/testsuite/gcc.target/i386/aeskeygenassist.c index 2fc8ad7efb0..f033bd6a032 100644 --- a/gcc/testsuite/gcc.target/i386/aeskeygenassist.c +++ b/gcc/testsuite/gcc.target/i386/aeskeygenassist.c @@ -2,11 +2,19 @@ /* { dg-require-effective-target aes } */ /* { dg-options "-O2 -maes" } */ +#ifndef CHECK_H +#define CHECK_H "aes-check.h" +#endif + +#ifndef TEST +#define TEST aes_test +#endif + +#include CHECK_H + #include <wmmintrin.h> #include <string.h> -#include "aes-check.h" - extern void abort (void); #define NUM 1024 @@ -34,7 +42,7 @@ init_data (__m128i *s1, __m128i *d) } static void -aes_test (void) +TEST (void) { int i; diff --git a/gcc/testsuite/gcc.target/i386/avx-1.c b/gcc/testsuite/gcc.target/i386/avx-1.c new file mode 100644 index 00000000000..3cda080a3df --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-1.c @@ -0,0 +1,139 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -msse5 -maes -mpclmul" } */ + +#include <mm_malloc.h> + +/* Test that the intrinsics compile with optimization. All of them are + defined as inline functions in {,x,e,p,t,s,w,g,a,b}mmintrin.h and + mm3dnow.h that reference the proper builtin functions. Defining away + "extern" and "__inline" results in all of them being compiled as proper + functions. */ + +#define extern +#define __inline + +/* Following intrinsics require immediate arguments. */ + +/* ammintrin.h */ +#define __builtin_ia32_extrqi(X, I, L) __builtin_ia32_extrqi(X, 1, 1) +#define __builtin_ia32_insertqi(X, Y, I, L) __builtin_ia32_insertqi(X, Y, 1, 1) + +/* gmmintrin.h */ +#define __builtin_ia32_blendpd256(X, Y, M) __builtin_ia32_blendpd256(X, Y, 1) +#define __builtin_ia32_blendps256(X, Y, M) __builtin_ia32_blendps256(X, Y, 1) +#define __builtin_ia32_dpps256(X, Y, M) __builtin_ia32_dpps256(X, Y, 1) +#define __builtin_ia32_shufpd256(X, Y, M) __builtin_ia32_shufpd256(X, Y, 1) +#define __builtin_ia32_shufps256(X, Y, M) __builtin_ia32_shufps256(X, Y, 1) +#define __builtin_ia32_cmpsd(X, Y, O) __builtin_ia32_cmpsd(X, Y, 1) +#define __builtin_ia32_cmpss(X, Y, O) __builtin_ia32_cmpss(X, Y, 1) +#define __builtin_ia32_cmppd(X, Y, O) __builtin_ia32_cmppd(X, Y, 1) +#define __builtin_ia32_cmpps(X, Y, O) __builtin_ia32_cmpps(X, Y, 1) +#define __builtin_ia32_cmppd256(X, Y, O) __builtin_ia32_cmppd256(X, Y, 1) +#define __builtin_ia32_cmpps256(X, Y, O) __builtin_ia32_cmpps256(X, Y, 1) +#define __builtin_ia32_vextractf128_pd256(X, N) __builtin_ia32_vextractf128_pd256(X, 1) +#define __builtin_ia32_vextractf128_ps256(X, N) __builtin_ia32_vextractf128_ps256(X, 1) +#define __builtin_ia32_vextractf128_si256(X, N) __builtin_ia32_vextractf128_si256(X, 1) +#define __builtin_ia32_vpermilpd(X, N) __builtin_ia32_vpermilpd(X, 1) +#define __builtin_ia32_vpermilpd256(X, N) __builtin_ia32_vpermilpd256(X, 1) +#define __builtin_ia32_vpermilps(X, N) __builtin_ia32_vpermilps(X, 1) +#define __builtin_ia32_vpermilps256(X, N) __builtin_ia32_vpermilps256(X, 1) +#define __builtin_ia32_vpermil2pd(X, Y, C, I) __builtin_ia32_vpermil2pd(X, Y, C, 1) +#define __builtin_ia32_vpermil2pd256(X, Y, C, I) __builtin_ia32_vpermil2pd256(X, Y, C, 1) +#define __builtin_ia32_vpermil2ps(X, Y, C, I) __builtin_ia32_vpermil2ps(X, Y, C, 1) +#define __builtin_ia32_vpermil2ps256(X, Y, C, I) __builtin_ia32_vpermil2ps256(X, Y, C, 1) +#define __builtin_ia32_vperm2f128_pd256(X, Y, C) __builtin_ia32_vperm2f128_pd256(X, Y, 1) +#define __builtin_ia32_vperm2f128_ps256(X, Y, C) __builtin_ia32_vperm2f128_ps256(X, Y, 1) +#define __builtin_ia32_vperm2f128_si256(X, Y, C) __builtin_ia32_vperm2f128_si256(X, Y, 1) +#define __builtin_ia32_vinsertf128_pd256(X, Y, C) __builtin_ia32_vinsertf128_pd256(X, Y, 1) +#define __builtin_ia32_vinsertf128_ps256(X, Y, C) __builtin_ia32_vinsertf128_ps256(X, Y, 1) +#define __builtin_ia32_vinsertf128_si256(X, Y, C) __builtin_ia32_vinsertf128_si256(X, Y, 1) +#define __builtin_ia32_roundpd256(V, M) __builtin_ia32_roundpd256(V, 1) +#define __builtin_ia32_roundps256(V, M) __builtin_ia32_roundps256(V, 1) + +/* wmmintrin.h */ +#define __builtin_ia32_aeskeygenassist128(X, C) __builtin_ia32_aeskeygenassist128(X, 1) +#define __builtin_ia32_pclmulqdq128(X, Y, I) __builtin_ia32_pclmulqdq128(X, Y, 1) + +/* mmintrin-common.h */ +#define __builtin_ia32_roundpd(V, M) __builtin_ia32_roundpd(V, 1) +#define __builtin_ia32_roundsd(D, V, M) __builtin_ia32_roundsd(D, V, 1) +#define __builtin_ia32_roundps(V, M) __builtin_ia32_roundps(V, 1) +#define __builtin_ia32_roundss(D, V, M) __builtin_ia32_roundss(D, V, 1) + +/* smmintrin.h */ +#define __builtin_ia32_pblendw128(X, Y, M) __builtin_ia32_pblendw128 (X, Y, 1) +#define __builtin_ia32_blendps(X, Y, M) __builtin_ia32_blendps(X, Y, 1) +#define __builtin_ia32_blendpd(X, Y, M) __builtin_ia32_blendpd(X, Y, 1) +#define __builtin_ia32_dpps(X, Y, M) __builtin_ia32_dpps(X, Y, 1) +#define __builtin_ia32_dppd(X, Y, M) __builtin_ia32_dppd(X, Y, 1) +#define __builtin_ia32_insertps128(D, S, N) __builtin_ia32_insertps128(D, S, 1) +#define __builtin_ia32_vec_ext_v4sf(X, N) __builtin_ia32_vec_ext_v4sf(X, 1) +#define __builtin_ia32_vec_set_v16qi(D, S, N) __builtin_ia32_vec_set_v16qi(D, S, 1) +#define __builtin_ia32_vec_set_v4si(D, S, N) __builtin_ia32_vec_set_v4si(D, S, 1) +#define __builtin_ia32_vec_set_v2di(D, S, N) __builtin_ia32_vec_set_v2di(D, S, 1) +#define __builtin_ia32_vec_ext_v16qi(X, N) __builtin_ia32_vec_ext_v16qi(X, 1) +#define __builtin_ia32_vec_ext_v4si(X, N) __builtin_ia32_vec_ext_v4si(X, 1) +#define __builtin_ia32_vec_ext_v2di(X, N) __builtin_ia32_vec_ext_v2di(X, 1) +#define __builtin_ia32_mpsadbw128(X, Y, M) __builtin_ia32_mpsadbw128(X, Y, 1) +#define __builtin_ia32_pcmpistrm128(X, Y, M) \ + __builtin_ia32_pcmpistrm128(X, Y, 1) +#define __builtin_ia32_pcmpistri128(X, Y, M) \ + __builtin_ia32_pcmpistri128(X, Y, 1) +#define __builtin_ia32_pcmpestrm128(X, LX, Y, LY, M) \ + __builtin_ia32_pcmpestrm128(X, LX, Y, LY, 1) +#define __builtin_ia32_pcmpestri128(X, LX, Y, LY, M) \ + __builtin_ia32_pcmpestri128(X, LX, Y, LY, 1) +#define __builtin_ia32_pcmpistria128(X, Y, M) \ + __builtin_ia32_pcmpistria128(X, Y, 1) +#define __builtin_ia32_pcmpistric128(X, Y, M) \ + __builtin_ia32_pcmpistric128(X, Y, 1) +#define __builtin_ia32_pcmpistrio128(X, Y, M) \ + __builtin_ia32_pcmpistrio128(X, Y, 1) +#define __builtin_ia32_pcmpistris128(X, Y, M) \ + __builtin_ia32_pcmpistris128(X, Y, 1) +#define __builtin_ia32_pcmpistriz128(X, Y, M) \ + __builtin_ia32_pcmpistriz128(X, Y, 1) +#define __builtin_ia32_pcmpestria128(X, LX, Y, LY, M) \ + __builtin_ia32_pcmpestria128(X, LX, Y, LY, 1) +#define __builtin_ia32_pcmpestric128(X, LX, Y, LY, M) \ + __builtin_ia32_pcmpestric128(X, LX, Y, LY, 1) +#define __builtin_ia32_pcmpestrio128(X, LX, Y, LY, M) \ + __builtin_ia32_pcmpestrio128(X, LX, Y, LY, 1) +#define __builtin_ia32_pcmpestris128(X, LX, Y, LY, M) \ + __builtin_ia32_pcmpestris128(X, LX, Y, LY, 1) +#define __builtin_ia32_pcmpestriz128(X, LX, Y, LY, M) \ + __builtin_ia32_pcmpestriz128(X, LX, Y, LY, 1) + +/* tmmintrin.h */ +#define __builtin_ia32_palignr128(X, Y, N) __builtin_ia32_palignr128(X, Y, 8) +#define __builtin_ia32_palignr(X, Y, N) __builtin_ia32_palignr(X, Y, 8) + +/* emmintrin.h */ +#define __builtin_ia32_psrldqi128(A, B) __builtin_ia32_psrldqi128(A, 8) +#define __builtin_ia32_pslldqi128(A, B) __builtin_ia32_pslldqi128(A, 8) +#define __builtin_ia32_pshufhw(A, N) __builtin_ia32_pshufhw(A, 0) +#define __builtin_ia32_pshuflw(A, N) __builtin_ia32_pshuflw(A, 0) +#define __builtin_ia32_pshufd(A, N) __builtin_ia32_pshufd(A, 0) +#define __builtin_ia32_vec_set_v8hi(A, D, N) \ + __builtin_ia32_vec_set_v8hi(A, D, 0) +#define __builtin_ia32_vec_ext_v8hi(A, N) __builtin_ia32_vec_ext_v8hi(A, 0) +#define __builtin_ia32_shufpd(A, B, N) __builtin_ia32_shufpd(A, B, 0) + +/* xmmintrin.h */ +#define __builtin_prefetch(P, A, I) __builtin_prefetch(P, A, _MM_HINT_NTA) +#define __builtin_ia32_pshufw(A, N) __builtin_ia32_pshufw(A, 0) +#define __builtin_ia32_vec_set_v4hi(A, D, N) \ + __builtin_ia32_vec_set_v4hi(A, D, 0) +#define __builtin_ia32_vec_ext_v4hi(A, N) __builtin_ia32_vec_ext_v4hi(A, 0) +#define __builtin_ia32_shufps(A, B, N) __builtin_ia32_shufps(A, B, 0) + +/* bmmintrin.h */ +#define __builtin_ia32_protbi(A, B) __builtin_ia32_protbi(A,1) +#define __builtin_ia32_protwi(A, B) __builtin_ia32_protwi(A,1) +#define __builtin_ia32_protdi(A, B) __builtin_ia32_protdi(A,1) +#define __builtin_ia32_protqi(A, B) __builtin_ia32_protqi(A,1) + +#include <wmmintrin.h> +#include <bmmintrin.h> +#include <gmmintrin.h> +#include <mm3dnow.h> diff --git a/gcc/testsuite/gcc.target/i386/avx-2.c b/gcc/testsuite/gcc.target/i386/avx-2.c new file mode 100644 index 00000000000..6699558d8f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-2.c @@ -0,0 +1,172 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -Werror-implicit-function-declaration -march=k8 -m3dnow -mavx -msse5 -maes -mpclmul" } */ + +#include <mm_malloc.h> + +/* Test that the intrinsics compile without optimization. All of them are + defined as inline functions in {,x,e,p,t,s,w,g,a,b}mmintrin.h and + mm3dnow.h that reference the proper builtin functions. Defining away + "extern" and "__inline" results in all of them being compiled as proper + functions. */ + +#define extern +#define __inline + +#include <wmmintrin.h> +#include <bmmintrin.h> +#include <gmmintrin.h> +#include <mm3dnow.h> + +#define _CONCAT(x,y) x ## y + +#define test_1(func, type, op1_type, imm) \ + type _CONCAT(_,func) (op1_type A, int const I) \ + { return func (A, imm); } + +#define test_1x(func, type, op1_type, imm1, imm2) \ + type _CONCAT(_,func) (op1_type A, int const I, int const L) \ + { return func (A, imm1, imm2); } + +#define test_2(func, type, op1_type, op2_type, imm) \ + type _CONCAT(_,func) (op1_type A, op2_type B, int const I) \ + { return func (A, B, imm); } + +#define test_2x(func, type, op1_type, op2_type, imm1, imm2) \ + type _CONCAT(_,func) (op1_type A, op2_type B, int const I, int const L) \ + { return func (A, B, imm1, imm2); } + +#define test_3(func, type, op1_type, op2_type, op3_type, imm) \ + type _CONCAT(_,func) (op1_type A, op2_type B, \ + op3_type C, int const I) \ + { return func (A, B, C, imm); } + +#define test_4(func, type, op1_type, op2_type, op3_type, op4_type, imm) \ + type _CONCAT(_,func) (op1_type A, op2_type B, \ + op3_type C, op4_type D, int const I) \ + { return func (A, B, C, D, imm); } + + +/* Following intrinsics require immediate arguments. They + are defined as macros for non-optimized compilations. */ + +/* ammintrin.h */ +test_1x (_mm_extracti_si64, __m128i, __m128i, 1, 1) +test_2x (_mm_inserti_si64, __m128i, __m128i, __m128i, 1, 1) + +/* gmmintrin.h */ +test_2 (_mm256_blend_pd, __m256d, __m256d, __m256d, 1) +test_2 (_mm256_blend_ps, __m256, __m256, __m256, 1) +test_2 (_mm256_dp_ps, __m256, __m256, __m256, 1) +test_2 (_mm256_shuffle_pd, __m256d, __m256d, __m256d, 1) +test_2 (_mm256_shuffle_ps, __m256, __m256, __m256, 1) +test_2 (_mm_cmp_sd, __m128d, __m128d, __m128d, 1) +test_2 (_mm_cmp_ss, __m128, __m128, __m128, 1) +test_2 (_mm_cmp_pd, __m128d, __m128d, __m128d, 1) +test_2 (_mm_cmp_ps, __m128, __m128, __m128, 1) +test_2 (_mm256_cmp_pd, __m256d, __m256d, __m256d, 1) +test_2 (_mm256_cmp_ps, __m256, __m256, __m256, 1) +test_1 (_mm256_extractf128_pd, __m128d, __m256d, 1) +test_1 (_mm256_extractf128_ps, __m128, __m256, 1) +test_1 (_mm256_extractf128_si256, __m128i, __m256i, 1) +test_1 (_mm256_extract_epi8, int, __m256i, 20) +test_1 (_mm256_extract_epi16, int, __m256i, 13) +test_1 (_mm256_extract_epi32, int, __m256i, 6) +#ifdef __x86_64__ +test_1 (_mm256_extract_epi64, long long, __m256i, 2) +#endif +test_1 (_mm_permute_pd, __m128d, __m128d, 1) +test_1 (_mm256_permute_pd, __m256d, __m256d, 1) +test_1 (_mm_permute_ps, __m128, __m128, 1) +test_1 (_mm256_permute_ps, __m256, __m256, 1) +test_3 (_mm_permute2_pd, __m128d, __m128d, __m128d, __m128d, 1) +test_3 (_mm256_permute2_pd, __m256d, __m256d, __m256d, __m256d, 1) +test_3 (_mm_permute2_ps, __m128, __m128, __m128, __m128, 1) +test_3 (_mm256_permute2_ps, __m256, __m256, __m256, __m256, 1) +test_2 (_mm256_permute2f128_pd, __m256d, __m256d, __m256d, 1) +test_2 (_mm256_permute2f128_ps, __m256, __m256, __m256, 1) +test_2 (_mm256_permute2f128_si256, __m256i, __m256i, __m256i, 1) +test_2 (_mm256_insertf128_pd, __m256d, __m256d, __m128d, 1) +test_2 (_mm256_insertf128_ps, __m256, __m256, __m128, 1) +test_2 (_mm256_insertf128_si256, __m256i, __m256i, __m128i, 1) +test_2 (_mm256_insert_epi8, __m256i, __m256i, int, 30) +test_2 (_mm256_insert_epi16, __m256i, __m256i, int, 7) +test_2 (_mm256_insert_epi32, __m256i, __m256i, int, 3) +#ifdef __x86_64__ +test_2 (_mm256_insert_epi64, __m256i, __m256i, long long, 1) +#endif +test_1 (_mm256_round_pd, __m256d, __m256d, 1) +test_1 (_mm256_round_ps, __m256, __m256, 1) + +/* wmmintrin.h */ +test_1 (_mm_aeskeygenassist_si128, __m128i, __m128i, 1) +test_2 (_mm_clmulepi64_si128, __m128i, __m128i, __m128i, 1) + +/* mmintrin-common.h */ +test_1 (_mm_round_pd, __m128d, __m128d, 1) +test_1 (_mm_round_ps, __m128, __m128, 1) +test_2 (_mm_round_sd, __m128d, __m128d, __m128d, 1) +test_2 (_mm_round_ss, __m128, __m128, __m128, 1) + +/* smmintrin.h */ +test_2 (_mm_blend_epi16, __m128i, __m128i, __m128i, 1) +test_2 (_mm_blend_ps, __m128, __m128, __m128, 1) +test_2 (_mm_blend_pd, __m128d, __m128d, __m128d, 1) +test_2 (_mm_dp_ps, __m128, __m128, __m128, 1) +test_2 (_mm_dp_pd, __m128d, __m128d, __m128d, 1) +test_2 (_mm_insert_ps, __m128, __m128, __m128, 1) +test_1 (_mm_extract_ps, int, __m128, 1) +test_2 (_mm_insert_epi8, __m128i, __m128i, int, 1) +test_2 (_mm_insert_epi32, __m128i, __m128i, int, 1) +#ifdef __x86_64__ +test_2 (_mm_insert_epi64, __m128i, __m128i, long long, 1) +#endif +test_1 (_mm_extract_epi8, int, __m128i, 1) +test_1 (_mm_extract_epi32, int, __m128i, 1) +#ifdef __x86_64__ +test_1 (_mm_extract_epi64, long long, __m128i, 1) +#endif +test_2 (_mm_mpsadbw_epu8, __m128i, __m128i, __m128i, 1) +test_2 (_mm_cmpistrm, __m128i, __m128i, __m128i, 1) +test_2 (_mm_cmpistri, int, __m128i, __m128i, 1) +test_4 (_mm_cmpestrm, __m128i, __m128i, int, __m128i, int, 1) +test_4 (_mm_cmpestri, int, __m128i, int, __m128i, int, 1) +test_2 (_mm_cmpistra, int, __m128i, __m128i, 1) +test_2 (_mm_cmpistrc, int, __m128i, __m128i, 1) +test_2 (_mm_cmpistro, int, __m128i, __m128i, 1) +test_2 (_mm_cmpistrs, int, __m128i, __m128i, 1) +test_2 (_mm_cmpistrz, int, __m128i, __m128i, 1) +test_4 (_mm_cmpestra, int, __m128i, int, __m128i, int, 1) +test_4 (_mm_cmpestrc, int, __m128i, int, __m128i, int, 1) +test_4 (_mm_cmpestro, int, __m128i, int, __m128i, int, 1) +test_4 (_mm_cmpestrs, int, __m128i, int, __m128i, int, 1) +test_4 (_mm_cmpestrz, int, __m128i, int, __m128i, int, 1) + +/* tmmintrin.h */ +test_2 (_mm_alignr_epi8, __m128i, __m128i, __m128i, 1) +test_2 (_mm_alignr_pi8, __m64, __m64, __m64, 1) + +/* emmintrin.h */ +test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1) +test_1 (_mm_srli_si128, __m128i, __m128i, 1) +test_1 (_mm_slli_si128, __m128i, __m128i, 1) +test_1 (_mm_extract_epi16, int, __m128i, 1) +test_2 (_mm_insert_epi16, __m128i, __m128i, int, 1) +test_1 (_mm_shufflehi_epi16, __m128i, __m128i, 1) +test_1 (_mm_shufflelo_epi16, __m128i, __m128i, 1) +test_1 (_mm_shuffle_epi32, __m128i, __m128i, 1) + +/* xmmintrin.h */ +test_2 (_mm_shuffle_ps, __m128, __m128, __m128, 1) +test_1 (_mm_extract_pi16, int, __m64, 1) +test_1 (_m_pextrw, int, __m64, 1) +test_2 (_mm_insert_pi16, __m64, __m64, int, 1) +test_2 (_m_pinsrw, __m64, __m64, int, 1) +test_1 (_mm_shuffle_pi16, __m64, __m64, 1) +test_1 (_m_pshufw, __m64, __m64, 1) +test_1 (_mm_prefetch, void, void *, _MM_HINT_NTA) + +/* bmmintrin.h */ +test_1 (_mm_roti_epi8, __m128i, __m128i, 1) +test_1 (_mm_roti_epi16, __m128i, __m128i, 1) +test_1 (_mm_roti_epi32, __m128i, __m128i, 1) +test_1 (_mm_roti_epi64, __m128i, __m128i, 1) diff --git a/gcc/testsuite/gcc.target/i386/avx-3.c b/gcc/testsuite/gcc.target/i386/avx-3.c new file mode 100644 index 00000000000..9e0b434aef5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-3.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx -std=gnu99" } */ + +_Decimal128 +foo128 (_Decimal128 z) +{ + return z + 1.0dl; +} diff --git a/gcc/testsuite/gcc.target/i386/avx-check.h b/gcc/testsuite/gcc.target/i386/avx-check.h new file mode 100644 index 00000000000..8db55a10357 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-check.h @@ -0,0 +1,29 @@ +#include <stdlib.h> +#include "cpuid.h" +#include "m256-check.h" + +static void avx_test (void); + +int +main () +{ + unsigned int eax, ebx, ecx, edx; + + if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx)) + return 0; + + /* Run AVX test only if host has AVX support. */ + if (ecx & bit_AVX) + { + avx_test (); +#ifdef DEBUG + printf ("PASSED\n"); +#endif + } +#ifdef DEBUG + else + printf ("SKIPPED\n"); +#endif + + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v16hi-1.c b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-1.c new file mode 100644 index 00000000000..e8578489079 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-1.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (short *v) +{ + return _mm256_set_epi16 (v[15], v[14], v[13], v[12], + v[11], v[10], v[9], v[8], + v[7], v[6], v[5], v[4], + v[3], v[2], v[1], v[0]); +} + +static void +avx_test (void) +{ + short v[16] = + { + -3, 60, 48, 104, -90, 37, -48, 78, + 4, 33, 81, 4, -89, 17, 8, 68 + }; + union256i_w u; + + u.x = foo (v); + if (check_union256i_w (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v16hi-2.c b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-2.c new file mode 100644 index 00000000000..ac1fc458ba3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-2.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (short x1, short x2, short x3, short x4, + short x5, short x6, short x7, short x8, + short x9, short x10, short x11, short x12, + short x13, short x14, short x15, short x16) +{ + return _mm256_set_epi16 (x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11, x12, x13, x14, x15, x16); +} + +static void +avx_test (void) +{ + short v[16] = + { + -3, 60, 48, 104, -90, 37, -48, 78, + 4, 33, 81, 4, -89, 17, 8, 68 + }; + union256i_w u; + + u.x = foo (v[15], v[14], v[13], v[12], + v[11], v[10], v[9], v[8], + v[7], v[6], v[5], v[4], + v[3], v[2], v[1], v[0]); + if (check_union256i_w (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v16hi-3.c b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-3.c new file mode 100644 index 00000000000..c215d56753a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-3.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (short x) +{ + return _mm256_set_epi16 (x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x); +} + +static void +avx_test (void) +{ + short e = 345; + short v[16]; + union256i_w u; + int i; + + for (i = 0; i < ARRAY_SIZE (v); i++) + v[i] = e; + u.x = foo (e); + if (check_union256i_w (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v16hi-4.c b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-4.c new file mode 100644 index 00000000000..a707fc8dced --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-4.c @@ -0,0 +1,83 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (short x, int i) +{ + switch (i) + { + case 15: + return _mm256_set_epi16 (x, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + case 14: + return _mm256_set_epi16 (0, x, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + case 13: + return _mm256_set_epi16 (0, 0, x, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + case 12: + return _mm256_set_epi16 (0, 0, 0, x, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + case 11: + return _mm256_set_epi16 (0, 0, 0, 0, x, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + case 10: + return _mm256_set_epi16 (0, 0, 0, 0, 0, x, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + case 9: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, x, 0, + 0, 0, 0, 0, 0, 0, 0, 0); + case 8: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, x, + 0, 0, 0, 0, 0, 0, 0, 0); + case 7: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + x, 0, 0, 0, 0, 0, 0, 0); + case 6: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + 0, x, 0, 0, 0, 0, 0, 0); + case 5: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, x, 0, 0, 0, 0, 0); + case 4: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, x, 0, 0, 0, 0); + case 3: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, x, 0, 0, 0); + case 2: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, x, 0, 0); + case 1: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, x, 0); + case 0: + return _mm256_set_epi16 (0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + short e = 0xbeef; + short v[16]; + union256i_w u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 0; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_w (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v16hi-5.c b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-5.c new file mode 100644 index 00000000000..ad77eda2993 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v16hi-5.c @@ -0,0 +1,83 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (short x, int i) +{ + switch (i) + { + case 15: + return _mm256_set_epi16 (x, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1); + case 14: + return _mm256_set_epi16 (1, x, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1); + case 13: + return _mm256_set_epi16 (1, 1, x, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1); + case 12: + return _mm256_set_epi16 (1, 1, 1, x, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1); + case 11: + return _mm256_set_epi16 (1, 1, 1, 1, x, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1); + case 10: + return _mm256_set_epi16 (1, 1, 1, 1, 1, x, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1); + case 9: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, x, 1, + 1, 1, 1, 1, 1, 1, 1, 1); + case 8: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, x, + 1, 1, 1, 1, 1, 1, 1, 1); + case 7: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + x, 1, 1, 1, 1, 1, 1, 1); + case 6: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + 1, x, 1, 1, 1, 1, 1, 1); + case 5: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, x, 1, 1, 1, 1, 1); + case 4: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, x, 1, 1, 1, 1); + case 3: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, x, 1, 1, 1); + case 2: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, x, 1, 1); + case 1: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, x, 1); + case 0: + return _mm256_set_epi16 (1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + short e = 0xbeef; + short v[16]; + union256i_w u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 1; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_w (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v32qi-1.c b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-1.c new file mode 100644 index 00000000000..9d93815782b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-1.c @@ -0,0 +1,36 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (char *v) +{ + return _mm256_set_epi8 (v[31], v[30], v[29], v[28], + v[27], v[26], v[25], v[24], + v[23], v[22], v[21], v[20], + v[19], v[18], v[17], v[16], + v[15], v[14], v[13], v[12], + v[11], v[10], v[9], v[8], + v[7], v[6], v[5], v[4], + v[3], v[2], v[1], v[0]); +} + +static void +avx_test (void) +{ + char v[32] = + { + -3, 60, 48, 104, -90, 37, -48, 78, + 4, 33, 81, 4, -89, 17, 8, 68, + -13, 30, 78, 149, -70, -37, 98, 38, + 41, 73, 89, 14, 80, 117, 108, 8 + }; + union256i_b u; + + u.x = foo (v); + if (check_union256i_b (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v32qi-2.c b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-2.c new file mode 100644 index 00000000000..508ed51a855 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-2.c @@ -0,0 +1,46 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (char x1, char x2, char x3, char x4, + char x5, char x6, char x7, char x8, + char x9, char x10, char x11, char x12, + char x13, char x14, char x15, char x16, + char x17, char x18, char x19, char x20, + char x21, char x22, char x23, char x24, + char x25, char x26, char x27, char x28, + char x29, char x30, char x31, char x32) +{ + return _mm256_set_epi8 (x1, x2, x3, x4, x5, x6, x7, x8, + x9, x10, x11, x12, x13, x14, x15, x16, + x17, x18, x19, x20, x21, x22, x23, x24, + x25, x26, x27, x28, x29, x30, x31, x32); +} + +static void +avx_test (void) +{ + char v[32] = + { + -3, 60, 48, 104, -90, 37, -48, 78, + 4, 33, 81, 4, -89, 17, 8, 68, + -13, 30, 78, 149, -70, -37, 98, 38, + 41, 73, 89, 14, 80, 117, 108, 8 + }; + union256i_b u; + + u.x = foo (v[31], v[30], v[29], v[28], + v[27], v[26], v[25], v[24], + v[23], v[22], v[21], v[20], + v[19], v[18], v[17], v[16], + v[15], v[14], v[13], v[12], + v[11], v[10], v[9], v[8], + v[7], v[6], v[5], v[4], + v[3], v[2], v[1], v[0]); + if (check_union256i_b (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v32qi-3.c b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-3.c new file mode 100644 index 00000000000..da92c8e2cb6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-3.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (char x) +{ + return _mm256_set_epi8 (x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x); +} + +static void +avx_test (void) +{ + char e = -45; + char v[32]; + union256i_b u; + int i; + + for (i = 0; i < ARRAY_SIZE (v); i++) + v[i] = e; + u.x = foo (e); + if (check_union256i_b (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v32qi-4.c b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-4.c new file mode 100644 index 00000000000..7220695ba06 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-4.c @@ -0,0 +1,131 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (char x, int i) +{ + switch (i) + { + case 31: + return _mm256_set_epi8 (x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 30: + return _mm256_set_epi8 (0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 29: + return _mm256_set_epi8 (0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 28: + return _mm256_set_epi8 (0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 27: + return _mm256_set_epi8 (0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 26: + return _mm256_set_epi8 (0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 25: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 24: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 23: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 22: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 21: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 20: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 19: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 18: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 17: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 16: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 15: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 14: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 13: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 12: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 11: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 10: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 9: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0, 0); + case 8: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0, 0); + case 7: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0, 0); + case 6: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0, 0); + case 5: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0, 0); + case 4: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0, 0); + case 3: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0, 0); + case 2: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 0); + case 1: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 0); + case 0: + return _mm256_set_epi8 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + char e = 0xa1; + char v[32]; + union256i_b u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 0; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_b (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v32qi-5.c b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-5.c new file mode 100644 index 00000000000..0fcadda9186 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v32qi-5.c @@ -0,0 +1,131 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (char x, int i) +{ + switch (i) + { + case 31: + return _mm256_set_epi8 (x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 30: + return _mm256_set_epi8 (1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 29: + return _mm256_set_epi8 (1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 28: + return _mm256_set_epi8 (1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 27: + return _mm256_set_epi8 (1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 26: + return _mm256_set_epi8 (1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 25: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 24: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 23: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 22: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 21: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 20: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 19: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 18: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 17: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 16: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 15: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 14: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 13: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 12: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 11: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 10: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 9: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1, 1); + case 8: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1, 1); + case 7: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1, 1); + case 6: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1, 1); + case 5: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1, 1); + case 4: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1, 1); + case 3: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1, 1); + case 2: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1, 1); + case 1: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x, 1); + case 0: + return _mm256_set_epi8 (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + char e = 0xa1; + char v[32]; + union256i_b u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 1; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_b (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4df-1.c b/gcc/testsuite/gcc.target/i386/avx-set-v4df-1.c new file mode 100644 index 00000000000..89e6ec2f38c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4df-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256d +__attribute__((noinline)) +foo (double *v) +{ + return _mm256_set_pd (v[3], v[2], v[1], v[0]); +} + +static void +avx_test (void) +{ + double v[4] = { -3, 2, 1, 9 }; + union256d u; + + u.x = foo (v); + if (check_union256d (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4df-2.c b/gcc/testsuite/gcc.target/i386/avx-set-v4df-2.c new file mode 100644 index 00000000000..51df025edfc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4df-2.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256d +__attribute__((noinline)) +foo (double x1, double x2, double x3, double x4) +{ + return _mm256_set_pd (x1, x2, x3, x4); +} + +static void +avx_test (void) +{ + double v[4] = { -3, 2, 1, 9 }; + union256d u; + + u.x = foo (v[3], v[2], v[1], v[0]); + if (check_union256d (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4df-3.c b/gcc/testsuite/gcc.target/i386/avx-set-v4df-3.c new file mode 100644 index 00000000000..01b2ff51d21 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4df-3.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256d +__attribute__((noinline)) +foo (double x) +{ + return _mm256_set_pd (x, x, x, x); +} + +static void +avx_test (void) +{ + double e = 34.5; + double v[4]; + union256d u; + int i; + + for (i = 0; i < ARRAY_SIZE (v); i++) + v[i] = e; + u.x = foo (e); + if (check_union256d (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4df-4.c b/gcc/testsuite/gcc.target/i386/avx-set-v4df-4.c new file mode 100644 index 00000000000..e2f6300a3ec --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4df-4.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256d +__attribute__((noinline)) +foo (double x, int i) +{ + switch (i) + { + case 3: + return _mm256_set_pd (x, 0, 0, 0); + case 2: + return _mm256_set_pd (0, x, 0, 0); + case 1: + return _mm256_set_pd (0, 0, x, 0); + case 0: + return _mm256_set_pd (0, 0, 0, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + double e = -3.234; + double v[4]; + union256d u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 0; + v[i] = e; + u.x = foo (e, i); + if (check_union256d (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4df-5.c b/gcc/testsuite/gcc.target/i386/avx-set-v4df-5.c new file mode 100644 index 00000000000..6f418a66873 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4df-5.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256d +__attribute__((noinline)) +foo (double x, int i) +{ + switch (i) + { + case 3: + return _mm256_set_pd (x, 1, 1, 1); + case 2: + return _mm256_set_pd (1, x, 1, 1); + case 1: + return _mm256_set_pd (1, 1, x, 1); + case 0: + return _mm256_set_pd (1, 1, 1, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + double e = -3.234; + double v[4]; + union256d u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 1; + v[i] = e; + u.x = foo (e, i); + if (check_union256d (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4di-1.c b/gcc/testsuite/gcc.target/i386/avx-set-v4di-1.c new file mode 100644 index 00000000000..84b6278a325 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4di-1.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (long long *v) +{ + return _mm256_set_epi64x (v[3], v[2], v[1], v[0]); +} + +static void +avx_test (void) +{ + long long v[4] + = { 0x12e9e94645ad8LL, 0x851c0b39446LL, + 0x786784645245LL, 0x9487731234LL }; + union256i_q u; + + u.x = foo (v); + if (check_union256i_q (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4di-2.c b/gcc/testsuite/gcc.target/i386/avx-set-v4di-2.c new file mode 100644 index 00000000000..f3dc138a8c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4di-2.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (long long x1, long long x2, long long x3, long long x4) +{ + return _mm256_set_epi64x (x1, x2, x3, x4); +} + +static void +avx_test (void) +{ + long long v[4] + = { 0x12e9e94645ad8LL, 0x851c0b39446LL, + 0x786784645245LL, 0x9487731234LL }; + union256i_q u; + + u.x = foo (v[3], v[2], v[1], v[0]); + if (check_union256i_q (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4di-3.c b/gcc/testsuite/gcc.target/i386/avx-set-v4di-3.c new file mode 100644 index 00000000000..95710d82240 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4di-3.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (long long x) +{ + return _mm256_set_epi64x (x, x, x, x); +} + +static void +avx_test (void) +{ + long long e = 0xfed178ab134badf1LL; + long long v[4]; + union256i_q u; + int i; + + for (i = 0; i < ARRAY_SIZE (v); i++) + v[i] = e; + u.x = foo (e); + if (check_union256i_q (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4di-4.c b/gcc/testsuite/gcc.target/i386/avx-set-v4di-4.c new file mode 100644 index 00000000000..83f8c15fa6b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4di-4.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (long long x, int i) +{ + switch (i) + { + case 3: + return _mm256_set_epi64x (x, 0, 0, 0); + case 2: + return _mm256_set_epi64x (0, x, 0, 0); + case 1: + return _mm256_set_epi64x (0, 0, x, 0); + case 0: + return _mm256_set_epi64x (0, 0, 0, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + long long e = 0xabadbeef01234567LL; + long long v[4]; + union256i_q u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 0; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_q (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v4di-5.c b/gcc/testsuite/gcc.target/i386/avx-set-v4di-5.c new file mode 100644 index 00000000000..7bc260c7ba0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v4di-5.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (long long x, int i) +{ + switch (i) + { + case 3: + return _mm256_set_epi64x (x, 1, 1, 1); + case 2: + return _mm256_set_epi64x (1, x, 1, 1); + case 1: + return _mm256_set_epi64x (1, 1, x, 1); + case 0: + return _mm256_set_epi64x (1, 1, 1, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + long long e = 0xabadbeef01234567LL; + long long v[4]; + union256i_q u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 1; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_q (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8sf-1.c b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-1.c new file mode 100644 index 00000000000..6f1ba71019c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256 +__attribute__((noinline)) +foo (float *v) +{ + return _mm256_set_ps (v[7], v[6], v[5], v[4], + v[3], v[2], v[1], v[0]); +} + +static void +avx_test (void) +{ + float v[8] = { -3, 2, 1, 9, 23, -173, -13, 69 }; + union256 u; + + u.x = foo (v); + if (check_union256 (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8sf-2.c b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-2.c new file mode 100644 index 00000000000..4d809d7ca3b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-2.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +__m256 +__attribute__((noinline)) +foo (float x1, float x2, float x3, float x4, + float x5, float x6, float x7, float x8) +{ + return _mm256_set_ps (x1, x2, x3, x4, x5, x6, x7, x8); +} + +void +avx_test (void) +{ + float v[8] = { -3, 2, 1, 9, 23, -173, -13, 69 }; + union256 u; + + u.x = foo (v[7], v[6], v[5], v[4], v[3], v[2], v[1], v[0]); + + if (check_union256 (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8sf-3.c b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-3.c new file mode 100644 index 00000000000..96f5e3318ec --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-3.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256 +__attribute__((noinline)) +foo (float x) +{ + return _mm256_set_ps (x, x, x, x, x, x, x, x); +} + +static void +avx_test (void) +{ + float e = 34.5; + float v[8]; + union256 u; + int i; + + for (i = 0; i < ARRAY_SIZE (v); i++) + v[i] = e; + u.x = foo (e); + if (check_union256 (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8sf-4.c b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-4.c new file mode 100644 index 00000000000..73be303698d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-4.c @@ -0,0 +1,51 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256 +__attribute__((noinline)) +foo (float x, int i) +{ + switch (i) + { + case 7: + return _mm256_set_ps (x, 0, 0, 0, 0, 0, 0, 0); + case 6: + return _mm256_set_ps (0, x, 0, 0, 0, 0, 0, 0); + case 5: + return _mm256_set_ps (0, 0, x, 0, 0, 0, 0, 0); + case 4: + return _mm256_set_ps (0, 0, 0, x, 0, 0, 0, 0); + case 3: + return _mm256_set_ps (0, 0, 0, 0, x, 0, 0, 0); + case 2: + return _mm256_set_ps (0, 0, 0, 0, 0, x, 0, 0); + case 1: + return _mm256_set_ps (0, 0, 0, 0, 0, 0, x, 0); + case 0: + return _mm256_set_ps (0, 0, 0, 0, 0, 0, 0, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + float e = -3.234; + float v[8]; + union256 u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 0; + v[i] = e; + u.x = foo (e, i); + if (check_union256 (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8sf-5.c b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-5.c new file mode 100644 index 00000000000..80dc156d524 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8sf-5.c @@ -0,0 +1,51 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256 +__attribute__((noinline)) +foo (float x, int i) +{ + switch (i) + { + case 7: + return _mm256_set_ps (x, 1, 1, 1, 1, 1, 1, 1); + case 6: + return _mm256_set_ps (1, x, 1, 1, 1, 1, 1, 1); + case 5: + return _mm256_set_ps (1, 1, x, 1, 1, 1, 1, 1); + case 4: + return _mm256_set_ps (1, 1, 1, x, 1, 1, 1, 1); + case 3: + return _mm256_set_ps (1, 1, 1, 1, x, 1, 1, 1); + case 2: + return _mm256_set_ps (1, 1, 1, 1, 1, x, 1, 1); + case 1: + return _mm256_set_ps (1, 1, 1, 1, 1, 1, x, 1); + case 0: + return _mm256_set_ps (1, 1, 1, 1, 1, 1, 1, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + float e = -3.234; + float v[8]; + union256 u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 1; + v[i] = e; + u.x = foo (e, i); + if (check_union256 (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8si-1.c b/gcc/testsuite/gcc.target/i386/avx-set-v8si-1.c new file mode 100644 index 00000000000..7aa029ea595 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8si-1.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (int *v) +{ + return _mm256_set_epi32 (v[7], v[6], v[5], v[4], + v[3], v[2], v[1], v[0]); +} + +static void +avx_test (void) +{ + int v[8] + = { 19832468, 6576856, 8723467, 234566, + 786784, 645245, 948773, 1234 }; + union256i_d u; + + u.x = foo (v); + if (check_union256i_d (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8si-2.c b/gcc/testsuite/gcc.target/i386/avx-set-v8si-2.c new file mode 100644 index 00000000000..e822c785b3c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8si-2.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +__m256i +__attribute__((noinline)) +foo (int x1, int x2, int x3, int x4, + int x5, int x6, int x7, int x8) +{ + return _mm256_set_epi32 (x1, x2, x3, x4, x5, x6, x7, x8); +} + +static void +avx_test (void) +{ + int v[8] = { -3, 2, 1, 9, 23, -173, -13, 69 }; + union256i_d u; + + u.x = foo (v[7], v[6], v[5], v[4], v[3], v[2], v[1], v[0]); + + if (check_union256i_d (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8si-3.c b/gcc/testsuite/gcc.target/i386/avx-set-v8si-3.c new file mode 100644 index 00000000000..594436b3794 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8si-3.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (int x) +{ + return _mm256_set_epi32 (x, x, x, x, x, x, x, x); +} + +static void +avx_test (void) +{ + int e = 0xabadbeef; + int v[8]; + union256i_d u; + int i; + + for (i = 0; i < ARRAY_SIZE (v); i++) + v[i] = e; + u.x = foo (e); + if (check_union256i_d (u, v)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8si-4.c b/gcc/testsuite/gcc.target/i386/avx-set-v8si-4.c new file mode 100644 index 00000000000..2cad6276958 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8si-4.c @@ -0,0 +1,51 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (int x, int i) +{ + switch (i) + { + case 7: + return _mm256_set_epi32 (x, 0, 0, 0, 0, 0, 0, 0); + case 6: + return _mm256_set_epi32 (0, x, 0, 0, 0, 0, 0, 0); + case 5: + return _mm256_set_epi32 (0, 0, x, 0, 0, 0, 0, 0); + case 4: + return _mm256_set_epi32 (0, 0, 0, x, 0, 0, 0, 0); + case 3: + return _mm256_set_epi32 (0, 0, 0, 0, x, 0, 0, 0); + case 2: + return _mm256_set_epi32 (0, 0, 0, 0, 0, x, 0, 0); + case 1: + return _mm256_set_epi32 (0, 0, 0, 0, 0, 0, x, 0); + case 0: + return _mm256_set_epi32 (0, 0, 0, 0, 0, 0, 0, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + int e = 0xabadbeef; + int v[8]; + union256i_d u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 0; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_d (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set-v8si-5.c b/gcc/testsuite/gcc.target/i386/avx-set-v8si-5.c new file mode 100644 index 00000000000..456e8777299 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set-v8si-5.c @@ -0,0 +1,51 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__((noinline)) +foo (int x, int i) +{ + switch (i) + { + case 7: + return _mm256_set_epi32 (x, 1, 1, 1, 1, 1, 1, 1); + case 6: + return _mm256_set_epi32 (1, x, 1, 1, 1, 1, 1, 1); + case 5: + return _mm256_set_epi32 (1, 1, x, 1, 1, 1, 1, 1); + case 4: + return _mm256_set_epi32 (1, 1, 1, x, 1, 1, 1, 1); + case 3: + return _mm256_set_epi32 (1, 1, 1, 1, x, 1, 1, 1); + case 2: + return _mm256_set_epi32 (1, 1, 1, 1, 1, x, 1, 1); + case 1: + return _mm256_set_epi32 (1, 1, 1, 1, 1, 1, x, 1); + case 0: + return _mm256_set_epi32 (1, 1, 1, 1, 1, 1, 1, x); + default: + abort (); + } +} + +static void +avx_test (void) +{ + int e = 0xabadbeef; + int v[8]; + union256i_d u; + int i, j; + + for (i = 0; i < ARRAY_SIZE (v); i++) + { + for (j = 0; j < ARRAY_SIZE (v); j++) + v[j] = 1; + v[i] = e; + u.x = foo (e, i); + if (check_union256i_d (u, v)) + abort (); + } +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set1-epi32-1.c b/gcc/testsuite/gcc.target/i386/avx-set1-epi32-1.c new file mode 100644 index 00000000000..2d774aef303 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set1-epi32-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256i_d u; + int e [8]; + int source[1] = {1234}; + + u.x = _mm256_set1_epi32 (source[0]); + + for (i = 0; i < 8; i++) + e[i] = source[0]; + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set1-pd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-set1-pd-256-1.c new file mode 100644 index 00000000000..21aea294079 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set1-pd-256-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u; + double e [4]; + double source[1] = {26156.643}; + + u.x = _mm256_set1_pd (source[0]); + + for (i = 0; i < 4; i++) + e[i] = source[0]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-set1-ps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-set1-ps-256-1.c new file mode 100644 index 00000000000..c5f2d10236e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-set1-ps-256-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u; + float e [8]; + float source[1] = {1234.234f}; + + u.x = _mm256_set1_ps (source[0]); + + for (i = 0; i < 8; i++) + e[i] = source[0]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-setzero-pd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-setzero-pd-256-1.c new file mode 100644 index 00000000000..43656cf810b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-setzero-pd-256-1.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u; + double e [4]; + + u.x = _mm256_setzero_pd (); + + for (i = 0; i < 4; i++) + e[i] = 0.0; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-setzero-ps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-setzero-ps-256-1.c new file mode 100644 index 00000000000..ffbf431fc35 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-setzero-ps-256-1.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u; + float e [8]; + + u.x = _mm256_setzero_ps (); + + for (i = 0; i < 8; i++) + e[i] = 0.0; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-setzero-si256-1.c b/gcc/testsuite/gcc.target/i386/avx-setzero-si256-1.c new file mode 100644 index 00000000000..01eef2a4e30 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-setzero-si256-1.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256i_q u; + long long e [4]; + + u.x = _mm256_setzero_si256 (); + + for (i = 0; i < 4; i++) + e[i] = 0; + + if (check_union256i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddpd-1.c new file mode 100644 index 00000000000..afed3d035cb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-addpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddpd-256-1.c new file mode 100644 index 00000000000..2d039435454 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddpd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_add_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] + s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddps-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddps-1.c new file mode 100644 index 00000000000..ba905097ff9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-addps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddps-256-1.c new file mode 100644 index 00000000000..363a4dedb54 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddps-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_add_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] + s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddsd-1.c new file mode 100644 index 00000000000..5c562a01d66 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-addsd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddss-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddss-1.c new file mode 100644 index 00000000000..093f61b6373 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-addss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddsubpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddsubpd-1.c new file mode 100644 index 00000000000..7c0fc2fdf16 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddsubpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -mfpmath=sse" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-addsubpd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddsubpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddsubpd-256-1.c new file mode 100644 index 00000000000..7f431ec3655 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddsubpd-256-1.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_addsub_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + if (i % 2) + e[i] = s1.a[i] + s2.a[i]; + else + e[i] = s1.a[i] - s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddsubps-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddsubps-1.c new file mode 100644 index 00000000000..1dbe3f35361 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddsubps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -mfpmath=sse" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-addsubps.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaddsubps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vaddsubps-256-1.c new file mode 100644 index 00000000000..e6977f9b9bc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaddsubps-256-1.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_addsub_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + if (i % 2) + e[i] = s1.a[i] + s2.a[i]; + else + e[i] = s1.a[i] - s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vaesdec-1.c b/gcc/testsuite/gcc.target/i386/avx-vaesdec-1.c new file mode 100644 index 00000000000..c926dd197cb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaesdec-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vaes } */ +/* { dg-options "-O2 -maes -mavx" } */ + +#define CHECK_H "aes-avx-check.h" +#define TEST aes_avx_test + +#include "aesdec.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaesdeclast-1.c b/gcc/testsuite/gcc.target/i386/avx-vaesdeclast-1.c new file mode 100644 index 00000000000..46746260625 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaesdeclast-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vaes } */ +/* { dg-options "-O2 -maes -mavx" } */ + +#define CHECK_H "aes-avx-check.h" +#define TEST aes_avx_test + +#include "aesdeclast.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaesenc-1.c b/gcc/testsuite/gcc.target/i386/avx-vaesenc-1.c new file mode 100644 index 00000000000..313f10105a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaesenc-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vaes } */ +/* { dg-options "-O2 -maes -mavx" } */ + +#define CHECK_H "aes-avx-check.h" +#define TEST aes_avx_test + +#include "aesenc.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaesenclast-1.c b/gcc/testsuite/gcc.target/i386/avx-vaesenclast-1.c new file mode 100644 index 00000000000..0df9130add8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaesenclast-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vaes } */ +/* { dg-options "-O2 -maes -mavx" } */ + +#define CHECK_H "aes-avx-check.h" +#define TEST aes_avx_test + +#include "aesenclast.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaesimc-1.c b/gcc/testsuite/gcc.target/i386/avx-vaesimc-1.c new file mode 100644 index 00000000000..29f910a47ad --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaesimc-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vaes } */ +/* { dg-options "-O2 -maes -mavx" } */ + +#define CHECK_H "aes-avx-check.h" +#define TEST aes_avx_test + +#include "aesimc.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vaeskeygenassist-1.c b/gcc/testsuite/gcc.target/i386/avx-vaeskeygenassist-1.c new file mode 100644 index 00000000000..7c0d564a397 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vaeskeygenassist-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vaes } */ +/* { dg-options "-O2 -maes -mavx" } */ + +#define CHECK_H "aes-avx-check.h" +#define TEST aes_avx_test + +#include "aeskeygenassist.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vandnpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vandnpd-1.c new file mode 100644 index 00000000000..c5f3c1d38fe --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandnpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-andnpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vandnpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vandnpd-256-1.c new file mode 100644 index 00000000000..27e4ccdd187 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandnpd-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + long long source1[4]={34545, 95567, 23443, 5675}; + long long source2[4]={674, 57897, 93459, 45624}; + long long d[4]; + long long e[4]; + + s1.x = _mm256_loadu_pd ((double *)source1); + s2.x = _mm256_loadu_pd ((double *)source2); + u.x = _mm256_andnot_pd (s1.x, s2.x); + + _mm256_storeu_pd ((double *)d, u.x); + + for (i = 0; i < 4; i++) + e[i] = (~source1[i]) & source2[i]; + + if (checkVl (d, e, 4)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vandnps-1.c b/gcc/testsuite/gcc.target/i386/avx-vandnps-1.c new file mode 100644 index 00000000000..357db7e8d46 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandnps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-andnps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vandnps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vandnps-256-1.c new file mode 100644 index 00000000000..7b5a3dbe860 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandnps-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + int source1[8]={34545, 95567, 23443, 5675, 2323, 67, 2345, 45667}; + int source2[8]={674, 57897, 93459, 45624, 54674, 1237, 67436, 79608}; + int d[8]; + int e[8]; + + s1.x = _mm256_loadu_ps ((float *)source1); + s2.x = _mm256_loadu_ps ((float *)source2); + u.x = _mm256_andnot_ps (s1.x, s2.x); + + _mm256_storeu_ps ((float *)d, u.x); + + for (i = 0; i < 8; i++) + e[i] = (~source1[i]) & source2[i]; + + if (checkVi (d, e, 8)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vandpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vandpd-1.c new file mode 100644 index 00000000000..0a9532d5dbc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-andpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vandpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vandpd-256-1.c new file mode 100644 index 00000000000..b0675ec6586 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandpd-256-1.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + + union + { + double d[4]; + long long ll[4]; + }source1, source2, e; + + s1.x = _mm256_set_pd (345.45, 95567, 2344.3, 567.5); + s2.x = _mm256_set_pd (674, 57.897, 934.59, 4562.4); + + _mm256_storeu_pd (source1.d, s1.x); + _mm256_storeu_pd (source2.d, s2.x); + + u.x = _mm256_and_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e.ll[i] = source1.ll[i] & source2.ll[i]; + + if (check_union256d (u, e.d)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vandps-1.c b/gcc/testsuite/gcc.target/i386/avx-vandps-1.c new file mode 100644 index 00000000000..54bba79ab0b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-andps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vandps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vandps-256-1.c new file mode 100644 index 00000000000..4dc123bf371 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vandps-256-1.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + + union + { + float f[8]; + int i[8]; + }source1, source2, e; + + s1.x = _mm256_set_ps (34545, 95567, 23443, 5675, 2323, 67, 2345, 45667); + s2.x = _mm256_set_ps (674, 57897, 93459, 45624, 54674, 1237, 67436, 79608); + + _mm256_storeu_ps (source1.f, s1.x); + _mm256_storeu_ps (source2.f, s2.x); + + u.x = _mm256_and_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e.i[i] = source1.i[i] & source2.i[i]; + + if (check_union256 (u, e.f)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vblendpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vblendpd-1.c new file mode 100644 index 00000000000..0a9031f4485 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vblendpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-blendpd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vblendpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vblendpd-256-1.c new file mode 100644 index 00000000000..39e7c1bd553 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vblendpd-256-1.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 12 +#endif + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (34545, 95567, 23443, 5675); + s2.x = _mm256_set_pd (674, 57897, 93459, 45624); + u.x = _mm256_blend_pd (s1.x, s2.x, MASK); + + for (i = 0; i < 4; i++) + e[i] = (MASK & (0x01 << i)) ? s2.a[i] : s1.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vblendps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vblendps-256-1.c new file mode 100644 index 00000000000..9f5dde29fe4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vblendps-256-1.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 114 +#endif + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (34545, 95567, 23443, 5675, 2323, 67, 2345, 45667); + s2.x = _mm256_set_ps (674, 57897, 93459, 45624, 54674, 1237, 67436, 79608); + u.x = _mm256_blend_ps (s1.x, s2.x, MASK); + + for (i = 0; i < 8; i++) + e[i] = (MASK & (0x01 << i)) ? s2.a[i] : s1.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vblendvpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vblendvpd-256-1.c new file mode 100644 index 00000000000..2f668c22e62 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vblendvpd-256-1.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 6 +#endif + +#define mask_v(pos) (((MASK >> (pos)) & 1ULL) << 63) + +void static +avx_test (void) +{ + int i; + union256d u, mask, s1, s2; + long long m[4]={mask_v(0), mask_v(1), mask_v(2), mask_v(3)}; + double e [4]; + + s1.x = _mm256_set_pd (34545, 95567, 23443, 5675); + s2.x = _mm256_set_pd (674, 57897, 93459, 45624); + mask.x = _mm256_set_pd (m[0], m[1], m[2], m[3]); + + u.x = _mm256_blendv_pd (s1.x, s2.x, mask.x); + + for (i = 0; i < 4; i++) + e[i] = (m[i] & (1ULL << 63)) ? s2.a[i] : s1.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vblendvps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vblendvps-256-1.c new file mode 100644 index 00000000000..0e48d690e85 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vblendvps-256-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 214 +#endif + +#define mask_v(pos) (((MASK >> (pos)) & 1U) << 31) + +void static +avx_test (void) +{ + int i; + union256 u, mask, s1, s2; + int m[8]={mask_v(0), mask_v(1), mask_v(2), mask_v(3), + mask_v(4), mask_v(5), mask_v(6), mask_v(7)}; + float e [8]; + + s1.x = _mm256_set_ps (34545, 95567, 23443, 5675, 2323, 67, 2345, 45667); + s2.x = _mm256_set_ps (674, 57897, 93459, 45624, 54674, 1237, 67436, 79608); + mask.x = _mm256_loadu_ps ((float *)m); + + u.x = _mm256_blendv_ps (s1.x, s2.x, mask.x); + + for (i = 0; i < 8; i++) + e[i] = (m[i] & (1ULL << 31)) ? s2.a[i] : s1.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vbroadcastf128-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vbroadcastf128-256-1.c new file mode 100644 index 00000000000..e0cddd1a94c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vbroadcastf128-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u; + union128 s; + float e [8]; + + s.x = _mm_set_ps(24.43, 68.346, 43.35, 546.46); + u.x = _mm256_broadcast_ps (&s.x); + + for (i = 0; i < 4; i++) + e[i+4] = e[i] = s.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vbroadcastf128-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vbroadcastf128-256-2.c new file mode 100644 index 00000000000..eb4ec579b40 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vbroadcastf128-256-2.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u; + union128d s; + double e [4]; + + s.x = _mm_set_pd(24.43, 68.346); + u.x = _mm256_broadcast_pd (&s.x); + + e[0] = e[2] = s.a[0]; + e[1] = e[3] = s.a[1]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vbroadcastsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vbroadcastsd-1.c new file mode 100644 index 00000000000..329405f3128 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vbroadcastsd-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + double s = 39678; + union256d u; + double e [4]; + + u.x = _mm256_broadcast_sd (&s); + + for (i = 0; i < 4; i++) + e[i] = s; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vbroadcastss-1.c b/gcc/testsuite/gcc.target/i386/avx-vbroadcastss-1.c new file mode 100644 index 00000000000..d6bf2ce61c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vbroadcastss-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + float s = 39678.3452; + union256 u; + float e [8]; + + u.x = _mm256_broadcast_ss (&s); + + for (i = 0; i < 8; i++) + e[i] = s; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vbroadcastss-2.c b/gcc/testsuite/gcc.target/i386/avx-vbroadcastss-2.c new file mode 100644 index 00000000000..56723cb282e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vbroadcastss-2.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + float s = 39678.3452; + union128 u; + float e [4]; + + u.x = _mm_broadcast_ss (&s); + + for (i = 0; i < 4; i++) + e[i] = s; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c new file mode 100644 index 00000000000..be69d47e822 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcmppd-1.c @@ -0,0 +1,78 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -std=c99" } */ + +#include "avx-check.h" +#include <math.h> + +double s1[2]={2134.3343,6678.346}; +double s2[2]={41124.234,6678.346}; +long long e[2]; + +union +{ + double d[2]; + long long ll[2]; +}d; + +void check(unsigned imm, char *id) +{ + if(checkVl(d.ll, e, 2)){ + printf("mm_cmp_pd(%s: 0x%x) FAILED\n", id, imm); + } +} + +#define CMP(imm, rel) \ + for (i = 0; i < 2; i++) e[i] = rel ? -1 : 0; \ + source1 = _mm_loadu_pd(s1); \ + source2 = _mm_loadu_pd(s2); \ + dest = _mm_cmp_pd(source1, source2, imm); \ + _mm_storeu_pd(d.d, dest); \ + check(imm, "" #imm ""); + +static void +avx_test () +{ + __m128d source1, source2, dest; + int i; + + d.ll[0] = e[0] = 222; + d.ll[1] = e[1] = -33; + + CMP(_CMP_EQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OS, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OS, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_Q, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_UQ, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_US, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_US, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_Q, !isunordered(s1[i], s2[i])); + + CMP(_CMP_EQ_UQ, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_US, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_US, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + + CMP(_CMP_FALSE_OQ, 0); + CMP(_CMP_NEQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OS, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OS, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_UQ, 1); + + CMP(_CMP_EQ_OS, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OQ, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OQ, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_S, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_US, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_UQ, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_UQ, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_S, !isunordered(s1[i], s2[i])); + CMP(_CMP_EQ_US, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_UQ, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_UQ, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + CMP(_CMP_FALSE_OS, 0); + CMP(_CMP_NEQ_OS, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OQ, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OQ, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_US, 1); + +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c new file mode 100644 index 00000000000..7000bb07feb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcmppd-256-1.c @@ -0,0 +1,75 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -std=c99" } */ + +#include "avx-check.h" +#include <math.h> + +double s1[4]={2134.3343,6678.346,453.345635,54646.464356}; +double s2[4]={41124.234,6678.346,8653.65635,856.43576}; +long long e[4]; + +union +{ + double d[4]; + long long ll[4]; +}d; + +void check(unsigned imm, char *id) +{ + if(checkVl(d.ll, e, 4)){ + printf("mm256_cmp_pd(%s: 0x%x) FAILED\n", id, imm); + } +} + +#define CMP(imm, rel) \ + for (i = 0; i < 4; i++) e[i] = rel ? -1 : 0; \ + source1 = _mm256_loadu_pd(s1); \ + source2 = _mm256_loadu_pd(s2); \ + dest = _mm256_cmp_pd(source1, source2, imm); \ + _mm256_storeu_pd(d.d, dest); \ + check(imm, "" #imm ""); + +static void +avx_test () +{ + __m256d source1, source2, dest; + int i; + + CMP(_CMP_EQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OS, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OS, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_Q, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_UQ, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_US, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_US, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_Q, !isunordered(s1[i], s2[i])); + + CMP(_CMP_EQ_UQ, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_US, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_US, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + + CMP(_CMP_FALSE_OQ, 0); + CMP(_CMP_NEQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OS, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OS, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_UQ, 1); + + CMP(_CMP_EQ_OS, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OQ, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OQ, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_S, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_US, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_UQ, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_UQ, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_S, !isunordered(s1[i], s2[i])); + CMP(_CMP_EQ_US, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_UQ, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_UQ, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + CMP(_CMP_FALSE_OS, 0); + CMP(_CMP_NEQ_OS, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OQ, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OQ, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_US, 1); + +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c new file mode 100644 index 00000000000..753f2ce64d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcmpps-1.c @@ -0,0 +1,74 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -std=c99" } */ + +#include "avx-check.h" +#include <math.h> + +float s1[4]={2134.3343,6678.346,453.345635,54646.464356}; +float s2[4]={41124.234,6678.346,8653.65635,856.43576}; +int e[4]; + +union +{ + float f[4]; + int i[4]; +}d; + +void check(unsigned imm, char *id) +{ + if(checkVi(d.i, e, 4)){ + printf("mm_cmp_ps(0x%x, %s) FAILED\n", imm, id); + } +} + +static void +avx_test () +{ + __m128 source1, source2, dest; + int i; + +#define CMP(imm, rel) \ + for (i = 0; i < 4; i++) e[i] = rel ? -1 : 0; \ + source1 = _mm_loadu_ps(s1); \ + source2 = _mm_loadu_ps(s2); \ + dest = _mm_cmp_ps(source1, source2, imm); \ + _mm_storeu_ps(d.f, dest); \ + check(imm, "" #imm ""); + + CMP(_CMP_EQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OS, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OS, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_Q, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_UQ, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_US, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_US, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_Q, !isunordered(s1[i], s2[i])); + + CMP(_CMP_EQ_UQ, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_US, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_US, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + + CMP(_CMP_FALSE_OQ, 0); + CMP(_CMP_NEQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OS, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OS, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_UQ, 1); + + CMP(_CMP_EQ_OS, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OQ, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OQ, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_S, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_US, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_UQ, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_UQ, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_S, !isunordered(s1[i], s2[i])); + CMP(_CMP_EQ_US, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_UQ, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_UQ, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + CMP(_CMP_FALSE_OS, 0); + CMP(_CMP_NEQ_OS, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OQ, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OQ, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_US, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c new file mode 100644 index 00000000000..c1292a25555 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcmpps-256-1.c @@ -0,0 +1,74 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -std=c99" } */ + +#include "avx-check.h" +#include <math.h> + +float s1[8]={2134.3343,6678.346,453.345635,54646.464356,456,678567,123,2346}; +float s2[8]={41124.234,6678.346,8653.65635,856.43576,7456,134,539,54674}; +int e[8]; + +union +{ + float f[8]; + int i[8]; +}d; + +void check(unsigned imm, char *id) +{ + if(checkVi(d.i, e, 8)){ + printf("mm256_cmp_ps(0x%x, %s) FAILED\n", imm, id); + } +} + +static void +avx_test () +{ + __m256 source1, source2, dest; + int i; + +#define CMP(imm, rel) \ + for (i = 0; i < 8; i++) e[i] = rel ? -1 : 0; \ + source1 = _mm256_loadu_ps(s1); \ + source2 = _mm256_loadu_ps(s2); \ + dest = _mm256_cmp_ps(source1, source2, imm); \ + _mm256_storeu_ps(d.f, dest); \ + check(imm, "" #imm ""); + + CMP(_CMP_EQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OS, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OS, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_Q, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_UQ, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_US, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_US, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_Q, !isunordered(s1[i], s2[i])); + + CMP(_CMP_EQ_UQ, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_US, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_US, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + + CMP(_CMP_FALSE_OQ, 0); + CMP(_CMP_NEQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OS, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OS, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_UQ, 1); + + CMP(_CMP_EQ_OS, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]); + CMP(_CMP_LT_OQ, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]); + CMP(_CMP_LE_OQ, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]); + CMP(_CMP_UNORD_S, isunordered(s1[i], s2[i])); + CMP(_CMP_NEQ_US, isunordered(s1[i], s2[i]) || s1[i] != s2[i]); + CMP(_CMP_NLT_UQ, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]); + CMP(_CMP_NLE_UQ, isunordered(s1[i], s2[i]) || s1[i] > s2[i]); + CMP(_CMP_ORD_S, !isunordered(s1[i], s2[i])); + CMP(_CMP_EQ_US, isunordered(s1[i], s2[i]) || s1[i] == s2[i]); + CMP(_CMP_NGE_UQ, isunordered(s1[i], s2[i]) || s1[i] < s2[i]); + CMP(_CMP_NGT_UQ, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]); + CMP(_CMP_FALSE_OS, 0); + CMP(_CMP_NEQ_OS, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]); + CMP(_CMP_GE_OQ, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]); + CMP(_CMP_GT_OQ, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]); + CMP(_CMP_TRUE_US, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c new file mode 100644 index 00000000000..97ca6e6c50f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcmpsd-1.c @@ -0,0 +1,71 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -std=c99" } */ + +#include "avx-check.h" +#include <math.h> + +double s1[] = {2134.3343, 6678.346}; +double s2[] = {41124.234, 6678.346}; +long long dd[] = {1, 2}, d[2]; +union{long long l[2]; double d[2];} e; + +void check(unsigned imm, char *id) +{ + if(checkVl(d, e.l, 2)){ + printf("mm_cmp_sd(%s: 0x%x) FAILED\n", id, imm); + } +} + +#define CMP(imm, rel) \ + e.l[0] = rel ? -1 : 0; \ + dest = _mm_loadu_pd((double*)dd); \ + source1 = _mm_loadu_pd(s1); \ + source2 = _mm_loadu_pd(s2); \ + dest = _mm_cmp_sd(source1, source2, imm); \ + _mm_storeu_pd((double*) d, dest); \ + check(imm, "" #imm ""); + +static void +avx_test () +{ + __m128d source1, source2, dest; + + e.d[1] = s1[1]; + + CMP(_CMP_EQ_OQ, !isunordered(s1[0], s2[0]) && s1[0] == s2[0]); + CMP(_CMP_LT_OS, !isunordered(s1[0], s2[0]) && s1[0] < s2[0]); + CMP(_CMP_LE_OS, !isunordered(s1[0], s2[0]) && s1[0] <= s2[0]); + CMP(_CMP_UNORD_Q, isunordered(s1[0], s2[0])); + CMP(_CMP_NEQ_UQ, isunordered(s1[0], s2[0]) || s1[0] != s2[0]); + CMP(_CMP_NLT_US, isunordered(s1[0], s2[0]) || s1[0] >= s2[0]); + CMP(_CMP_NLE_US, isunordered(s1[0], s2[0]) || s1[0] > s2[0]); + CMP(_CMP_ORD_Q, !isunordered(s1[0], s2[0])); + + CMP(_CMP_EQ_UQ, isunordered(s1[0], s2[0]) || s1[0] == s2[0]); + CMP(_CMP_NGE_US, isunordered(s1[0], s2[0]) || s1[0] < s2[0]); + CMP(_CMP_NGT_US, isunordered(s1[0], s2[0]) || s1[0] <= s2[0]); + + CMP(_CMP_FALSE_OQ, 0); + CMP(_CMP_NEQ_OQ, !isunordered(s1[0], s2[0]) && s1[0] != s2[0]); + CMP(_CMP_GE_OS, !isunordered(s1[0], s2[0]) && s1[0] >= s2[0]); + CMP(_CMP_GT_OS, !isunordered(s1[0], s2[0]) && s1[0] > s2[0]); + CMP(_CMP_TRUE_UQ, 1); + + CMP(_CMP_EQ_OS, !isunordered(s1[0], s2[0]) && s1[0] == s2[0]); + CMP(_CMP_LT_OQ, !isunordered(s1[0], s2[0]) && s1[0] < s2[0]); + CMP(_CMP_LE_OQ, !isunordered(s1[0], s2[0]) && s1[0] <= s2[0]); + CMP(_CMP_UNORD_S, isunordered(s1[0], s2[0])); + CMP(_CMP_NEQ_US, isunordered(s1[0], s2[0]) || s1[0] != s2[0]); + CMP(_CMP_NLT_UQ, isunordered(s1[0], s2[0]) || s1[0] >= s2[0]); + CMP(_CMP_NLE_UQ, isunordered(s1[0], s2[0]) || s1[0] > s2[0]); + CMP(_CMP_ORD_S, !isunordered(s1[0], s2[0])); + CMP(_CMP_EQ_US, isunordered(s1[0], s2[0]) || s1[0] == s2[0]); + CMP(_CMP_NGE_UQ, isunordered(s1[0], s2[0]) || s1[0] < s2[0]); + CMP(_CMP_NGT_UQ, isunordered(s1[0], s2[0]) || s1[0] <= s2[0]); + CMP(_CMP_FALSE_OS, 0); + CMP(_CMP_NEQ_OS, !isunordered(s1[0], s2[0]) && s1[0] != s2[0]); + CMP(_CMP_GE_OQ, !isunordered(s1[0], s2[0]) && s1[0] >= s2[0]); + CMP(_CMP_GT_OQ, !isunordered(s1[0], s2[0]) && s1[0] > s2[0]); + CMP(_CMP_TRUE_US, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c b/gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c new file mode 100644 index 00000000000..627333a860c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcmpss-1.c @@ -0,0 +1,73 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -std=c99" } */ + +#include "avx-check.h" +#include <math.h> + +float s1[]={2134.3343, 6678.346, 453.345635, 54646.464356}; +float s2[]={41124.234, 6678.346, 8653.65635, 856.43576}; +int dd[] = {1, 2, 3, 4}; +float d[4]; +union{int i[4]; float f[4];} e; + +void check(unsigned imm, char *id) +{ + if(checkVi((int*)d, e.i, 4)){ + printf("mm_cmp_ss(0x%x, %s) FAILED\n", imm, id); + } +} + +static void +avx_test () +{ + __m128 source1, source2, dest; + int i; + +#define CMP(imm, rel) \ + e.i[0] = rel ? -1 : 0; \ + dest = _mm_loadu_ps((float*)dd); \ + source1 = _mm_loadu_ps(s1); \ + source2 = _mm_loadu_ps(s2); \ + dest = _mm_cmp_ss(source1, source2, imm); \ + _mm_storeu_ps(d, dest); \ + check(imm, "" #imm ""); + + for(i = 1; i < 4; i++) e.f[i] = s1[i]; + + CMP(_CMP_EQ_OQ, !isunordered(s1[0], s2[0]) && s1[0] == s2[0]); + CMP(_CMP_LT_OS, !isunordered(s1[0], s2[0]) && s1[0] < s2[0]); + CMP(_CMP_LE_OS, !isunordered(s1[0], s2[0]) && s1[0] <= s2[0]); + CMP(_CMP_UNORD_Q, isunordered(s1[0], s2[0])); + CMP(_CMP_NEQ_UQ, isunordered(s1[0], s2[0]) || s1[0] != s2[0]); + CMP(_CMP_NLT_US, isunordered(s1[0], s2[0]) || s1[0] >= s2[0]); + CMP(_CMP_NLE_US, isunordered(s1[0], s2[0]) || s1[0] > s2[0]); + CMP(_CMP_ORD_Q, !isunordered(s1[0], s2[0])); + + CMP(_CMP_EQ_UQ, isunordered(s1[0], s2[0]) || s1[0] == s2[0]); + CMP(_CMP_NGE_US, isunordered(s1[0], s2[0]) || s1[0] < s2[0]); + CMP(_CMP_NGT_US, isunordered(s1[0], s2[0]) || s1[0] <= s2[0]); + + CMP(_CMP_FALSE_OQ, 0); + CMP(_CMP_NEQ_OQ, !isunordered(s1[0], s2[0]) && s1[0] != s2[0]); + CMP(_CMP_GE_OS, !isunordered(s1[0], s2[0]) && s1[0] >= s2[0]); + CMP(_CMP_GT_OS, !isunordered(s1[0], s2[0]) && s1[0] > s2[0]); + CMP(_CMP_TRUE_UQ, 1); + + CMP(_CMP_EQ_OS, !isunordered(s1[0], s2[0]) && s1[0] == s2[0]); + CMP(_CMP_LT_OQ, !isunordered(s1[0], s2[0]) && s1[0] < s2[0]); + CMP(_CMP_LE_OQ, !isunordered(s1[0], s2[0]) && s1[0] <= s2[0]); + CMP(_CMP_UNORD_S, isunordered(s1[0], s2[0])); + CMP(_CMP_NEQ_US, isunordered(s1[0], s2[0]) || s1[0] != s2[0]); + CMP(_CMP_NLT_UQ, isunordered(s1[0], s2[0]) || s1[0] >= s2[0]); + CMP(_CMP_NLE_UQ, isunordered(s1[0], s2[0]) || s1[0] > s2[0]); + CMP(_CMP_ORD_S, !isunordered(s1[0], s2[0])); + CMP(_CMP_EQ_US, isunordered(s1[0], s2[0]) || s1[0] == s2[0]); + CMP(_CMP_NGE_UQ, isunordered(s1[0], s2[0]) || s1[0] < s2[0]); + CMP(_CMP_NGT_UQ, isunordered(s1[0], s2[0]) || s1[0] <= s2[0]); + CMP(_CMP_FALSE_OS, 0); + CMP(_CMP_NEQ_OS, !isunordered(s1[0], s2[0]) && s1[0] != s2[0]); + CMP(_CMP_GE_OQ, !isunordered(s1[0], s2[0]) && s1[0] >= s2[0]); + CMP(_CMP_GT_OQ, !isunordered(s1[0], s2[0]) && s1[0] > s2[0]); + CMP(_CMP_TRUE_US, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomisd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcomisd-1.c new file mode 100644 index 00000000000..419249b46e4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomisd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-comisd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomisd-2.c b/gcc/testsuite/gcc.target/i386/avx-vcomisd-2.c new file mode 100644 index 00000000000..9f757ef04de --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomisd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-comisd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomisd-3.c b/gcc/testsuite/gcc.target/i386/avx-vcomisd-3.c new file mode 100644 index 00000000000..3bb5453c26d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomisd-3.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-comisd-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomisd-4.c b/gcc/testsuite/gcc.target/i386/avx-vcomisd-4.c new file mode 100644 index 00000000000..f5c7a5d3b60 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomisd-4.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-comisd-4.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomisd-5.c b/gcc/testsuite/gcc.target/i386/avx-vcomisd-5.c new file mode 100644 index 00000000000..314cb09ee53 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomisd-5.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-comisd-5.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomisd-6.c b/gcc/testsuite/gcc.target/i386/avx-vcomisd-6.c new file mode 100644 index 00000000000..72f54138f75 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomisd-6.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-comisd-6.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomiss-1.c b/gcc/testsuite/gcc.target/i386/avx-vcomiss-1.c new file mode 100644 index 00000000000..6b214fd1182 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomiss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-comiss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomiss-2.c b/gcc/testsuite/gcc.target/i386/avx-vcomiss-2.c new file mode 100644 index 00000000000..f83b977a420 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomiss-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-comiss-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomiss-3.c b/gcc/testsuite/gcc.target/i386/avx-vcomiss-3.c new file mode 100644 index 00000000000..a2db9e91ca1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomiss-3.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-comiss-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomiss-4.c b/gcc/testsuite/gcc.target/i386/avx-vcomiss-4.c new file mode 100644 index 00000000000..530dfc0c5ba --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomiss-4.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-comiss-4.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomiss-5.c b/gcc/testsuite/gcc.target/i386/avx-vcomiss-5.c new file mode 100644 index 00000000000..b149736b3df --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomiss-5.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-comiss-5.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcomiss-6.c b/gcc/testsuite/gcc.target/i386/avx-vcomiss-6.c new file mode 100644 index 00000000000..45e94daf365 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcomiss-6.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-comiss-6.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtdq2pd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtdq2pd-1.c new file mode 100644 index 00000000000..5d08be9029d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtdq2pd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtdq2pd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtdq2pd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtdq2pd-256-1.c new file mode 100644 index 00000000000..4b39ffe9a2d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtdq2pd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union128i_d s1; + union256d u; + double e [4]; + + s1.x = _mm_set_epi32 (2134.3343,1234.635654,453.345635,54646.464356); + u.x = _mm256_cvtepi32_pd (s1.x); + + for (i = 0; i < 4; i++) + e[i] = (double)s1.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtdq2ps-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtdq2ps-1.c new file mode 100644 index 00000000000..1e2ad625446 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtdq2ps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtdq2ps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtpd2dq-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2dq-1.c new file mode 100644 index 00000000000..752497514f6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2dq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtpd2dq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtpd2dq-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2dq-256-1.c new file mode 100644 index 00000000000..30e93af927a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2dq-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d s1; + union128i_d u; + int e [4]; + + s1.x = _mm256_set_pd (2.78, 7777768.82, 23.67, 536.46); + u.x = _mm256_cvtpd_epi32 (s1.x); + + for (i = 0; i < 4; i++) + e[i] = (int)(s1.a[i] + 0.5); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtpd2ps-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2ps-1.c new file mode 100644 index 00000000000..5bc43d561c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2ps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtpd2ps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtpd2ps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2ps-256-1.c new file mode 100644 index 00000000000..987f2b263f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtpd2ps-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d s1; + union128 u; + float e [4]; + + s1.x = _mm256_set_pd (2.43, 68.46, 23.35, 536.46); + u.x = _mm256_cvtpd_ps (s1.x); + + for (i = 0; i < 4; i++) + e[i] = (float)s1.a[i]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtps2dq-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtps2dq-1.c new file mode 100644 index 00000000000..36d90a265a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtps2dq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtps2dq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtps2dq-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtps2dq-256-1.c new file mode 100644 index 00000000000..47ec12b8d0f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtps2dq-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 s1; + union256i_d u; + int e [8]; + + s1.x = _mm256_set_ps (2.78, 77768.82, 23.67, 536.46, 4564.6575, 568.1263, 9889.2422, 7352.4563); + u.x = _mm256_cvtps_epi32 (s1.x); + + for (i = 0; i < 8; i++) + e[i] = (int)(s1.a[i] + 0.5); + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtps2pd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtps2pd-1.c new file mode 100644 index 00000000000..114a71976cf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtps2pd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtps2pd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtps2pd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtps2pd-256-1.c new file mode 100644 index 00000000000..9d48998a3fd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtps2pd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union128 s1; + union256d u; + double e [4]; + + s1.x = _mm_set_ps (2.43, 68.46, 23.35, 536.46); + u.x = _mm256_cvtps_pd (s1.x); + + for (i = 0; i < 4; i++) + e[i] = (double)s1.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtsd2si-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtsd2si-1.c new file mode 100644 index 00000000000..53c61a2ea1b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtsd2si-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtsd2si-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtsd2si-2.c b/gcc/testsuite/gcc.target/i386/avx-vcvtsd2si-2.c new file mode 100644 index 00000000000..a5b04fa5eab --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtsd2si-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtsd2si-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtsd2ss-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtsd2ss-1.c new file mode 100644 index 00000000000..c0e224d06fe --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtsd2ss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtsd2ss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtsi2sd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2sd-1.c new file mode 100644 index 00000000000..35da346d6f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2sd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtsi2sd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtsi2sd-2.c b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2sd-2.c new file mode 100644 index 00000000000..49096cfceb1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2sd-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtsi2sd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtsi2ss-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2ss-1.c new file mode 100644 index 00000000000..12ac36c72f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2ss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-cvtsi2ss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtsi2ss-2.c b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2ss-2.c new file mode 100644 index 00000000000..765c455f872 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtsi2ss-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-cvtsi2ss-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtss2sd-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtss2sd-1.c new file mode 100644 index 00000000000..0f6365c35ef --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtss2sd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvtss2sd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtss2si-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvtss2si-1.c new file mode 100644 index 00000000000..3a51ff168e8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtss2si-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-cvtss2si-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvtss2si-2.c b/gcc/testsuite/gcc.target/i386/avx-vcvtss2si-2.c new file mode 100644 index 00000000000..5160b8de10c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvtss2si-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-cvtss2si-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttpd2dq-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvttpd2dq-1.c new file mode 100644 index 00000000000..f27160a6b00 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttpd2dq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvttpd2dq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttpd2dq-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvttpd2dq-256-1.c new file mode 100644 index 00000000000..16edf8ac7cf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttpd2dq-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d s1; + union128i_d u; + int e [4]; + + s1.x = _mm256_set_pd (2.43, 68.78, 23.61, 536.46); + u.x = _mm256_cvttpd_epi32 (s1.x); + + for (i = 0; i < 4; i++) + e[i] = (int)s1.a[i]; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttps2dq-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvttps2dq-1.c new file mode 100644 index 00000000000..f8ab025db10 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttps2dq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvttps2dq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttps2dq-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvttps2dq-256-1.c new file mode 100644 index 00000000000..0a580f015d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttps2dq-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 s1; + union256i_d u; + int e [8]; + + s1.x = _mm256_set_ps (45.64, 4564.56, 2.3, 5.5, 57.57, 89.34, 54.12, 954.67); + u.x = _mm256_cvttps_epi32 (s1.x); + + for (i = 0; i < 8; i++) + e[i] = (int)s1.a[i]; + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttsd2si-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvttsd2si-1.c new file mode 100644 index 00000000000..b9963d4ab9d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttsd2si-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvttsd2si-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttsd2si-2.c b/gcc/testsuite/gcc.target/i386/avx-vcvttsd2si-2.c new file mode 100644 index 00000000000..dcf487afb57 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttsd2si-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-cvttsd2si-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttss2si-1.c b/gcc/testsuite/gcc.target/i386/avx-vcvttss2si-1.c new file mode 100644 index 00000000000..94c94c1d624 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttss2si-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-cvttss2si-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vcvttss2si-2.c b/gcc/testsuite/gcc.target/i386/avx-vcvttss2si-2.c new file mode 100644 index 00000000000..14b072146c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vcvttss2si-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-cvttss2si-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdivpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vdivpd-1.c new file mode 100644 index 00000000000..57ddfd1f7d4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdivpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-divpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdivpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vdivpd-256-1.c new file mode 100644 index 00000000000..1840e3d560d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdivpd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_div_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] / s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vdivps-1.c b/gcc/testsuite/gcc.target/i386/avx-vdivps-1.c new file mode 100644 index 00000000000..d4fcaebdfb5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdivps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-divps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdivps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vdivps-256-1.c new file mode 100644 index 00000000000..3ff4c7ee2c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdivps-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e[8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_div_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] / s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vdivsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vdivsd-1.c new file mode 100644 index 00000000000..faca3ed1c24 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdivsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-divsd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdivss-1.c b/gcc/testsuite/gcc.target/i386/avx-vdivss-1.c new file mode 100644 index 00000000000..f5740eba424 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdivss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-divss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdppd-1.c b/gcc/testsuite/gcc.target/i386/avx-vdppd-1.c new file mode 100644 index 00000000000..7d04cc4bcc8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdppd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-dppd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdppd-2.c b/gcc/testsuite/gcc.target/i386/avx-vdppd-2.c new file mode 100644 index 00000000000..6e30faf45f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdppd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-dppd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdpps-1.c b/gcc/testsuite/gcc.target/i386/avx-vdpps-1.c new file mode 100644 index 00000000000..75ba0be5fcd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdpps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-dpps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vdpps-2.c b/gcc/testsuite/gcc.target/i386/avx-vdpps-2.c new file mode 100644 index 00000000000..b54b90969da --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vdpps-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-dpps-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-1.c new file mode 100644 index 00000000000..4919d640f0f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-1.c @@ -0,0 +1,29 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef OFFSET +#define OFFSET 1 +#endif + +#if OFFSET < 0 || OFFSET > 1 +#error OFFSET must be within [0..1] +#endif + +void static +avx_test (void) +{ + union256d s1; + union128d u; + double e [2]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + u.x = _mm256_extractf128_pd (s1.x, OFFSET); + + __builtin_memcpy (e, s1.a + OFFSET * 2, sizeof e); + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-2.c new file mode 100644 index 00000000000..db26e181c46 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vextractf128-256-2.c @@ -0,0 +1,29 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef OFFSET +#define OFFSET 1 +#endif + +#if OFFSET < 0 || OFFSET > 1 +#error OFFSET must be within [0..1] +#endif + +void static +avx_test (void) +{ + union256 s1; + union128 u; + float e [4]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + u.x = _mm256_extractf128_ps (s1.x, OFFSET); + + __builtin_memcpy (e, s1.a + OFFSET * 4, sizeof e); + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vextractps-1.c b/gcc/testsuite/gcc.target/i386/avx-vextractps-1.c new file mode 100644 index 00000000000..4215c34dc66 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vextractps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-extractps.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vhaddpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vhaddpd-1.c new file mode 100644 index 00000000000..7809c850c21 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhaddpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-haddpd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vhaddpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vhaddpd-256-1.c new file mode 100644 index 00000000000..b9245a36822 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhaddpd-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_hadd_pd (s1.x, s2.x); + + e[0] = s1.a[0] + s1.a[1]; + e[1] = s2.a[0] + s2.a[1]; + e[2] = s1.a[2] + s1.a[3]; + e[3] = s2.a[2] + s2.a[3]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vhaddps-1.c b/gcc/testsuite/gcc.target/i386/avx-vhaddps-1.c new file mode 100644 index 00000000000..73dcfb6c4c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhaddps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-haddps.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vhaddps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vhaddps-256-1.c new file mode 100644 index 00000000000..fbc58238a3c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhaddps-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_hadd_ps (s1.x, s2.x); + + e[0] = s1.a[0] + s1.a[1]; + e[1] = s1.a[2] + s1.a[3]; + e[2] = s2.a[0] + s2.a[1]; + e[3] = s2.a[2] + s2.a[3]; + e[4] = s1.a[4] + s1.a[5]; + e[5] = s1.a[6] + s1.a[7]; + e[6] = s2.a[4] + s2.a[5]; + e[7] = s2.a[6] + s2.a[7]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vhsubpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vhsubpd-1.c new file mode 100644 index 00000000000..68d14327ae6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhsubpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-hsubpd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vhsubpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vhsubpd-256-1.c new file mode 100644 index 00000000000..df710d7f0ed --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhsubpd-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_hsub_pd (s1.x, s2.x); + + e[0] = s1.a[0] - s1.a[1]; + e[1] = s2.a[0] - s2.a[1]; + e[2] = s1.a[2] - s1.a[3]; + e[3] = s2.a[2] - s2.a[3]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vhsubps-1.c b/gcc/testsuite/gcc.target/i386/avx-vhsubps-1.c new file mode 100644 index 00000000000..2ddd2c0c8e0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhsubps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-hsubps.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vhsubps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vhsubps-256-1.c new file mode 100644 index 00000000000..aa601c8a7a8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vhsubps-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_hsub_ps (s1.x, s2.x); + + e[0] = s1.a[0] - s1.a[1]; + e[1] = s1.a[2] - s1.a[3]; + e[2] = s2.a[0] - s2.a[1]; + e[3] = s2.a[2] - s2.a[3]; + e[4] = s1.a[4] - s1.a[5]; + e[5] = s1.a[6] - s1.a[7]; + e[6] = s2.a[4] - s2.a[5]; + e[7] = s2.a[6] - s2.a[7]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-1.c new file mode 100644 index 00000000000..2390e5c7e96 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-1.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef OFFSET +#define OFFSET 1 +#endif + +#if OFFSET < 0 || OFFSET > 1 +#error OFFSET must be within [0..1] +#endif + +void static +avx_test (void) +{ + int i; + union256d u, s1; + union128d s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm_set_pd (68543.731254, 3452.578238); + u.x = _mm256_insertf128_pd (s1.x, s2.x, OFFSET); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i]; + + for (i=0; i < 2; i++) + e[i + (OFFSET * 2)] = s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-2.c new file mode 100644 index 00000000000..ce0b23bbf4e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef OFFSET +#define OFFSET 0 +#endif + +#if OFFSET < 0 || OFFSET > 1 +#error OFFSET must be within [0..1] +#endif + +void static +avx_test (void) +{ + int i; + union256 u, s1; + union128 s2; + float e [8]; + + s1.x = _mm256_set_ps (39.467, 45.789, 78.342, 67.892, 76.678, 12.963, 29.746, 24.753); + s2.x = _mm_set_ps (57.493, 38.395, 22.479, 31.614); + u.x = _mm256_insertf128_ps (s1.x, s2.x, OFFSET); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i]; + + for (i=0; i < 4; i++) + e[i + (OFFSET * 4)] = s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-3.c b/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-3.c new file mode 100644 index 00000000000..89834d55408 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vinsertf128-256-3.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef OFFSET +#define OFFSET 0 +#endif + +#if OFFSET < 0 || OFFSET > 1 +#error OFFSET must be within [0..1] +#endif + +void static +avx_test (void) +{ + int i; + union256i_d u, s1; + union128i_d s2; + int e [8]; + + s1.x = _mm256_set_epi32 (39467, 45789, 78342, 67892, 76678, 12963, 29746, 24753); + s2.x = _mm_set_epi32 (57493, 38395, 22479, 31614); + u.x = _mm256_insertf128_si256 (s1.x, s2.x, OFFSET); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i]; + + for (i=0; i < 4; i++) + e[i + (OFFSET * 4)] = s2.a[i]; + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vinsertps-1.c b/gcc/testsuite/gcc.target/i386/avx-vinsertps-1.c new file mode 100644 index 00000000000..ad1f33308f6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vinsertps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-insertps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vinsertps-2.c b/gcc/testsuite/gcc.target/i386/avx-vinsertps-2.c new file mode 100644 index 00000000000..7b93174aa7a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vinsertps-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-insertps-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vlddqu-1.c b/gcc/testsuite/gcc.target/i386/avx-vlddqu-1.c new file mode 100644 index 00000000000..7ecea79e898 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vlddqu-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-lddqu.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vlddqu-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vlddqu-256-1.c new file mode 100644 index 00000000000..82c0ed58002 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vlddqu-256-1.c @@ -0,0 +1,17 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int e[8]={ 23, 67, 53, 6, 4, 6, 85, 234}; + union256i_d u; + + u.x = _mm256_lddqu_si256 ((__m256i *) e); + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c new file mode 100644 index 00000000000..f29826bbbd4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 7 +#endif + +#define mask_v(pos) (((MASK & (0x1ULL << (pos))) >> (pos)) << 63) + +void static +avx_test (void) +{ + int i; + long long m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)}; + double s[4] = {1.1, 2.2, 3.3, 4.4}; + union256d u, mask; + double e [4] = {0.0}; + + mask.x = _mm256_loadu_pd ((double*)m); + u.x = _mm256_maskload_pd (s, mask.x); + + for (i = 0 ; i < 4; i++) + e[i] = m[i] ? s[i] : 0; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c new file mode 100644 index 00000000000..1e574b6993b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 6 +#endif + +#define mask_v(pos) (((MASK & (0x1ULL << (pos))) >> (pos)) << 63) + +void static +avx_test (void) +{ + int i; + long long m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)}; + double s[4] = {1.1, 2.2, 3.3, 4.4}; + double e [4] = {0.0}; + double d [4] = {0.0}; + union256d src, mask; + + src.x = _mm256_loadu_pd (s); + mask.x = _mm256_loadu_pd ((double*)m); + _mm256_maskstore_pd (d, mask.x, src.x); + + for (i = 0 ; i < 4; i++) + e[i] = m[i] ? s[i] : 0; + + if (checkVd (d, e, 4)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c new file mode 100644 index 00000000000..9e6c7f91d91 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c @@ -0,0 +1,30 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 134 +#endif + +#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31) + +void static +avx_test (void) +{ + int i; + int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)}; + float s[8] = {1,2,3,4,5,6,7,8}; + union256 u, mask; + float e [8] = {0.0}; + + mask.x = _mm256_loadu_ps ((float*)m); + u.x = _mm256_maskload_ps (s, mask.x); + + for (i = 0 ; i < 8; i++) + e[i] = m[i] ? s[i] : 0; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c new file mode 100644 index 00000000000..90d91a06a6d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 214 +#endif + +#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31) + +void static +avx_test (void) +{ + int i; + int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)}; + float s[8] = {1,2,3,4,5,6,7,8}; + union256 src, mask; + float e [8] = {0.0}; + float d [8] = {0.0}; + + src.x = _mm256_loadu_ps (s); + mask.x = _mm256_loadu_ps ((float *)m); + _mm256_maskstore_ps (d, mask.x, src.x); + + for (i = 0 ; i < 8; i++) + e[i] = m[i] ? s[i] : 0; + + if (checkVf (d, e, 8)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaxpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaxpd-1.c new file mode 100644 index 00000000000..981e2a5b6e7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaxpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-maxpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaxpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaxpd-256-1.c new file mode 100644 index 00000000000..7b9c91c0388 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaxpd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_max_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] > s2.a[i] ? s1.a[i] : s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaxps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaxps-1.c new file mode 100644 index 00000000000..e4c41450d91 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaxps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-maxps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaxps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaxps-256-1.c new file mode 100644 index 00000000000..44bb7ed9c49 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaxps-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 24567.16, 3.15, 4567.14, 5.13, 65467.12, 788.11, 8.9); + u.x = _mm256_max_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] > s2.a[i] ? s1.a[i] : s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaxsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaxsd-1.c new file mode 100644 index 00000000000..e24410cd145 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaxsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-maxsd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaxss-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaxss-1.c new file mode 100644 index 00000000000..afe5d0adbda --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmaxss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-maxss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vminpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vminpd-1.c new file mode 100644 index 00000000000..a7eb6497297 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vminpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-minpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vminpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vminpd-256-1.c new file mode 100644 index 00000000000..555e029bd48 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vminpd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_min_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] < s2.a[i] ? s1.a[i] : s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vminps-1.c b/gcc/testsuite/gcc.target/i386/avx-vminps-1.c new file mode 100644 index 00000000000..dfb07ba2367 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vminps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-minps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vminps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vminps-256-1.c new file mode 100644 index 00000000000..19ac83a723c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vminps-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 24567.16, 3.15, 4567.14, 5.13, 65467.12, 788.11, 8.9); + u.x = _mm256_min_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] < s2.a[i] ? s1.a[i] : s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vminsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vminsd-1.c new file mode 100644 index 00000000000..5aa1d9aa0a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vminsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-minsd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vminss-1.c b/gcc/testsuite/gcc.target/i386/avx-vminss-1.c new file mode 100644 index 00000000000..c2e6f2799f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vminss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-minss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovapd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovapd-1.c new file mode 100644 index 00000000000..5d97a5d2f3f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovapd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movapd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovapd-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovapd-2.c new file mode 100644 index 00000000000..9856d290736 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovapd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movapd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovapd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovapd-256-1.c new file mode 100644 index 00000000000..d9121228307 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovapd-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256d +__attribute__((noinline, unused)) +test (double *e) +{ + return _mm256_load_pd (e); +} + +void static +avx_test (void) +{ + union256d u; + double e [4] __attribute__ ((aligned (8))) = {41124.234,2344.2354,8653.65635,856.43576}; + + u.x = test (e); + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovapd-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovapd-256-2.c new file mode 100644 index 00000000000..96a664ac11e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovapd-256-2.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +__attribute__((noinline, unused)) +test (double *e, __m256d a) +{ + return _mm256_store_pd (e, a); +} + +void static +avx_test (void) +{ + union256d u; + double e [4] __attribute__ ((aligned (8))) = {0.0}; + + u.x = _mm256_set_pd (39578.467285, 7856.342941, 85632.783567, 47563.234215); + + test (e, u.x); + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovaps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovaps-1.c new file mode 100644 index 00000000000..a10894c35d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovaps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movaps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovaps-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovaps-2.c new file mode 100644 index 00000000000..ad0cf47c4b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovaps-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movaps-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovaps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovaps-256-1.c new file mode 100644 index 00000000000..74681c326c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovaps-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256 +__attribute__((noinline, unused)) +test (float *e) +{ + return _mm256_load_ps (e); +} + +void static +avx_test (void) +{ + union256 u; + float e [8] __attribute__ ((aligned (32))) = {24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4}; + + u.x = test (e); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovaps-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovaps-256-2.c new file mode 100644 index 00000000000..dbd5227c0d7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovaps-256-2.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +__attribute__((noinline, unused)) +test (float *e, __m256 a) +{ + return _mm256_store_ps (e, a); +} + +void static +avx_test (void) +{ + union256 u; + float e [8] __attribute__ ((aligned (32))) = {0.0}; + + u.x = _mm256_set_ps (1.17, 24567.16, 3.15, 4567.14, 5.13, 65467.12, 788.11, 8.9); + + test (e, u.x); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovd-1.c new file mode 100644 index 00000000000..cdaec13cf1f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovd-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovd-2.c new file mode 100644 index 00000000000..3c3732baf7d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovd-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovddup-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovddup-1.c new file mode 100644 index 00000000000..4db42e137de --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovddup-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -mfpmath=sse" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-movddup.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovddup-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovddup-256-1.c new file mode 100644 index 00000000000..a971dbf4f12 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovddup-256-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1; + double e [4]; + + s1.x = _mm256_set_pd (39578.467285, 7856.342941, 85632.783567, 47563.234215); + u.x = _mm256_movedup_pd (s1.x); + + for (i = 0; i < 2; i++) + e[2*i] = e[2*i+1] = s1.a[2*i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqa-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-1.c new file mode 100644 index 00000000000..b14aeaff951 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movdqa-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqa-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-2.c new file mode 100644 index 00000000000..94a758d2e03 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movdqa-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqa-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-256-1.c new file mode 100644 index 00000000000..abe62880e94 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256i +__attribute__ ((noinline, unused)) +test (__m256i *p) +{ + return _mm256_load_si256 (p); +} + +void static +avx_test (void) +{ + union256i_d u; + int e [8] __attribute__ ((aligned (32))) = {23, 67, 53, 6, 4, 6, 85, 234}; + + u.x = test ((__m256i *)e); + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqa-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-256-2.c new file mode 100644 index 00000000000..41f3ed0e614 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqa-256-2.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256i_d u; + int e [8] __attribute__ ((aligned (32))) = {0}; + + u.x = _mm256_set_epi32(23, 67, 53, 6, 4, 6, 85, 234); + _mm256_store_si256 ((__m256i *)e, u.x); + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqu-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-1.c new file mode 100644 index 00000000000..7785b40ab20 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movdqu-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqu-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-2.c new file mode 100644 index 00000000000..f0eead7003a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movdqu-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqu-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-256-1.c new file mode 100644 index 00000000000..849df7bc3d5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-256-1.c @@ -0,0 +1,17 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256i_d u; + int e [8] = {23, 67, 53, 6, 4, 6, 85, 234}; + + u.x = _mm256_loadu_si256 ((__m256i *) e); + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovdqu-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-256-2.c new file mode 100644 index 00000000000..eb0af202c00 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovdqu-256-2.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256i_d u; + int e [8] = {0}; + + u.x = _mm256_set_epi32(23, 67, 53, 6, 4, 6, 85, 234); + _mm256_storeu_si256 ((__m256i *)e, u.x); + + if (check_union256i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovhlps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovhlps-1.c new file mode 100644 index 00000000000..25beca971b4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovhlps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movhlps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovhpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovhpd-1.c new file mode 100644 index 00000000000..246275cd207 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovhpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movhpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovhpd-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovhpd-2.c new file mode 100644 index 00000000000..1cfdf59c269 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovhpd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movhpd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovhps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovhps-1.c new file mode 100644 index 00000000000..8cf1eec8dc6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovhps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movhps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovhps-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovhps-2.c new file mode 100644 index 00000000000..c835f151259 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovhps-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movhps-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovlhps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovlhps-1.c new file mode 100644 index 00000000000..8f8234b31dc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovlhps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movlhps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovlpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovlpd-1.c new file mode 100644 index 00000000000..64d90c6cb5c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovlpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movlpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovlpd-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovlpd-2.c new file mode 100644 index 00000000000..081956a9dd4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovlpd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movlpd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovmskpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovmskpd-1.c new file mode 100644 index 00000000000..07eb8518594 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovmskpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movmskpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovmskpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovmskpd-256-1.c new file mode 100644 index 00000000000..71353c44d18 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovmskpd-256-1.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + int d; + union256d s1; + double source[4] = {-45, -3, -34.56, 35}; + int e = 0; + + s1.x = _mm256_loadu_pd (source); + d = _mm256_movemask_pd (s1.x); + + for (i = 0; i < 4; i++) + if (source[i] < 0) + e |= (1 << i); + + if (checkVi (&d, &e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovmskps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovmskps-1.c new file mode 100644 index 00000000000..df4d1e78d4d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovmskps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movmskps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovmskps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovmskps-256-1.c new file mode 100644 index 00000000000..4b81d04139d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovmskps-256-1.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + int d; + union256 s1; + float source[8] = {-45, -3, -34.56, 35, 5.46,46, -464.3, 56}; + int e = 0; + + s1.x = _mm256_loadu_ps (source); + d = _mm256_movemask_ps (s1.x); + + for (i = 0; i < 8; i++) + if (source[i] < 0) + e |= (1 << i); + + if (checkVi (&d, &e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovntdq-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovntdq-1.c new file mode 100644 index 00000000000..166d46f2030 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovntdq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movntdq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovntdqa-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovntdqa-1.c new file mode 100644 index 00000000000..c884d1e5e11 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovntdqa-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-movntdqa.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovntpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovntpd-1.c new file mode 100644 index 00000000000..d547a2a9eba --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovntpd-1.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movntpd-1.c" + diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovntps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovntps-1.c new file mode 100644 index 00000000000..b9732f26de3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovntps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movntps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovq-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovq-1.c new file mode 100644 index 00000000000..44d2023082a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovq-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovq-2.c new file mode 100644 index 00000000000..cf0f4eb6947 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovq-2.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movq-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovq-3.c b/gcc/testsuite/gcc.target/i386/avx-vmovq-3.c new file mode 100644 index 00000000000..26944d11860 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovq-3.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movq-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovsd-1.c new file mode 100644 index 00000000000..185784419f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movsd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovsd-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovsd-2.c new file mode 100644 index 00000000000..672b25bfd8d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovsd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movsd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovshdup-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovshdup-1.c new file mode 100644 index 00000000000..ee995e3a744 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovshdup-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -mfpmath=sse" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-movshdup.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovshdup-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovshdup-256-1.c new file mode 100644 index 00000000000..a4b57a0c40d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovshdup-256-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1; + float e[8]; + + s1.x = _mm256_set_ps (134.3, 1234.54, 45.335, 646.456, 43.54, 473.34, 78, 89.54); + u.x = _mm256_movehdup_ps (s1.x); + + for (i = 0; i < 4; i++) + e[2*i] = e[2*i+1] = s1.a[2*i+1]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovsldup-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovsldup-1.c new file mode 100644 index 00000000000..67ea717adcc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovsldup-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx -mfpmath=sse" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse3-movsldup.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovsldup-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovsldup-256-1.c new file mode 100644 index 00000000000..52127bec221 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovsldup-256-1.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1; + float e[8]; + + s1.x = _mm256_set_ps (134.3, 1234.54, 45.335, 646.456, 43.54, 473.34, 78, 89.54); + u.x = _mm256_moveldup_ps (s1.x); + + for (i = 0; i < 4; i++) + e[2*i] = e[2*i+1] = s1.a[2*i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovss-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovss-1.c new file mode 100644 index 00000000000..ff983e6b3f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovss-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovss-2.c new file mode 100644 index 00000000000..e9a8bdc5969 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovss-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movss-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovss-3.c b/gcc/testsuite/gcc.target/i386/avx-vmovss-3.c new file mode 100644 index 00000000000..b73e2af067f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovss-3.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movss-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovupd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovupd-1.c new file mode 100644 index 00000000000..67f08744a38 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovupd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movupd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovupd-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovupd-2.c new file mode 100644 index 00000000000..cb6f27763a5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovupd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-movupd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovupd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovupd-256-1.c new file mode 100644 index 00000000000..8683a78daa6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovupd-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256d +__attribute__((noinline, unused)) +test (double *e) +{ + return _mm256_loadu_pd (e); +} + +void static +avx_test (void) +{ + union256d u; + double e [4] = {41124.234,2344.2354,8653.65635,856.43576}; + + u.x = test (e); + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovupd-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovupd-256-2.c new file mode 100644 index 00000000000..4cbd0e7e29b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovupd-256-2.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +__attribute__((noinline, unused)) +test (double *e, __m256d a) +{ + return _mm256_storeu_pd (e, a); +} + +void static +avx_test (void) +{ + union256d u; + double e [4] = {0.0}; + + u.x = _mm256_set_pd (39578.467285, 7856.342941, 85632.783567, 47563.234215); + + test (e, u.x); + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovups-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovups-1.c new file mode 100644 index 00000000000..5b9a98b0560 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovups-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movups-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovups-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovups-2.c new file mode 100644 index 00000000000..e5668a29a7c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovups-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-movups-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovups-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmovups-256-1.c new file mode 100644 index 00000000000..87d8409983a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovups-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static __m256 +__attribute__((noinline, unused)) +test (float *e) +{ + return _mm256_loadu_ps (e); +} + +void static +avx_test (void) +{ + union256 u; + float e [8] = {24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4}; + + u.x = test (e); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmovups-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmovups-256-2.c new file mode 100644 index 00000000000..c1781979a05 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmovups-256-2.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +__attribute__((noinline, unused)) +test (float *e, __m256 a) +{ + return _mm256_storeu_ps (e, a); +} + +void static +avx_test (void) +{ + union256 u; + float e [8] = {0.0}; + + u.x = _mm256_set_ps (1.17, 24567.16, 3.15, 4567.14, 5.13, 65467.12, 788.11, 8.9); + + test (e, u.x); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmpsadbw-1.c b/gcc/testsuite/gcc.target/i386/avx-vmpsadbw-1.c new file mode 100644 index 00000000000..403423e66ca --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmpsadbw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-mpsadbw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmulpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmulpd-1.c new file mode 100644 index 00000000000..0fa0f1ad798 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmulpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-mulpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmulpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmulpd-256-1.c new file mode 100644 index 00000000000..c6d9c477085 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmulpd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_mul_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] * s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmulps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmulps-1.c new file mode 100644 index 00000000000..bb29e194589 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmulps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-mulps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmulps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmulps-256-1.c new file mode 100644 index 00000000000..518a9477d8c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmulps-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_mul_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] * s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vmulsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmulsd-1.c new file mode 100644 index 00000000000..16adcde809c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmulsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-mulsd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vmulss-1.c b/gcc/testsuite/gcc.target/i386/avx-vmulss-1.c new file mode 100644 index 00000000000..9ff6e3d144c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vmulss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-mulss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vorpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vorpd-1.c new file mode 100644 index 00000000000..221849ff19e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vorpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-orpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vorpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vorpd-256-1.c new file mode 100644 index 00000000000..ca60e24fcf2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vorpd-256-1.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + + union + { + double d[4]; + long long ll[4]; + }source1, source2, e; + + s1.x = _mm256_set_pd (34545, 95567, 23443, 5675); + s2.x = _mm256_set_pd (674, 57897, 93459, 45624); + + _mm256_storeu_pd (source1.d, s1.x); + _mm256_storeu_pd (source2.d, s2.x); + + u.x = _mm256_or_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e.ll[i] = source1.ll[i] | source2.ll[i]; + + if (check_union256d (u, e.d)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vorps-1.c b/gcc/testsuite/gcc.target/i386/avx-vorps-1.c new file mode 100644 index 00000000000..fd501dd15da --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vorps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-orps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vorps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vorps-256-1.c new file mode 100644 index 00000000000..ef1c51b1d1b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vorps-256-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + + union256 u, s1, s2; + + union + { + float f[8]; + int i[8]; + }source1, source2, e; + + s1.x = _mm256_set_ps (34545, 95567, 23443, 5675, 2323, 67, 2345, 45667); + s2.x = _mm256_set_ps (674, 57897, 93459, 45624, 54674, 1237, 67436, 79608); + + _mm256_storeu_ps (source1.f, s1.x); + _mm256_storeu_ps (source2.f, s2.x); + + u.x = _mm256_or_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e.i[i] = source1.i[i] | source2.i[i]; + + if (check_union256 (u, e.f)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vpabsb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpabsb-1.c new file mode 100644 index 00000000000..80081ff1c28 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpabsb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-pabsb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpabsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpabsd-1.c new file mode 100644 index 00000000000..3b165f1a61d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpabsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-pabsd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpabsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpabsw-1.c new file mode 100644 index 00000000000..b737068127e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpabsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-pabsw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpackssdw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpackssdw-1.c new file mode 100644 index 00000000000..f302ce716a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpackssdw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-packssdw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpacksswb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpacksswb-1.c new file mode 100644 index 00000000000..14fd680a57a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpacksswb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-packsswb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpackusdw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpackusdw-1.c new file mode 100644 index 00000000000..81991d95183 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpackusdw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-packusdw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpackuswb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpackuswb-1.c new file mode 100644 index 00000000000..d06f3c77917 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpackuswb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-packuswb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddb-1.c new file mode 100644 index 00000000000..fa06c1e30f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddd-1.c new file mode 100644 index 00000000000..fc2ee293248 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddq-1.c new file mode 100644 index 00000000000..bb913be9def --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddsb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddsb-1.c new file mode 100644 index 00000000000..56dc00b73f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddsb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddsb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddsw-1.c new file mode 100644 index 00000000000..c326420e669 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddsw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddusb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddusb-1.c new file mode 100644 index 00000000000..a83bf6b7ee1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddusb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddusb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddusw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddusw-1.c new file mode 100644 index 00000000000..8cbf06092c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddusw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddusw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpaddw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpaddw-1.c new file mode 100644 index 00000000000..caaa4666675 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpaddw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-paddw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpalignr-1.c b/gcc/testsuite/gcc.target/i386/avx-vpalignr-1.c new file mode 100644 index 00000000000..13c84c8f9f6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpalignr-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-palignr.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpand-1.c b/gcc/testsuite/gcc.target/i386/avx-vpand-1.c new file mode 100644 index 00000000000..22e05701c63 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpand-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pand-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpandn-1.c b/gcc/testsuite/gcc.target/i386/avx-vpandn-1.c new file mode 100644 index 00000000000..fbd7e25edfb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpandn-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pandn-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpavgb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpavgb-1.c new file mode 100644 index 00000000000..1474d2b1fdf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpavgb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pavgb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpavgw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpavgw-1.c new file mode 100644 index 00000000000..1c7c3c89d12 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpavgw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pavgw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpblendvb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpblendvb-1.c new file mode 100644 index 00000000000..00179977648 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpblendvb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pblendvb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpblendw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpblendw-1.c new file mode 100644 index 00000000000..241dbcc6a6d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpblendw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pblendw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpeqb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqb-1.c new file mode 100644 index 00000000000..9cd2bbcc119 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pcmpeqb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpeqd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqd-1.c new file mode 100644 index 00000000000..b1d1dd2d666 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pcmpeqd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpeqq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqq-1.c new file mode 100644 index 00000000000..541b52c4bc9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pcmpeqq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpeqw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqw-1.c new file mode 100644 index 00000000000..0e0397abd06 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpeqw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pcmpeqw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpestri-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpestri-1.c new file mode 100644 index 00000000000..806000f9f11 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpestri-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpestri-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpestri-2.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpestri-2.c new file mode 100644 index 00000000000..6d683ef8977 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpestri-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpestri-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpestrm-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpestrm-1.c new file mode 100644 index 00000000000..95b2bdc0cbf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpestrm-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpestrm-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpestrm-2.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpestrm-2.c new file mode 100644 index 00000000000..b2f6ad33ddb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpestrm-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpestrm-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpgtb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtb-1.c new file mode 100644 index 00000000000..ed9fd4d21f5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pcmpgtb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpgtd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtd-1.c new file mode 100644 index 00000000000..344741eef6d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pcmpgtd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpgtq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtq-1.c new file mode 100644 index 00000000000..1332215a9e7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpgtq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpgtw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtw-1.c new file mode 100644 index 00000000000..c4f2007e08d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpgtw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pcmpgtw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpistri-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpistri-1.c new file mode 100644 index 00000000000..4cb13535d80 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpistri-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpistri-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpistri-2.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpistri-2.c new file mode 100644 index 00000000000..ec2af713d25 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpistri-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpistri-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpistrm-1.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpistrm-1.c new file mode 100644 index 00000000000..7a6a4d4d125 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpistrm-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpistrm-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpcmpistrm-2.c b/gcc/testsuite/gcc.target/i386/avx-vpcmpistrm-2.c new file mode 100644 index 00000000000..82857d813a5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpcmpistrm-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_2-pcmpistrm-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-1.c new file mode 100644 index 00000000000..99abca189b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-1.c @@ -0,0 +1,63 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#define CONTROL 0xCC + +void static +avx_test (void) +{ + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (1, 2, 3, 4, 5, 6, 7, 8); + s2.x = _mm256_set_ps (9, 10, 11, 12, 13, 14, 15, 16); + u.x = _mm256_permute2f128_ps (s1.x, s2.x, CONTROL); + + switch (CONTROL & 0x3) + { + case 0: + __builtin_memcpy (e, s1.a, 16); + break; + case 1: + __builtin_memcpy (e, s1.a+4, 16); + break; + case 2: + __builtin_memcpy (e, s2.a, 16); + break; + case 3: + __builtin_memcpy (e, s2.a+4, 16); + break; + default: + abort (); + } + + switch ((CONTROL & 0xc)>>2) + { + case 0: + __builtin_memcpy (e+4, s1.a, 16); + break; + case 1: + __builtin_memcpy (e+4, s1.a+4, 16); + break; + case 2: + __builtin_memcpy (e+4, s2.a, 16); + break; + case 3: + __builtin_memcpy (e+4, s2.a+4, 16); + break; + default: + abort (); + } + + if (CONTROL & (1<<3)) + __builtin_memset (e, 0, 16); + + if (CONTROL & (1<<7)) + __builtin_memset (e+4, 0, 16); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-2.c new file mode 100644 index 00000000000..db9c65bce2c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-2.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef IMM8 +# define IMM8 99 +#endif + + +void static +avx_test () +{ + union256d source1, source2, u; + double s1[4]={1, 2, 3, 4}; + double s2[4]={5, 6, 7, 8}; + double e[4]; + + source1.x = _mm256_loadu_pd(s1); + source2.x = _mm256_loadu_pd(s2); + u.x = _mm256_permute2f128_pd(source1.x, source2.x, IMM8); + + if(IMM8 & 8) e[0] = e[1] = 0; + else{ + e[0] = (IMM8 & 2 ? s2 : s1)[(IMM8 & 1) * 2]; + e[1] = (IMM8 & 2 ? s2 : s1)[(IMM8 & 1) * 2 + 1]; + } + if(IMM8 & 128) e[3] = e[3] = 0; + else{ + unsigned m = (IMM8 >> 4) & 3; + e[2] = (m & 2 ? s2 : s1)[(m & 1) * 2]; + e[3] = (m & 2 ? s2 : s1)[(m & 1) * 2 + 1]; + } + + if (check_union256d (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-3.c b/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-3.c new file mode 100644 index 00000000000..7b00c4b7633 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vperm2f128-256-3.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef IMM8 +# define IMM8 100 +#endif + +void static +avx_test () +{ + union256i_q source1, source2, u; + long long s1[4]={1, 2, 3, 4}; + long long s2[4]={5, 6, 7, 8}; + long long e[4]; + + source1.x = _mm256_loadu_si256((__m256i*)s1); + source2.x = _mm256_loadu_si256((__m256i*)s2); + u.x = _mm256_permute2f128_si256(source1.x, source2.x, IMM8); + + if(IMM8 & 8) e[0] = e[1] = 0; + else{ + e[0] = (IMM8 & 2 ? s2 : s1)[(IMM8 & 1) * 2]; + e[1] = (IMM8 & 2 ? s2 : s1)[(IMM8 & 1) * 2 + 1]; + } + if(IMM8 & 128) e[3] = e[3] = 0; + else{ + unsigned m = (IMM8 >> 4) & 3; + e[2] = (m & 2 ? s2 : s1)[(m & 1) * 2]; + e[3] = (m & 2 ? s2 : s1)[(m & 1) * 2 + 1]; + } + + if (check_union256i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermil2pd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermil2pd-1.c new file mode 100644 index 00000000000..04086246b4f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermil2pd-1.c @@ -0,0 +1,55 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef ZERO_MATCH +#define ZERO_MATCH 2 +#endif + +static double +select2dp(double *src1, double *src2, long long sel) +{ + double tmp = 0.0; + + if ((sel & 0x3) == 0) tmp = src1[0]; + if ((sel & 0x3) == 1) tmp = src1[1]; + if ((sel & 0x3) == 2) tmp = src2[0]; + if ((sel & 0x3) == 3) tmp = src2[1]; + + return tmp; +} + +static double +sel_and_condzerodp(double *src1, double *src2, long long sel, int imm8) +{ + double tmp; + + tmp = select2dp(src1, src2, sel & 0x3); + + if (((imm8 & 0x3) == 2) && ((sel & 0x4) == 0x4)) tmp = 0; + if (((imm8 & 0x3) == 3) && ((sel & 0x4) == 0x0)) tmp = 0; + + return tmp; +} + +void static +avx_test () +{ + union128d s1, s2, u; + union128i_q s3; + double e[2]; + + s1.x = _mm_set_pd (1, 2); + s2.x = _mm_set_pd (3, 4); + s3.x = _mm_set_epi64x (1, 2); + u.x = _mm_permute2_pd(s1.x, s2.x, s3.x, ZERO_MATCH); + + e[0] = sel_and_condzerodp (s1.a, s2.a, (s3.a[0] & 0xe)>>1, ZERO_MATCH); + e[1] = sel_and_condzerodp (s1.a, s2.a, (s3.a[1] & 0xe)>>1, ZERO_MATCH); + + if (check_union128d (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermil2pd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermil2pd-256-1.c new file mode 100644 index 00000000000..d9a94ae6b9d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermil2pd-256-1.c @@ -0,0 +1,57 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef ZERO_MATCH +#define ZERO_MATCH 1 +#endif + +static double +select2dp(double *src1, double *src2, long long sel) +{ + double tmp = 3.414; + + if ((sel & 0x3) == 0) tmp = src1[0]; + if ((sel & 0x3) == 1) tmp = src1[1]; + if ((sel & 0x3) == 2) tmp = src2[0]; + if ((sel & 0x3) == 3) tmp = src2[1]; + + return tmp; +} + +static double +sel_and_condzerodp(double *src1, double *src2, long long sel, int imm8) +{ + double tmp; + + tmp = select2dp(src1, src2, sel); + + if (((imm8 & 0x3) == 2) && ((sel & 0x4) == 0x4)) tmp = 0; + if (((imm8 & 0x3) == 3) && ((sel & 0x4) == 0x0)) tmp = 0; + + return tmp; +} + +void static +avx_test () +{ + union256d u, s1, s2; + double e[4] = {0.0}; + union256i_q s3; + + s1.x = _mm256_set_pd (1, 2, 3, 4); + s2.x = _mm256_set_pd (5, 6, 7, 8); + s3.x = _mm256_set_epi64x (0, 1, 2, 3); + u.x = _mm256_permute2_pd(s1.x, s2.x, s3.x, ZERO_MATCH); + + e[0] = sel_and_condzerodp (s1.a, s2.a, (s3.a[0] & 0xe)>>1, ZERO_MATCH); + e[1] = sel_and_condzerodp (s1.a, s2.a, (s3.a[1] & 0xe)>>1, ZERO_MATCH); + e[2] = sel_and_condzerodp (s1.a + 2, s2.a + 2, (s3.a[2] & 0xe)>>1, ZERO_MATCH); + e[3] = sel_and_condzerodp (s1.a + 2, s2.a + 2, (s3.a[3] & 0xe)>>1, ZERO_MATCH); + + if (check_union256d (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermil2ps-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermil2ps-1.c new file mode 100644 index 00000000000..c04600e92fb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermil2ps-1.c @@ -0,0 +1,62 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef ZERO_MATCH +#define ZERO_MATCH 1 +#endif + +static float +select2sp(float *src1, float *src2, int sel) +{ + float tmp; + + if ((sel & 0x7) == 0) tmp = src1[0]; + if ((sel & 0x7) == 1) tmp = src1[1]; + if ((sel & 0x7) == 2) tmp = src1[2]; + if ((sel & 0x7) == 3) tmp = src1[3]; + if ((sel & 0x7) == 4) tmp = src2[0]; + if ((sel & 0x7) == 5) tmp = src2[1]; + if ((sel & 0x7) == 6) tmp = src2[2]; + if ((sel & 0x7) == 7) tmp = src2[3]; + + return tmp; +} +static float +sel_and_condzerosp(float *src1, float *src2, int sel, int imm8) +{ + float tmp; + + tmp = select2sp(src1, src2, sel & 0x7); + + if (((imm8 & 0x3) == 2) && ((sel & 0x8) == 0x8)) tmp = 0; + if (((imm8 & 0x3) == 3) && ((sel & 0x8) == 0x0)) tmp = 0; + + return tmp; +} + +void static +avx_test () +{ + int i; + union128 source1, source2, u; + union128i_d source3; + float s1[4] = {1, 2, 3, 4}; + float s2[4] = {5, 6, 7, 8}; + int s3[4] = {0, 1, 0, 1}; + float e[4]; + + source1.x = _mm_loadu_ps(s1); + source2.x = _mm_loadu_ps(s2); + source3.x = _mm_loadu_si128((__m128i*) s3); + u.x = _mm_permute2_ps(source1.x, source2.x, source3.x, ZERO_MATCH); + + for (i = 0; i < 4; ++i) { + e[i] = sel_and_condzerosp(&s1[i & 0x4], &s2[i & 0x4], s3[i] & 0xf, ZERO_MATCH & 0x3); + } + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermil2ps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermil2ps-256-1.c new file mode 100644 index 00000000000..6ee58038673 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermil2ps-256-1.c @@ -0,0 +1,62 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef ZERO_MATCH +#define ZERO_MATCH 3 +#endif + +static float +select2sp(float *src1, float *src2, int sel) +{ + float tmp; + + if ((sel & 0x7) == 0) tmp = src1[0]; + if ((sel & 0x7) == 1) tmp = src1[1]; + if ((sel & 0x7) == 2) tmp = src1[2]; + if ((sel & 0x7) == 3) tmp = src1[3]; + if ((sel & 0x7) == 4) tmp = src2[0]; + if ((sel & 0x7) == 5) tmp = src2[1]; + if ((sel & 0x7) == 6) tmp = src2[2]; + if ((sel & 0x7) == 7) tmp = src2[3]; + + return tmp; +} +static float +sel_and_condzerosp(float *src1, float *src2, int sel, int imm8) +{ + float tmp; + + tmp = select2sp(src1, src2, sel & 0x7); + + if (((imm8 & 0x3) == 2) && ((sel & 0x8) == 0x8)) tmp = 0; + if (((imm8 & 0x3) == 3) && ((sel & 0x8) == 0x0)) tmp = 0; + + return tmp; +} + +void static +avx_test () +{ + int i; + union256 source1, source2, u; + union256i_d source3; + float s1[8]={1, 2, 3, 4, 5, 6, 7, 8}; + float s2[8]={9, 10, 11, 12, 13, 14, 15, 16}; + int s3[8]={11, 2, 3, 15, 5, 12, 7, 8}; + float e[8]; + + source1.x = _mm256_loadu_ps(s1); + source2.x = _mm256_loadu_ps(s2); + source3.x = _mm256_loadu_si256((__m256i*) s3); + u.x = _mm256_permute2_ps(source1.x, source2.x, source3.x, ZERO_MATCH); + + for (i = 0; i < 8; ++i) { + e[i] = sel_and_condzerosp(&s1[i & 0x4], &s2[i & 0x4], s3[i] & 0xf, ZERO_MATCH & 0x3); + } + + if (check_union256(u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-1.c new file mode 100644 index 00000000000..6379cdb4a12 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-1.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef CTRL +#define CTRL 1 +#endif + +void static +avx_test () +{ + union128d u, src; + double s[2] = {9674.67456, 13543.9788}; + double e[2]; + + src.x=_mm_loadu_pd(s); + u.x=_mm_permute_pd(src.x, CTRL); + + e[0] = s[ (CTRL & 0x01)]; + e[1] = s[((CTRL & 0x02) >> 1)]; + + if (check_union128d (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilpd-2.c b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-2.c new file mode 100644 index 00000000000..a6d7a0d6755 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-2.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef CTRL +#define CTRL 2 +#endif + +#define mask_v(pos) (((CTRL & (1ULL << (pos))) >> (pos)) << 1) + +void static +avx_test () +{ + union128d u, src; + union128i_q ctl; + + double s[2] = {9674.67456, 13543.9788}; + long long m[2] = {mask_v(0), mask_v(1)}; + double e[2]; + + src.x = _mm_loadu_pd(s); + ctl.x = _mm_loadu_si128((__m128i*) m); + u.x = _mm_permutevar_pd(src.x, ctl.x); + + e[0] = s[((m[0] & 0x02) >> 1)]; + e[1] = s[((m[1] & 0x02) >> 1)]; + + if (check_union128d (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-256-1.c new file mode 100644 index 00000000000..ca93474b5d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-256-1.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#define CONTROL 5 + +void static +avx_test (void) +{ + union256d u, s1; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + u.x = _mm256_permute_pd (s1.x, CONTROL); + + e[0] = (CONTROL&0x01) ? s1.a[1] : s1.a[0]; + e[1] = (CONTROL&0x02) ? s1.a[1] : s1.a[0]; + e[2] = (CONTROL&0x04) ? s1.a[3] : s1.a[2]; + e[3] = (CONTROL&0x08) ? s1.a[3] : s1.a[2]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilpd-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-256-2.c new file mode 100644 index 00000000000..1cd5c3a62e2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilpd-256-2.c @@ -0,0 +1,36 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef CTRL +#define CTRL 6 +#endif + +#define mask_v(pos) (((CTRL & (1ULL << (pos))) >> (pos)) << 1) + +void static +avx_test () +{ + union256d u, src; + union256i_q ctl; + + double s[4] = {39578.467285, 7856.342941, 9674.67456, 13543.9788}; + long long m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)}; + double e[4] = {0.0}; + + src.x = _mm256_loadu_pd(s); + ctl.x = _mm256_loadu_si256((__m256i*) m); + u.x = _mm256_permutevar_pd(src.x, ctl.x); + + e[0] = s[0 + ((m[0] & 0x02) >> 1)]; + e[1] = s[0 + ((m[1] & 0x02) >> 1)]; + e[2] = s[2 + ((m[2] & 0x02) >> 1)]; + e[3] = s[2 + ((m[3] & 0x02) >> 1)]; + + if (check_union256d (u, e)) + abort (); +} + + diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilps-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermilps-1.c new file mode 100644 index 00000000000..146f555673d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilps-1.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef CTRL +#define CTRL 11 +#endif + +void static +avx_test () +{ + union128 u, s; + float e[4]; + + s.x = _mm_set_ps (1, 2, 3, 4); + u.x = _mm_permute_ps(s.x, CTRL); + + e[0] = s.a[ (CTRL & 0x03)]; + e[1] = s.a[((CTRL & 0x0c) >> 2)]; + e[2] = s.a[((CTRL & 0x30) >> 4)]; + e[3] = s.a[((CTRL & 0xc0) >> 6)]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilps-2.c b/gcc/testsuite/gcc.target/i386/avx-vpermilps-2.c new file mode 100644 index 00000000000..ca0fbae4afc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilps-2.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef CTRL +#define CTRL 233 +#endif + +#define mask_v(pos) ((CTRL & (0x3 << (pos))) >> (pos)) + +void static +avx_test () +{ + union128 u, s; + union128i_q ctl; + int m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)}; + float e[4]; + + s.x = _mm_set_ps (1, 2, 3, 4); + ctl.x = _mm_loadu_si128((__m128i*) m); + u.x = _mm_permutevar_ps(s.x, ctl.x); + + e[0] = s.a[0 + (m[0] & 0x03)]; + e[1] = s.a[0 + (m[1] & 0x03)]; + e[2] = s.a[0 + (m[2] & 0x03)]; + e[3] = s.a[0 + (m[3] & 0x03)]; + + if (check_union128 (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vpermilps-256-1.c new file mode 100644 index 00000000000..b9291498dc0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilps-256-1.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef CTRL +#define CTRL 129 +#endif + +void static +avx_test () +{ + union256 src, u; + float e[8] = {0.0}; + + src.x = _mm256_set_ps (1, 2, 3, 4, 5, 6, 7, 8); + u.x = _mm256_permute_ps(src.x, CTRL); + + e[0] = src.a[0 + (CTRL & 0x03)]; + e[1] = src.a[0 + ((CTRL & 0x0c) >> 2)]; + e[2] = src.a[0 + ((CTRL & 0x30) >> 4)]; + e[3] = src.a[0 + ((CTRL & 0xc0) >> 6)]; + e[4] = src.a[4 + (CTRL & 0x03)]; + e[5] = src.a[4 + ((CTRL & 0x0c) >> 2)]; + e[6] = src.a[4 + ((CTRL & 0x30) >> 4)]; + e[7] = src.a[4 + ((CTRL & 0xc0) >> 6)]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vpermilps-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vpermilps-256-2.c new file mode 100644 index 00000000000..9890410b494 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpermilps-256-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef CTRL +#define CTRL 233 +#endif + +#define mask_v(pos) ((CTRL & (0x3 << (pos))) >> (pos)) + +void static +avx_test () +{ + union256 u, s; + union256i_q ctl; + int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)}; + float e[8]; + + s.x = _mm256_set_ps (1, 2, 3, 4, 5, 6, 7, 8); + ctl.x = _mm256_loadu_si256((__m256i*) m); + u.x = _mm256_permutevar_ps(s.x, ctl.x); + + e[0] = s.a[0 + (m[0] & 0x03)]; + e[1] = s.a[0 + (m[1] & 0x03)]; + e[2] = s.a[0 + (m[2] & 0x03)]; + e[3] = s.a[0 + (m[3] & 0x03)]; + e[4] = s.a[4 + (m[4] & 0x03)]; + e[5] = s.a[4 + (m[5] & 0x03)]; + e[6] = s.a[4 + (m[6] & 0x03)]; + e[7] = s.a[4 + (m[7] & 0x03)]; + + if (check_union256 (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vpextrb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpextrb-1.c new file mode 100644 index 00000000000..4e1c6442848 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpextrb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pextrb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpextrd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpextrd-1.c new file mode 100644 index 00000000000..bc67a28457e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpextrd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pextrd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpextrq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpextrq-1.c new file mode 100644 index 00000000000..1ffe007a141 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpextrq-1.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pextrq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpextrw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpextrw-1.c new file mode 100644 index 00000000000..7751ded98a0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpextrw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pextrw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vphaddd-1.c b/gcc/testsuite/gcc.target/i386/avx-vphaddd-1.c new file mode 100644 index 00000000000..57af9a6039a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vphaddd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-phaddd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vphaddsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vphaddsw-1.c new file mode 100644 index 00000000000..0fce115c311 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vphaddsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-phaddsw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vphaddw-1.c b/gcc/testsuite/gcc.target/i386/avx-vphaddw-1.c new file mode 100644 index 00000000000..08faf3ca272 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vphaddw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-phaddw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vphminposuw-1.c b/gcc/testsuite/gcc.target/i386/avx-vphminposuw-1.c new file mode 100644 index 00000000000..288651c956b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vphminposuw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-phminposuw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vphsubd-1.c b/gcc/testsuite/gcc.target/i386/avx-vphsubd-1.c new file mode 100644 index 00000000000..93cc726ea3a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vphsubd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-phsubd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vphsubsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vphsubsw-1.c new file mode 100644 index 00000000000..cd0e687f8d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vphsubsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-phsubsw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vphsubw-1.c b/gcc/testsuite/gcc.target/i386/avx-vphsubw-1.c new file mode 100644 index 00000000000..f9050da565b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vphsubw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-phsubw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpinsrb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpinsrb-1.c new file mode 100644 index 00000000000..b3b63581d97 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpinsrb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pinsrb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpinsrd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpinsrd-1.c new file mode 100644 index 00000000000..69c9bef3c0b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpinsrd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pinsrd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpinsrq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpinsrq-1.c new file mode 100644 index 00000000000..3b9d26a291d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpinsrq-1.c @@ -0,0 +1,9 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pinsrq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmaddubsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmaddubsw-1.c new file mode 100644 index 00000000000..c80ad6fd408 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmaddubsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-pmaddubsw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmaxsb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmaxsb-1.c new file mode 100644 index 00000000000..74b5a331fd8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmaxsb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmaxsb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmaxsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmaxsd-1.c new file mode 100644 index 00000000000..832e25e7f85 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmaxsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmaxsd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmaxsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmaxsw-1.c new file mode 100644 index 00000000000..55e362e69eb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmaxsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pmaxsw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmaxub-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmaxub-1.c new file mode 100644 index 00000000000..0f647cbe1c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmaxub-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pmaxub-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmaxud-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmaxud-1.c new file mode 100644 index 00000000000..afd29dbb449 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmaxud-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmaxud.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmaxuw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmaxuw-1.c new file mode 100644 index 00000000000..74b4177ca69 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmaxuw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmaxuw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpminsb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpminsb-1.c new file mode 100644 index 00000000000..e44ca611f4a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpminsb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pminsb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpminsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpminsd-1.c new file mode 100644 index 00000000000..54e18ed53ac --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpminsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pminsd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpminsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpminsw-1.c new file mode 100644 index 00000000000..ce65712f402 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpminsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pminsw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpminub-1.c b/gcc/testsuite/gcc.target/i386/avx-vpminub-1.c new file mode 100644 index 00000000000..d7b77bc6282 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpminub-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pminub-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpminud-1.c b/gcc/testsuite/gcc.target/i386/avx-vpminud-1.c new file mode 100644 index 00000000000..bbc069e7886 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpminud-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pminud.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpminuw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpminuw-1.c new file mode 100644 index 00000000000..9b253555e58 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpminuw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pminuw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovmskb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovmskb-1.c new file mode 100644 index 00000000000..0b3e8aaeed7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovmskb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pmovmskb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovsxbd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovsxbd-1.c new file mode 100644 index 00000000000..b3a57b04475 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovsxbd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovsxbd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovsxbq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovsxbq-1.c new file mode 100644 index 00000000000..a9aba16bd95 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovsxbq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovsxbq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovsxbw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovsxbw-1.c new file mode 100644 index 00000000000..a3f2efe36e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovsxbw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovsxbw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovsxdq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovsxdq-1.c new file mode 100644 index 00000000000..6f294053305 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovsxdq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovsxdq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovsxwd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovsxwd-1.c new file mode 100644 index 00000000000..8e186e38246 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovsxwd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovsxwd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovsxwq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovsxwq-1.c new file mode 100644 index 00000000000..90c2d1d5e83 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovsxwq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovsxwq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovzxbd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovzxbd-1.c new file mode 100644 index 00000000000..3f4556ce867 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovzxbd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovzxbd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovzxbq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovzxbq-1.c new file mode 100644 index 00000000000..719c7271ecb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovzxbq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovzxbq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovzxbw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovzxbw-1.c new file mode 100644 index 00000000000..ad5fe4e7d6c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovzxbw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovzxbw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovzxdq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovzxdq-1.c new file mode 100644 index 00000000000..7490902b802 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovzxdq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovzxdq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovzxwd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovzxwd-1.c new file mode 100644 index 00000000000..5447155d5b0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovzxwd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovzxwd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmovzxwq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmovzxwq-1.c new file mode 100644 index 00000000000..b8239f22196 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmovzxwq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmovzxwq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmuldq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmuldq-1.c new file mode 100644 index 00000000000..527d3cbdbf0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmuldq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmuldq.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmulhrsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmulhrsw-1.c new file mode 100644 index 00000000000..6451bf12c33 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmulhrsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-pmulhrsw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmulhuw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmulhuw-1.c new file mode 100644 index 00000000000..f3127a9dbb9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmulhuw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pmulhuw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmulhw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmulhw-1.c new file mode 100644 index 00000000000..c36b489c7c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmulhw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pmulhw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmulld-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmulld-1.c new file mode 100644 index 00000000000..63df55d799d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmulld-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-pmulld.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmullw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmullw-1.c new file mode 100644 index 00000000000..649dcad6256 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmullw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pmullw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpmuludq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpmuludq-1.c new file mode 100644 index 00000000000..e7c1cebdc0e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpmuludq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pmuludq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpor-1.c b/gcc/testsuite/gcc.target/i386/avx-vpor-1.c new file mode 100644 index 00000000000..cda694f00c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpor-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-por-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsadbw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsadbw-1.c new file mode 100644 index 00000000000..6f76c96324b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsadbw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psadbw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpshufb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpshufb-1.c new file mode 100644 index 00000000000..a868b191cfc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpshufb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-pshufb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpshufd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpshufd-1.c new file mode 100644 index 00000000000..543bcdfcba2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpshufd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pshufd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpshufhw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpshufhw-1.c new file mode 100644 index 00000000000..23b79c653e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpshufhw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pshufhw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpshuflw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpshuflw-1.c new file mode 100644 index 00000000000..268b5d24498 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpshuflw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pshuflw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsignb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsignb-1.c new file mode 100644 index 00000000000..c88acf2e0fa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsignb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-psignb.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsignd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsignd-1.c new file mode 100644 index 00000000000..ca5bb39db08 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsignd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-psignd.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsignw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsignw-1.c new file mode 100644 index 00000000000..392ca03e066 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsignw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "ssse3-psignw.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpslld-1.c b/gcc/testsuite/gcc.target/i386/avx-vpslld-1.c new file mode 100644 index 00000000000..778662dbd8d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpslld-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pslld-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpslld-2.c b/gcc/testsuite/gcc.target/i386/avx-vpslld-2.c new file mode 100644 index 00000000000..12754ed787b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpslld-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pslld-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpslldq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpslldq-1.c new file mode 100644 index 00000000000..aea5b7865ce --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpslldq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pslldq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsllq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsllq-1.c new file mode 100644 index 00000000000..37c15264902 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsllq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psllq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsllq-2.c b/gcc/testsuite/gcc.target/i386/avx-vpsllq-2.c new file mode 100644 index 00000000000..0cc298df989 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsllq-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psllq-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsllw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsllw-1.c new file mode 100644 index 00000000000..ebb610c31c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsllw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psllw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsllw-2.c b/gcc/testsuite/gcc.target/i386/avx-vpsllw-2.c new file mode 100644 index 00000000000..62a989dc90b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsllw-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psllw-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrad-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsrad-1.c new file mode 100644 index 00000000000..2293c42b565 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrad-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrad-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrad-2.c b/gcc/testsuite/gcc.target/i386/avx-vpsrad-2.c new file mode 100644 index 00000000000..53f4f09c292 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrad-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrad-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsraw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsraw-1.c new file mode 100644 index 00000000000..525163fcc9e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsraw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psraw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsraw-2.c b/gcc/testsuite/gcc.target/i386/avx-vpsraw-2.c new file mode 100644 index 00000000000..90c8df0f256 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsraw-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psraw-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrld-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsrld-1.c new file mode 100644 index 00000000000..a143a65c426 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrld-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrld-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrld-2.c b/gcc/testsuite/gcc.target/i386/avx-vpsrld-2.c new file mode 100644 index 00000000000..e9e1e3f2a47 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrld-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrld-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrldq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsrldq-1.c new file mode 100644 index 00000000000..a8cec081e30 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrldq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrldq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrlq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsrlq-1.c new file mode 100644 index 00000000000..d7a57bff7ff --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrlq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrlq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrlq-2.c b/gcc/testsuite/gcc.target/i386/avx-vpsrlq-2.c new file mode 100644 index 00000000000..efa8708187b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrlq-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrlq-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrlw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsrlw-1.c new file mode 100644 index 00000000000..e132c2da151 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrlw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrlw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsrlw-2.c b/gcc/testsuite/gcc.target/i386/avx-vpsrlw-2.c new file mode 100644 index 00000000000..ec4a85dce96 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsrlw-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psrlw-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsubb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsubb-1.c new file mode 100644 index 00000000000..e66624f2270 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsubb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psubb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsubd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsubd-1.c new file mode 100644 index 00000000000..1e9214dbd9d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsubd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psubd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsubq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsubq-1.c new file mode 100644 index 00000000000..b7c22be7c74 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsubq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psubq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsubsb-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsubsb-1.c new file mode 100644 index 00000000000..fa71d61125d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsubsb-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psubsb-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsubsw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsubsw-1.c new file mode 100644 index 00000000000..b3fbad0ed76 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsubsw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psubsw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpsubw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpsubw-1.c new file mode 100644 index 00000000000..a83140e1990 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpsubw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-psubw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vptest-1.c b/gcc/testsuite/gcc.target/i386/avx-vptest-1.c new file mode 100644 index 00000000000..c70752d365f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vptest-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-ptest-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vptest-2.c b/gcc/testsuite/gcc.target/i386/avx-vptest-2.c new file mode 100644 index 00000000000..cb6b5520b34 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vptest-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-ptest-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vptest-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vptest-256-1.c new file mode 100644 index 00000000000..ebc2673a414 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vptest-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int s1i[8] = {0, 5463, 86456, 0, 1234, 0, 62445, 34352}; + int s2i[8] = {0, 1223, 0, 0, 0, 1, 0, 0}; + int d; + int e; + int i; + union256i_d s1, s2; + + s1.x = _mm256_loadu_si256 ((__m256i*)s1i); + s2.x = _mm256_loadu_si256 ((__m256i*)s2i); + d = _mm256_testz_si256 (s1.x, s2.x); + + e = 1; + for (i = 0; i < 8; i++) + if ((s1i[i] & s2i[i]) != 0) + e = 0; + + if (d != e) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vptest-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vptest-256-2.c new file mode 100644 index 00000000000..f85344a9a4b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vptest-256-2.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int s1i[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + int s2i[8] = {1, 2, 3, 4, 5, 6, 7, 8}; + int d; + int e; + int i; + union256i_d s1, s2; + + s1.x = _mm256_loadu_si256 ((__m256i*)s1i); + s2.x = _mm256_loadu_si256 ((__m256i*)s2i); + d = _mm256_testc_si256 (s1.x, s2.x); + + e = 1; + for (i = 0; i < 8; i++) + if ((~s1i[i] & s2i[i]) != 0) + e = 0; + + if (d != e) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vptest-256-3.c b/gcc/testsuite/gcc.target/i386/avx-vptest-256-3.c new file mode 100644 index 00000000000..cccbbef4e67 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vptest-256-3.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int s1i[8] = {0, 0, 0, 0, 0, 0, 0, 0}; + int s2i[8] = {1, 2, 3, 4, 5, 6, 7, 8}; + int d; + int c = 1, z = 1, e = 0xf; + int i; + union256i_d s1, s2; + + s1.x = _mm256_loadu_si256 ((__m256i*)s1i); + s2.x = _mm256_loadu_si256 ((__m256i*)s2i); + d = _mm256_testnzc_si256 (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + if ((s1.a[i] & s2.a[i])) + z = 0; + if ((~s1.a[i] & s2.a[i])) + c = 0; + } + + e = (z == 0 && c == 0) ? 1 : 0; + + if (d != e) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vptest-3.c b/gcc/testsuite/gcc.target/i386/avx-vptest-3.c new file mode 100644 index 00000000000..1b875a75f02 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vptest-3.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-ptest-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpckhbw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpckhbw-1.c new file mode 100644 index 00000000000..3c76aa3f17a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpckhbw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpckhbw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpckhdq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpckhdq-1.c new file mode 100644 index 00000000000..a853d7014f0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpckhdq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpckhdq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpckhqdq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpckhqdq-1.c new file mode 100644 index 00000000000..8b86c764941 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpckhqdq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpckhqdq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpckhwd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpckhwd-1.c new file mode 100644 index 00000000000..0e4e051d4da --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpckhwd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpckhwd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpcklbw-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpcklbw-1.c new file mode 100644 index 00000000000..ad856cf6a51 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpcklbw-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpcklbw-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpckldq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpckldq-1.c new file mode 100644 index 00000000000..2acd8792909 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpckldq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpckldq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpcklqdq-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpcklqdq-1.c new file mode 100644 index 00000000000..bd378a34fab --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpcklqdq-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpcklqdq-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpunpcklwd-1.c b/gcc/testsuite/gcc.target/i386/avx-vpunpcklwd-1.c new file mode 100644 index 00000000000..07f2be1778f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpunpcklwd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-punpcklwd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vpxor-1.c b/gcc/testsuite/gcc.target/i386/avx-vpxor-1.c new file mode 100644 index 00000000000..dfc46537b68 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vpxor-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-pxor-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vrcpps-1.c b/gcc/testsuite/gcc.target/i386/avx-vrcpps-1.c new file mode 100644 index 00000000000..45673de43b5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vrcpps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-rcpps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vrcpps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vrcpps-256-1.c new file mode 100644 index 00000000000..16b3051b0ad --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vrcpps-256-1.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256 u, s1; + float e[8] = {0.0}; + + s1.x = _mm256_set_ps (1.0, 2.0, 13.0, 14.0, 56.89, 73.3, 4.78, 45.64); + u.x = _mm256_rcp_ps (s1.x); + + for (i = 0; i < 8; i++) { + __m128 tmp = _mm_load_ss (&s1.a[i]); + tmp = _mm_rcp_ss (tmp); + _mm_store_ss (&e[i], tmp); + } + + if (check_union256 (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vroundpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vroundpd-1.c new file mode 100644 index 00000000000..c8b0ec1efd5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vroundpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-roundpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vroundpd-2.c b/gcc/testsuite/gcc.target/i386/avx-vroundpd-2.c new file mode 100644 index 00000000000..e29ac55620b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vroundpd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-roundpd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-1.c new file mode 100644 index 00000000000..71da7523a28 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-1.c @@ -0,0 +1,29 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#define iRoundMode 0x7 + +void static +avx_test (void) +{ + union256d u, s1; + double source [4] = {2134.3343,1234.635654,453.345635,54646.464356}; + double e[4] = {0.0}; + int i; + + s1.x = _mm256_loadu_pd (source); + u.x = _mm256_round_pd (s1.x, iRoundMode); + + for (i = 0; i < 4; i++) + { + __m128d tmp = _mm_load_sd (&s1.a[i]); + tmp = _mm_round_sd (tmp, tmp, iRoundMode); + _mm_store_sd (&e[i], tmp); + } + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-2.c new file mode 100644 index 00000000000..a61d7730c58 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-2.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u, s1; + double source [4] = {2134.3343,1234.635654,453.345635,54646.464356}; + double e[4] = {0.0}; + int i; + + s1.x = _mm256_loadu_pd (source); + u.x = _mm256_floor_pd (s1.x); + + for (i = 0; i < 4; i++) + { + __m128d tmp = _mm_load_sd (&s1.a[i]); + tmp = _mm_floor_sd (tmp, tmp); + _mm_store_sd (&e[i], tmp); + } + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-3.c b/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-3.c new file mode 100644 index 00000000000..f4f3e77dd0e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vroundpd-256-3.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u, s1; + double source [4] = {2134.3343,1234.635654,453.345635,54646.464356}; + double e[4] = {0.0}; + int i; + + s1.x = _mm256_loadu_pd (source); + u.x = _mm256_ceil_pd (s1.x); + + for (i = 0; i < 4; i++) + { + __m128d tmp = _mm_load_sd (&s1.a[i]); + tmp = _mm_ceil_sd (tmp, tmp); + _mm_store_sd (&e[i], tmp); + } + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vroundpd-3.c b/gcc/testsuite/gcc.target/i386/avx-vroundpd-3.c new file mode 100644 index 00000000000..6d9326f6a72 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vroundpd-3.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse4_1-roundpd-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vroundps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vroundps-256-1.c new file mode 100644 index 00000000000..d33248e2452 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vroundps-256-1.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256 u, s1; + float source [8] = {2134.3343,1234.635654,453.345635,54646.464356,895833.346347,56343,234234.34563,2345434.67832}; + float e [8] = {2134.0,1234.0,453.0,54646.0,895833.0,56343,234234.0,2345434.0}; + + s1.x = _mm256_loadu_ps (source); + u.x = _mm256_round_ps (s1.x, 1); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vrsqrtps-1.c b/gcc/testsuite/gcc.target/i386/avx-vrsqrtps-1.c new file mode 100644 index 00000000000..2db1650ddfb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vrsqrtps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-rsqrtps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vrsqrtps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vrsqrtps-256-1.c new file mode 100644 index 00000000000..19a933c5dd3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vrsqrtps-256-1.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256 u, s1; + float e[8] = {0.0}; + + s1.x = _mm256_set_ps (1.0, 2.0, 13.0, 14.0, 56.89, 73.3, 4.78, 45.64); + u.x = _mm256_rsqrt_ps (s1.x); + + for (i = 0; i < 8; i++) { + __m128 tmp = _mm_load_ss (&s1.a[i]); + tmp = _mm_rsqrt_ss (tmp); + _mm_store_ss (&e[i], tmp); + } + + if (check_union256 (u, e)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vshufpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vshufpd-1.c new file mode 100644 index 00000000000..a6f00ea8bca --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vshufpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-shufpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vshufpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vshufpd-256-1.c new file mode 100644 index 00000000000..828f6804fb1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vshufpd-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 10 +#endif + +void static +avx_test (void) +{ + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_shuffle_pd (s1.x, s2.x, MASK); + + e[0] = (MASK & (1 << 0)) ? s1.a[1] : s1.a[0]; + e[1] = (MASK & (1 << 1)) ? s2.a[1] : s2.a[0]; + e[2] = (MASK & (1 << 2)) ? s1.a[3] : s1.a[2]; + e[3] = (MASK & (1 << 3)) ? s2.a[3] : s2.a[2]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vshufps-1.c b/gcc/testsuite/gcc.target/i386/avx-vshufps-1.c new file mode 100644 index 00000000000..97d85706d3b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vshufps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-shufps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vshufps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vshufps-256-1.c new file mode 100644 index 00000000000..f939357d4d1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vshufps-256-1.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifndef MASK +#define MASK 203 +#endif + +float select4(const float *src, unsigned int control) +{ + switch(control) { + case 0: + return src[0]; + case 1: + return src[1]; + case 2: + return src[2]; + case 3: + return src[3]; + } + return -1; +} + + +void static +avx_test (void) +{ + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8); + s2.x = _mm256_set_ps (2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8); + u.x = _mm256_shuffle_ps (s1.x, s2.x, MASK); + + + e[0] = select4(s1.a, (MASK >> 0) & 0x3); + e[1] = select4(s1.a, (MASK >> 2) & 0x3); + e[2] = select4(s2.a, (MASK >> 4) & 0x3); + e[3] = select4(s2.a, (MASK >> 6) & 0x3); + e[4] = select4(s1.a+4, (MASK >> 0) & 0x3); + e[5] = select4(s1.a+4, (MASK >> 2) & 0x3); + e[6] = select4(s2.a+4, (MASK >> 4) & 0x3); + e[7] = select4(s2.a+4, (MASK >> 6) & 0x3); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vsqrtpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vsqrtpd-1.c new file mode 100644 index 00000000000..dc098c91027 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsqrtpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-sqrtpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vsqrtpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vsqrtpd-256-1.c new file mode 100644 index 00000000000..d611bbd121d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsqrtpd-256-1.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u, s1; + double e [4] = {0x1.d3881b2c32ed7p+7, 0x1.54abaed51711cp+4, 0x1.19195c08a8d23p+5, 0x1.719741d6c0b0bp+5}; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + u.x = _mm256_sqrt_pd (s1.x); + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vsqrtps-1.c b/gcc/testsuite/gcc.target/i386/avx-vsqrtps-1.c new file mode 100644 index 00000000000..deb88947fed --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsqrtps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-sqrtps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vsqrtps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vsqrtps-256-1.c new file mode 100644 index 00000000000..d5cd77f5d51 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsqrtps-256-1.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256 u, s1; + float e[8] = {0x1.7edeccp+10, 0x1.e3fa46p+8, 0x1.dabbcep+7, 0x1.d93e0cp+9,\ + 0x1.d3881cp+7, 0x1.54abbp+4, 0x1.19195cp+5, 0x1.719742p+5}; + + s1.x = _mm256_set_ps (2134.3343,1234.635654,453.345635,54646.464356, \ + 895833.346347,56343,234234.34563,2345434.67832); + u.x = _mm256_sqrt_ps (s1.x); + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vsubpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vsubpd-1.c new file mode 100644 index 00000000000..2af33fc6a32 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsubpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-subpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vsubpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vsubpd-256-1.c new file mode 100644 index 00000000000..ce4ddcaa16a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsubpd-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_sub_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] - s2.a[i]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vsubps-1.c b/gcc/testsuite/gcc.target/i386/avx-vsubps-1.c new file mode 100644 index 00000000000..59aa9284782 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsubps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-subps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vsubps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vsubps-256-1.c new file mode 100644 index 00000000000..de4337cb621 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsubps-256-1.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + int i; + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_sub_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] - s2.a[i]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vsubsd-1.c b/gcc/testsuite/gcc.target/i386/avx-vsubsd-1.c new file mode 100644 index 00000000000..58cf4cb322e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsubsd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-subsd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vsubss-1.c b/gcc/testsuite/gcc.target/i386/avx-vsubss-1.c new file mode 100644 index 00000000000..719aa6f1539 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vsubss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-subss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vtestpd-1.c new file mode 100644 index 00000000000..3bfecf916e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestpd-1.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union128d source1, source2; + + double s1[2] = {30, -5463}; + double s2[2] = {20, 1223}; + int d[1]; + int e[1]; + + source1.x = _mm_loadu_pd(s1); + source2.x = _mm_loadu_pd(s2); + + d[0] = _mm_testz_pd(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 2; i++) + { + union ieee754_double u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (u1.bits.sign && u2.bits.sign) { + e[0] = 0; + } + } + + if (checkVi(d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestpd-2.c b/gcc/testsuite/gcc.target/i386/avx-vtestpd-2.c new file mode 100644 index 00000000000..cb79b24d14c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestpd-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union128d source1, source2; + + double s1[2] = {0, -5463}; + double s2[2] = {0, -1223}; + int d[1]; + int e[1]; + + source1.x = _mm_loadu_pd(s1); + source2.x = _mm_loadu_pd(s2); + + d[0] = _mm_testc_pd(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 2; i++) { + union ieee754_double u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (!u1.bits.sign && u2.bits.sign) + e[0] = 0; + } + + if (checkVi(d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-1.c new file mode 100644 index 00000000000..d7d491981e6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-1.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256d source1, source2; + + double s1[4] = {0, -5463, 86456, 0}; + double s2[4] = {0, -1223, 0, 1}; + int d[1]; + int e[1]; + + source1.x = _mm256_loadu_pd(s1); + source2.x = _mm256_loadu_pd(s2); + d[0] = _mm256_testz_pd(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 4; i++) { + union ieee754_double u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (u1.bits.sign && u2.bits.sign) { + e[0] = 0; + } + } + + if (checkVi(d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-2.c new file mode 100644 index 00000000000..5b61c071e05 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256d source1, source2; + + double s1[4] = {0, -5463, 86456, 0}; + double s2[4] = {0, -1223, 0, 1}; + int d[1]; + int e[1]; + + source1.x = _mm256_loadu_pd(s1); + source2.x = _mm256_loadu_pd(s2); + d[0] = _mm256_testc_pd(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 4; i++) { + union ieee754_double u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (!u1.bits.sign && u2.bits.sign) { + e[0] = 0; + } + } + + if (checkVi(d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-3.c b/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-3.c new file mode 100644 index 00000000000..747107895c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestpd-256-3.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256d source1, source2; + + double s1[4] = {0, -5463, 86456, 0}; + double s2[4] = {0, -1223, 0, 1}; + int d[1]; + int e[1]; + int c=1; + int z=1; + + source1.x = _mm256_loadu_pd(s1); + source2.x = _mm256_loadu_pd(s2); + d[0] = _mm256_testnzc_pd(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 4; i++) { + union ieee754_double u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (u1.bits.sign && u2.bits.sign) + z = 0; + + if (!u1.bits.sign && u2.bits.sign) + c = 0; + } + e[0] = (c==0 && z==0) ? 1:0; + + if (checkVi(d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestpd-3.c b/gcc/testsuite/gcc.target/i386/avx-vtestpd-3.c new file mode 100644 index 00000000000..609c825f2ef --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestpd-3.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union128d source1, source2; + + double s1[2] = {0, -5463}; + double s2[2] = {0, -1223}; + int d[1]; + int e[1]; + int c = 1; + int z = 1; + + source1.x = _mm_loadu_pd(s1); + source2.x = _mm_loadu_pd(s2); + + d[0] = _mm_testnzc_pd(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 2; i++) { + union ieee754_double u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (u1.bits.sign && u2.bits.sign) + z = 0; + if (!u1.bits.sign && u2.bits.sign) + c = 0; + + } + + e[0] = (c==0 && z==0) ? 1:0; + + if (checkVi(d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestps-1.c b/gcc/testsuite/gcc.target/i386/avx-vtestps-1.c new file mode 100644 index 00000000000..bc22dc4153e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestps-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union128 source1, source2; + float s1[4] = {0, -5463, 86456, 0}; + float s2[4] = {0, -1223, 0, 0}; + int d[1]; + int e[1]; + + source1.x = _mm_loadu_ps(s1); + source2.x = _mm_loadu_ps(s2); + d[0] = _mm_testz_ps(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 4; i++) { + union ieee754_float u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (u1.bits.sign && u2.bits.sign) + e[0] = 0; + } + + if (checkVi (d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestps-2.c b/gcc/testsuite/gcc.target/i386/avx-vtestps-2.c new file mode 100644 index 00000000000..2dd45d90180 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestps-2.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union128 source1, source2; + float s1[4] = {0, -5463, 86456, 0}; + float s2[4] = {0, -1223, 0, 0}; + int d[1]; + int e[1]; + + source1.x = _mm_loadu_ps(s1); + source2.x = _mm_loadu_ps(s2); + d[0] = _mm_testc_ps(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 4; i++) { + union ieee754_float u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (!u1.bits.sign && u2.bits.sign) + e[0] = 0; + } + + if (checkVi (d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vtestps-256-1.c new file mode 100644 index 00000000000..a1ebd66b852 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestps-256-1.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256 source1, source2; + + float s1[8] = {0, -5463, 86456, 0, 1234, 0, 62445, 34352}; + float s2[8] = {0, -1223, 0, 0, 0, 1, 0, 0}; + int d[1]; + int e[1]; + + source1.x = _mm256_loadu_ps(s1); + source2.x = _mm256_loadu_ps(s2); + d[0] = _mm256_testz_ps(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 8; i++) { + union ieee754_float u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (u1.bits.sign && u2.bits.sign) + e[0] = 0; + } + + if (checkVi (d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestps-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vtestps-256-2.c new file mode 100644 index 00000000000..b5c62513911 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestps-256-2.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256 source1, source2; + + float s1[8] = {0, -5463, 86456, 0, 1234, 0, 62445, 34352}; + float s2[8] = {0, -1223, 0, 0, 0, 1, 0, 0}; + int d[1]; + int e[1]; + + source1.x = _mm256_loadu_ps(s1); + source2.x = _mm256_loadu_ps(s2); + d[0] = _mm256_testc_ps(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 8; i++) { + union ieee754_float u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (!u1.bits.sign && u2.bits.sign) + e[0] = 0; + } + + if (checkVi (d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestps-256-3.c b/gcc/testsuite/gcc.target/i386/avx-vtestps-256-3.c new file mode 100644 index 00000000000..ef10361c2b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestps-256-3.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union256 source1, source2; + int c = 1; + int z = 1; + + float s1[8] = {0, -5463, 86456, 0, 1234, 0, 62445, 34352}; + float s2[8] = {0, -1223, 0, 0, 0, 1, 0, 0}; + int d[1]; + int e[1]; + + source1.x = _mm256_loadu_ps(s1); + source2.x = _mm256_loadu_ps(s2); + d[0] = _mm256_testnzc_ps(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 8; i++) { + union ieee754_float u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (!u1.bits.sign && u2.bits.sign) + c = 0; + if (u1.bits.sign && u2.bits.sign) + z = 0; + } + e[0] = (c==0 && z==0)?1:0; + + if (checkVi (d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vtestps-3.c b/gcc/testsuite/gcc.target/i386/avx-vtestps-3.c new file mode 100644 index 00000000000..e69b9466879 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vtestps-3.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test () +{ + int i; + union128 source1, source2; + float s1[4] = {0, -5463, 86456, 0}; + float s2[4] = {0, -1223, 0, 0}; + int d[1]; + int e[1]; + int c=1; + int z=1; + + source1.x = _mm_loadu_ps(s1); + source2.x = _mm_loadu_ps(s2); + d[0] = _mm_testnzc_ps(source1.x, source2.x); + + e[0] = 1; + for (i = 0; i < 4; i++) { + union ieee754_float u1, u2; + u1.d = s1[i]; + u2.d = s2[i]; + if (!u1.bits.sign && u2.bits.sign) + c = 0; + if (u1.bits.sign && u2.bits.sign) + z = 0; + + } + e[0] = (c == 0 && z == 0) ? 1:0; + + if (checkVi (d, e, 1)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomisd-1.c b/gcc/testsuite/gcc.target/i386/avx-vucomisd-1.c new file mode 100644 index 00000000000..d4efd212d14 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomisd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-ucomisd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomisd-2.c b/gcc/testsuite/gcc.target/i386/avx-vucomisd-2.c new file mode 100644 index 00000000000..d55f310076c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomisd-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-ucomisd-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomisd-3.c b/gcc/testsuite/gcc.target/i386/avx-vucomisd-3.c new file mode 100644 index 00000000000..e2ba869ffdf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomisd-3.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-ucomisd-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomisd-4.c b/gcc/testsuite/gcc.target/i386/avx-vucomisd-4.c new file mode 100644 index 00000000000..961759909f7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomisd-4.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-ucomisd-4.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomisd-5.c b/gcc/testsuite/gcc.target/i386/avx-vucomisd-5.c new file mode 100644 index 00000000000..9034519af8b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomisd-5.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-ucomisd-5.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomisd-6.c b/gcc/testsuite/gcc.target/i386/avx-vucomisd-6.c new file mode 100644 index 00000000000..cc9d0e925a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomisd-6.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-ucomisd-6.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomiss-1.c b/gcc/testsuite/gcc.target/i386/avx-vucomiss-1.c new file mode 100644 index 00000000000..c0ba7a3a6b5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomiss-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-ucomiss-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomiss-2.c b/gcc/testsuite/gcc.target/i386/avx-vucomiss-2.c new file mode 100644 index 00000000000..ea4b80e1087 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomiss-2.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-ucomiss-2.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomiss-3.c b/gcc/testsuite/gcc.target/i386/avx-vucomiss-3.c new file mode 100644 index 00000000000..bd82bb92a5d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomiss-3.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-ucomiss-3.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomiss-4.c b/gcc/testsuite/gcc.target/i386/avx-vucomiss-4.c new file mode 100644 index 00000000000..a58395a126b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomiss-4.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-ucomiss-4.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomiss-5.c b/gcc/testsuite/gcc.target/i386/avx-vucomiss-5.c new file mode 100644 index 00000000000..198933cd526 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomiss-5.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-ucomiss-5.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vucomiss-6.c b/gcc/testsuite/gcc.target/i386/avx-vucomiss-6.c new file mode 100644 index 00000000000..db48b7a3043 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vucomiss-6.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-ucomiss-6.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpckhpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpckhpd-1.c new file mode 100644 index 00000000000..4b7191ce038 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpckhpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-unpckhpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpckhpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpckhpd-256-1.c new file mode 100644 index 00000000000..5da332d453b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpckhpd-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_unpackhi_pd (s1.x, s2.x); + + e[0] = s1.a[1]; + e[1] = s2.a[1]; + e[2] = s1.a[3]; + e[3] = s2.a[3]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpckhps-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpckhps-1.c new file mode 100644 index 00000000000..e5a0f3e1ee8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpckhps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-unpckhps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpckhps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpckhps-256-1.c new file mode 100644 index 00000000000..be6fbb6f9df --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpckhps-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_unpackhi_ps (s1.x, s2.x); + + e[0] = s1.a[2]; + e[1] = s2.a[2]; + e[2] = s1.a[3]; + e[3] = s2.a[3]; + e[4] = s1.a[6]; + e[5] = s2.a[6]; + e[6] = s1.a[7]; + e[7] = s2.a[7]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpcklpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpcklpd-1.c new file mode 100644 index 00000000000..9e0cb05add0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpcklpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-unpcklpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpcklpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpcklpd-256-1.c new file mode 100644 index 00000000000..0f7e390cff9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpcklpd-256-1.c @@ -0,0 +1,24 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256d u, s1, s2; + double e [4]; + + s1.x = _mm256_set_pd (2134.3343,1234.635654,453.345635,54646.464356); + s2.x = _mm256_set_pd (41124.234,2344.2354,8653.65635,856.43576); + u.x = _mm256_unpacklo_pd (s1.x, s2.x); + + e[0] = s1.a[0]; + e[1] = s2.a[0]; + e[2] = s1.a[2]; + e[3] = s2.a[2]; + + if (check_union256d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpcklps-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpcklps-1.c new file mode 100644 index 00000000000..c2380a47eba --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpcklps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mfpmath=sse -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-unpcklps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vunpcklps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vunpcklps-256-1.c new file mode 100644 index 00000000000..bf0e31892bb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vunpcklps-256-1.c @@ -0,0 +1,28 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union256 u, s1, s2; + float e [8]; + + s1.x = _mm256_set_ps (24.43, 68.346, 43.35, 546.46, 46.79, 82.78, 82.7, 9.4); + s2.x = _mm256_set_ps (1.17, 2.16, 3.15, 4.14, 5.13, 6.12, 7.11, 8.9); + u.x = _mm256_unpacklo_ps (s1.x, s2.x); + + e[0] = s1.a[0]; + e[1] = s2.a[0]; + e[2] = s1.a[1]; + e[3] = s2.a[1]; + e[4] = s1.a[4]; + e[5] = s2.a[4]; + e[6] = s1.a[5]; + e[7] = s2.a[5]; + + if (check_union256 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vxorpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vxorpd-1.c new file mode 100644 index 00000000000..435bf042ade --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vxorpd-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse2-xorpd-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vxorpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vxorpd-256-1.c new file mode 100644 index 00000000000..4896ee01ef8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vxorpd-256-1.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union + { + double d[4]; + long long l[4]; + }source1, source2, e; + + int i; + union256d u, s1, s2; + + s1.x = _mm256_set_pd (34545.123, 95567.456, 23443.09876, 5675.543); + s2.x = _mm256_set_pd (674, 57897.332187, 93459, 45624.112); + _mm256_storeu_pd (source1.d, s1.x); + _mm256_storeu_pd (source2.d, s2.x); + + u.x = _mm256_xor_pd (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e.l[i] = source1.l[i] ^ source2.l[i]; + + if (check_union256d (u, e.d)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vxorps-1.c b/gcc/testsuite/gcc.target/i386/avx-vxorps-1.c new file mode 100644 index 00000000000..e203a7f57fa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vxorps-1.c @@ -0,0 +1,8 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#define CHECK_H "avx-check.h" +#define TEST avx_test + +#include "sse-xorps-1.c" diff --git a/gcc/testsuite/gcc.target/i386/avx-vxorps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vxorps-256-1.c new file mode 100644 index 00000000000..007704846a0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vxorps-256-1.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +void static +avx_test (void) +{ + union { + float f[8]; + int i[8]; + }source1, source2, e; + + int i; + union256 u, s1, s2; + + s1.x = _mm256_set_ps (34545, 95567, 23443, 5675, 2323, 67, 2345, 45667); + s2.x = _mm256_set_ps (674, 57897, 93459, 45624, 54674, 1237, 67436, 79608); + + _mm256_storeu_ps (source1.f, s1.x); + _mm256_storeu_ps (source2.f, s2.x); + + u.x = _mm256_xor_ps (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e.i[i] = source1.i[i] ^ source2.i[i]; + + if (check_union256 (u, e.f)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroall-1.c b/gcc/testsuite/gcc.target/i386/avx-vzeroall-1.c new file mode 100644 index 00000000000..996357a7e02 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vzeroall-1.c @@ -0,0 +1,52 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test (void) +{ + __m256i src; +#ifdef __x86_64__ + char reg_save[16][32]; + char d[16][32]; +#else + char reg_save[8][32]; + char d[8][32]; +#endif + + int s[8] = {1, 2, 3, 4, 5, 6, 7, 8}; + + __builtin_memset (d, 0, sizeof d); + __builtin_memset (reg_save, -1, sizeof reg_save); + + src = _mm256_loadu_si256 ((__m256i*) s); + + _mm256_zeroall (); + + __asm__ __volatile__ ("vmovdqu %%ymm0,%0":"=m"(reg_save[0])); + __asm__ __volatile__ ("vmovdqu %%ymm1,%0":"=m"(reg_save[1])); + __asm__ __volatile__ ("vmovdqu %%ymm2,%0":"=m"(reg_save[2])); + __asm__ __volatile__ ("vmovdqu %%ymm3,%0":"=m"(reg_save[3])); + __asm__ __volatile__ ("vmovdqu %%ymm4,%0":"=m"(reg_save[4])); + __asm__ __volatile__ ("vmovdqu %%ymm5,%0":"=m"(reg_save[5])); + __asm__ __volatile__ ("vmovdqu %%ymm6,%0":"=m"(reg_save[6])); + __asm__ __volatile__ ("vmovdqu %%ymm7,%0":"=m"(reg_save[7])); +#ifdef __x86_64__ + __asm__ __volatile__ ("vmovdqu %%ymm8,%0":"=m"(reg_save[8])); + __asm__ __volatile__ ("vmovdqu %%ymm9,%0":"=m"(reg_save[9])); + __asm__ __volatile__ ("vmovdqu %%ymm10,%0":"=m"(reg_save[10])); + __asm__ __volatile__ ("vmovdqu %%ymm11,%0":"=m"(reg_save[11])); + __asm__ __volatile__ ("vmovdqu %%ymm12,%0":"=m"(reg_save[12])); + __asm__ __volatile__ ("vmovdqu %%ymm13,%0":"=m"(reg_save[13])); + __asm__ __volatile__ ("vmovdqu %%ymm14,%0":"=m"(reg_save[14])); + __asm__ __volatile__ ("vmovdqu %%ymm15,%0":"=m"(reg_save[15])); +#endif + + if (__builtin_memcmp (reg_save, d, sizeof d)) + abort (); + + _mm256_storeu_si256 ((__m256i*) d, src); + +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroall-2.c b/gcc/testsuite/gcc.target/i386/avx-vzeroall-2.c new file mode 100644 index 00000000000..f49a0da424d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vzeroall-2.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static int s[4] = {234566, 8723467, 6576856, 19832468}; +static int d[4] = {1,1,1,1}; + +static void +avx_test (void) +{ + __m128i src; + + src = _mm_loadu_si128 ((__m128i*) s); + _mm256_zeroall (); + _mm_storeu_si128 ((__m128i*) d, src); + + if (__builtin_memcmp (d, s, sizeof (d))) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-1.c b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-1.c new file mode 100644 index 00000000000..2137c25ba98 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-1.c @@ -0,0 +1,56 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +#ifdef __x86_64__ +#define LEN 16 +#else +#define LEN 8 +#endif + +static void +avx_test (void) +{ + __m256i src; + + char reg_save[LEN][32]; + int i, j; + + int s[8] = {1, 2, 3, 4, 5, 6, 7, 8}; + int d[8] = {11, 22, 33, 44, 55, 66, 77, 88}; + + __builtin_memset (reg_save, -1, sizeof reg_save); + + src = _mm256_loadu_si256 ((__m256i*) s); + + _mm256_zeroupper (); + + __asm__ __volatile__ ("vmovdqu %%ymm0,%0":"=m"(reg_save[0])); + __asm__ __volatile__ ("vmovdqu %%ymm1,%0":"=m"(reg_save[1])); + __asm__ __volatile__ ("vmovdqu %%ymm2,%0":"=m"(reg_save[2])); + __asm__ __volatile__ ("vmovdqu %%ymm3,%0":"=m"(reg_save[3])); + __asm__ __volatile__ ("vmovdqu %%ymm4,%0":"=m"(reg_save[4])); + __asm__ __volatile__ ("vmovdqu %%ymm5,%0":"=m"(reg_save[5])); + __asm__ __volatile__ ("vmovdqu %%ymm6,%0":"=m"(reg_save[6])); + __asm__ __volatile__ ("vmovdqu %%ymm7,%0":"=m"(reg_save[7])); +#ifdef __x86_64__ + __asm__ __volatile__ ("vmovdqu %%ymm8,%0":"=m"(reg_save[8])); + __asm__ __volatile__ ("vmovdqu %%ymm9,%0":"=m"(reg_save[9])); + __asm__ __volatile__ ("vmovdqu %%ymm10,%0":"=m"(reg_save[10])); + __asm__ __volatile__ ("vmovdqu %%ymm11,%0":"=m"(reg_save[11])); + __asm__ __volatile__ ("vmovdqu %%ymm12,%0":"=m"(reg_save[12])); + __asm__ __volatile__ ("vmovdqu %%ymm13,%0":"=m"(reg_save[13])); + __asm__ __volatile__ ("vmovdqu %%ymm14,%0":"=m"(reg_save[14])); + __asm__ __volatile__ ("vmovdqu %%ymm15,%0":"=m"(reg_save[15])); +#endif + + for (i = 0; i < LEN; i++) + for (j = 16; j < 32; j++) + if (reg_save[i][j]) + abort (); + + _mm256_storeu_si256 ((__m256i*) d, src); + +} diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-2.c b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-2.c new file mode 100644 index 00000000000..9771e6c073e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-2.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static int s[4] = {234566, 8723467, 6576856, 19832468}; +static int d[4] = {1,1,1,1}; + +static void +avx_test (void) +{ + __m128i src; + + src = _mm_loadu_si128 ((__m128i*) s); + _mm256_zeroupper (); + _mm_storeu_si128 ((__m128i*) d, src); + + if (__builtin_memcmp (d, s, sizeof (d))) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/cold-1.c b/gcc/testsuite/gcc.target/i386/cold-1.c deleted file mode 100644 index bcdc471eb58..00000000000 --- a/gcc/testsuite/gcc.target/i386/cold-1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Test whether using attribute((cold)) really turns on -Os. Do this test - by checking whether strcpy calls the library function rather than doing - the move inline. */ -/* { dg-do compile } */ -/* { dg-options "-O3 -march=k8" } */ -/* { dg-final { scan-assembler "(jmp|call)\t(.*)strcpy" } } */ - -void cold (char *) __attribute__((__cold__)); - -void cold (char *a) -{ - __builtin_strcpy (a, "testing 1.2.3 testing 1.2.3"); -} diff --git a/gcc/testsuite/gcc.target/i386/funcspec-1.c b/gcc/testsuite/gcc.target/i386/funcspec-1.c index 1ee43a0bbb8..1416c75f357 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-1.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-1.c @@ -15,7 +15,7 @@ static float a[SIZE] __attribute__((__aligned__(16))); static float b[SIZE] __attribute__((__aligned__(16))); static float c[SIZE] __attribute__((__aligned__(16))); -void sse_addnums (void) __attribute__ ((__option__ ("sse2"))); +void sse_addnums (void) __attribute__ ((__target__ ("sse2"))); void sse_addnums (void) diff --git a/gcc/testsuite/gcc.target/i386/funcspec-10.c b/gcc/testsuite/gcc.target/i386/funcspec-10.c index 9446cdf8f35..9526e7df2eb 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-10.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-10.c @@ -4,7 +4,7 @@ /* { dg-options "-O2 -march=i686" } */ /* { dg-final { scan-assembler-not "cmov" } } */ -extern int foo (int) __attribute__((__option__("arch=i386"))); +extern int foo (int) __attribute__((__target__("arch=i386"))); int foo (int x) diff --git a/gcc/testsuite/gcc.target/i386/funcspec-11.c b/gcc/testsuite/gcc.target/i386/funcspec-11.c index ec32e0c669e..065ca3ccaa8 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-11.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-11.c @@ -4,7 +4,7 @@ /* { dg-options "-O2 -march=i386" } */ /* { dg-final { scan-assembler "cmov" } } */ -extern int foo (int) __attribute__((__option__("arch=i686"))); +extern int foo (int) __attribute__((__target__("arch=i686"))); int foo (int x) diff --git a/gcc/testsuite/gcc.target/i386/funcspec-2.c b/gcc/testsuite/gcc.target/i386/funcspec-2.c index eb6f48bae1f..e3628e30285 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-2.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-2.c @@ -5,7 +5,7 @@ extern void exit (int); -#define SSE5_ATTR __attribute__((__option__("sse5,fused-madd"))) +#define SSE5_ATTR __attribute__((__target__("sse5,fused-madd"))) extern float flt_mul_add (float a, float b, float c) SSE5_ATTR; extern float flt_mul_sub (float a, float b, float c) SSE5_ATTR; extern float flt_neg_mul_add (float a, float b, float c) SSE5_ATTR; diff --git a/gcc/testsuite/gcc.target/i386/funcspec-3.c b/gcc/testsuite/gcc.target/i386/funcspec-3.c index 80ec23da09f..62748beeeff 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-3.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-3.c @@ -7,8 +7,8 @@ extern void exit (int); extern void abort (void); -#define SSE4A_ATTR __attribute__((__option__("arch=amdfam10"))) -#define SSE42_ATTR __attribute__((__option__("sse4.2"))) +#define SSE4A_ATTR __attribute__((__target__("arch=amdfam10"))) +#define SSE42_ATTR __attribute__((__target__("sse4.2"))) static int sse4a_pop_i (int a) SSE4A_ATTR; static long sse42_pop_l (long a) SSE42_ATTR; diff --git a/gcc/testsuite/gcc.target/i386/funcspec-4.c b/gcc/testsuite/gcc.target/i386/funcspec-4.c index 71251c314bb..98f545a1ce8 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-4.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-4.c @@ -2,13 +2,13 @@ /* { dg-do compile } */ /* no sse500 switch */ -extern void error1 (void) __attribute__((__option__("sse500"))); /* { dg-error "unknown" } */ +extern void error1 (void) __attribute__((__target__("sse500"))); /* { dg-error "unknown" } */ /* Multiple arch switches */ -extern void error2 (void) __attribute__((__option__("arch=core2,arch=k8"))); /* { dg-error "already specified" } */ +extern void error2 (void) __attribute__((__target__("arch=core2,arch=k8"))); /* { dg-error "already specified" } */ /* Unknown tune target */ -extern void error3 (void) __attribute__((__option__("tune=foobar"))); /* { dg-error "bad value" } */ +extern void error3 (void) __attribute__((__target__("tune=foobar"))); /* { dg-error "bad value" } */ /* option on a variable */ -extern int error4 __attribute__((__option__("sse2"))); /* { dg-warning "ignored" } */ +extern int error4 __attribute__((__target__("sse2"))); /* { dg-warning "ignored" } */ diff --git a/gcc/testsuite/gcc.target/i386/funcspec-5.c b/gcc/testsuite/gcc.target/i386/funcspec-5.c index d4204bb1411..378dca5f51c 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-5.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-5.c @@ -3,123 +3,123 @@ /* { dg-do compile } */ /* { dg-require-effective-target ilp32 } */ -extern void test_abm (void) __attribute__((__option__("abm"))); -extern void test_aes (void) __attribute__((__option__("aes"))); -extern void test_fused_madd (void) __attribute__((__option__("fused-madd"))); -extern void test_mmx (void) __attribute__((__option__("mmx"))); -extern void test_pclmul (void) __attribute__((__option__("pclmul"))); -extern void test_popcnt (void) __attribute__((__option__("popcnt"))); -extern void test_recip (void) __attribute__((__option__("recip"))); -extern void test_sse (void) __attribute__((__option__("sse"))); -extern void test_sse2 (void) __attribute__((__option__("sse2"))); -extern void test_sse3 (void) __attribute__((__option__("sse3"))); -extern void test_sse4 (void) __attribute__((__option__("sse4"))); -extern void test_sse4_1 (void) __attribute__((__option__("sse4.1"))); -extern void test_sse4_2 (void) __attribute__((__option__("sse4.2"))); -extern void test_sse4a (void) __attribute__((__option__("sse4a"))); -extern void test_sse5 (void) __attribute__((__option__("sse5"))); -extern void test_ssse3 (void) __attribute__((__option__("ssse3"))); +extern void test_abm (void) __attribute__((__target__("abm"))); +extern void test_aes (void) __attribute__((__target__("aes"))); +extern void test_fused_madd (void) __attribute__((__target__("fused-madd"))); +extern void test_mmx (void) __attribute__((__target__("mmx"))); +extern void test_pclmul (void) __attribute__((__target__("pclmul"))); +extern void test_popcnt (void) __attribute__((__target__("popcnt"))); +extern void test_recip (void) __attribute__((__target__("recip"))); +extern void test_sse (void) __attribute__((__target__("sse"))); +extern void test_sse2 (void) __attribute__((__target__("sse2"))); +extern void test_sse3 (void) __attribute__((__target__("sse3"))); +extern void test_sse4 (void) __attribute__((__target__("sse4"))); +extern void test_sse4_1 (void) __attribute__((__target__("sse4.1"))); +extern void test_sse4_2 (void) __attribute__((__target__("sse4.2"))); +extern void test_sse4a (void) __attribute__((__target__("sse4a"))); +extern void test_sse5 (void) __attribute__((__target__("sse5"))); +extern void test_ssse3 (void) __attribute__((__target__("ssse3"))); -extern void test_no_abm (void) __attribute__((__option__("no-abm"))); -extern void test_no_aes (void) __attribute__((__option__("no-aes"))); -extern void test_no_fused_madd (void) __attribute__((__option__("no-fused-madd"))); -extern void test_no_mmx (void) __attribute__((__option__("no-mmx"))); -extern void test_no_pclmul (void) __attribute__((__option__("no-pclmul"))); -extern void test_no_popcnt (void) __attribute__((__option__("no-popcnt"))); -extern void test_no_recip (void) __attribute__((__option__("no-recip"))); -extern void test_no_sse (void) __attribute__((__option__("no-sse"))); -extern void test_no_sse2 (void) __attribute__((__option__("no-sse2"))); -extern void test_no_sse3 (void) __attribute__((__option__("no-sse3"))); -extern void test_no_sse4 (void) __attribute__((__option__("no-sse4"))); -extern void test_no_sse4_1 (void) __attribute__((__option__("no-sse4.1"))); -extern void test_no_sse4_2 (void) __attribute__((__option__("no-sse4.2"))); -extern void test_no_sse4a (void) __attribute__((__option__("no-sse4a"))); -extern void test_no_sse5 (void) __attribute__((__option__("no-sse5"))); -extern void test_no_ssse3 (void) __attribute__((__option__("no-ssse3"))); +extern void test_no_abm (void) __attribute__((__target__("no-abm"))); +extern void test_no_aes (void) __attribute__((__target__("no-aes"))); +extern void test_no_fused_madd (void) __attribute__((__target__("no-fused-madd"))); +extern void test_no_mmx (void) __attribute__((__target__("no-mmx"))); +extern void test_no_pclmul (void) __attribute__((__target__("no-pclmul"))); +extern void test_no_popcnt (void) __attribute__((__target__("no-popcnt"))); +extern void test_no_recip (void) __attribute__((__target__("no-recip"))); +extern void test_no_sse (void) __attribute__((__target__("no-sse"))); +extern void test_no_sse2 (void) __attribute__((__target__("no-sse2"))); +extern void test_no_sse3 (void) __attribute__((__target__("no-sse3"))); +extern void test_no_sse4 (void) __attribute__((__target__("no-sse4"))); +extern void test_no_sse4_1 (void) __attribute__((__target__("no-sse4.1"))); +extern void test_no_sse4_2 (void) __attribute__((__target__("no-sse4.2"))); +extern void test_no_sse4a (void) __attribute__((__target__("no-sse4a"))); +extern void test_no_sse5 (void) __attribute__((__target__("no-sse5"))); +extern void test_no_ssse3 (void) __attribute__((__target__("no-ssse3"))); -extern void test_arch_i386 (void) __attribute__((__option__("arch=i386"))); -extern void test_arch_i486 (void) __attribute__((__option__("arch=i486"))); -extern void test_arch_i586 (void) __attribute__((__option__("arch=i586"))); -extern void test_arch_pentium (void) __attribute__((__option__("arch=pentium"))); -extern void test_arch_pentium_mmx (void) __attribute__((__option__("arch=pentium-mmx"))); -extern void test_arch_winchip_c6 (void) __attribute__((__option__("arch=winchip-c6"))); -extern void test_arch_winchip2 (void) __attribute__((__option__("arch=winchip2"))); -extern void test_arch_c3 (void) __attribute__((__option__("arch=c3"))); -extern void test_arch_c3_2 (void) __attribute__((__option__("arch=c3-2"))); -extern void test_arch_i686 (void) __attribute__((__option__("arch=i686"))); -extern void test_arch_pentiumpro (void) __attribute__((__option__("arch=pentiumpro"))); -extern void test_arch_pentium2 (void) __attribute__((__option__("arch=pentium2"))); -extern void test_arch_pentium3 (void) __attribute__((__option__("arch=pentium3"))); -extern void test_arch_pentium3m (void) __attribute__((__option__("arch=pentium3m"))); -extern void test_arch_pentium_m (void) __attribute__((__option__("arch=pentium-m"))); -extern void test_arch_pentium4 (void) __attribute__((__option__("arch=pentium4"))); -extern void test_arch_pentium4m (void) __attribute__((__option__("arch=pentium4m"))); -extern void test_arch_prescott (void) __attribute__((__option__("arch=prescott"))); -extern void test_arch_nocona (void) __attribute__((__option__("arch=nocona"))); -extern void test_arch_core2 (void) __attribute__((__option__("arch=core2"))); -extern void test_arch_geode (void) __attribute__((__option__("arch=geode"))); -extern void test_arch_k6 (void) __attribute__((__option__("arch=k6"))); -extern void test_arch_k6_2 (void) __attribute__((__option__("arch=k6-2"))); -extern void test_arch_k6_3 (void) __attribute__((__option__("arch=k6-3"))); -extern void test_arch_athlon (void) __attribute__((__option__("arch=athlon"))); -extern void test_arch_athlon_tbird (void) __attribute__((__option__("arch=athlon-tbird"))); -extern void test_arch_athlon_4 (void) __attribute__((__option__("arch=athlon-4"))); -extern void test_arch_athlon_xp (void) __attribute__((__option__("arch=athlon-xp"))); -extern void test_arch_athlon_mp (void) __attribute__((__option__("arch=athlon-mp"))); -extern void test_arch_k8 (void) __attribute__((__option__("arch=k8"))); -extern void test_arch_k8_sse3 (void) __attribute__((__option__("arch=k8-sse3"))); -extern void test_arch_opteron (void) __attribute__((__option__("arch=opteron"))); -extern void test_arch_opteron_sse3 (void) __attribute__((__option__("arch=opteron-sse3"))); -extern void test_arch_athlon64 (void) __attribute__((__option__("arch=athlon64"))); -extern void test_arch_athlon64_sse3 (void) __attribute__((__option__("arch=athlon64-sse3"))); -extern void test_arch_athlon_fx (void) __attribute__((__option__("arch=athlon-fx"))); -extern void test_arch_amdfam10 (void) __attribute__((__option__("arch=amdfam10"))); -extern void test_arch_barcelona (void) __attribute__((__option__("arch=barcelona"))); -extern void test_arch_foo (void) __attribute__((__option__("arch=foo"))); /* { dg-error "bad value" } */ +extern void test_arch_i386 (void) __attribute__((__target__("arch=i386"))); +extern void test_arch_i486 (void) __attribute__((__target__("arch=i486"))); +extern void test_arch_i586 (void) __attribute__((__target__("arch=i586"))); +extern void test_arch_pentium (void) __attribute__((__target__("arch=pentium"))); +extern void test_arch_pentium_mmx (void) __attribute__((__target__("arch=pentium-mmx"))); +extern void test_arch_winchip_c6 (void) __attribute__((__target__("arch=winchip-c6"))); +extern void test_arch_winchip2 (void) __attribute__((__target__("arch=winchip2"))); +extern void test_arch_c3 (void) __attribute__((__target__("arch=c3"))); +extern void test_arch_c3_2 (void) __attribute__((__target__("arch=c3-2"))); +extern void test_arch_i686 (void) __attribute__((__target__("arch=i686"))); +extern void test_arch_pentiumpro (void) __attribute__((__target__("arch=pentiumpro"))); +extern void test_arch_pentium2 (void) __attribute__((__target__("arch=pentium2"))); +extern void test_arch_pentium3 (void) __attribute__((__target__("arch=pentium3"))); +extern void test_arch_pentium3m (void) __attribute__((__target__("arch=pentium3m"))); +extern void test_arch_pentium_m (void) __attribute__((__target__("arch=pentium-m"))); +extern void test_arch_pentium4 (void) __attribute__((__target__("arch=pentium4"))); +extern void test_arch_pentium4m (void) __attribute__((__target__("arch=pentium4m"))); +extern void test_arch_prescott (void) __attribute__((__target__("arch=prescott"))); +extern void test_arch_nocona (void) __attribute__((__target__("arch=nocona"))); +extern void test_arch_core2 (void) __attribute__((__target__("arch=core2"))); +extern void test_arch_geode (void) __attribute__((__target__("arch=geode"))); +extern void test_arch_k6 (void) __attribute__((__target__("arch=k6"))); +extern void test_arch_k6_2 (void) __attribute__((__target__("arch=k6-2"))); +extern void test_arch_k6_3 (void) __attribute__((__target__("arch=k6-3"))); +extern void test_arch_athlon (void) __attribute__((__target__("arch=athlon"))); +extern void test_arch_athlon_tbird (void) __attribute__((__target__("arch=athlon-tbird"))); +extern void test_arch_athlon_4 (void) __attribute__((__target__("arch=athlon-4"))); +extern void test_arch_athlon_xp (void) __attribute__((__target__("arch=athlon-xp"))); +extern void test_arch_athlon_mp (void) __attribute__((__target__("arch=athlon-mp"))); +extern void test_arch_k8 (void) __attribute__((__target__("arch=k8"))); +extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3"))); +extern void test_arch_opteron (void) __attribute__((__target__("arch=opteron"))); +extern void test_arch_opteron_sse3 (void) __attribute__((__target__("arch=opteron-sse3"))); +extern void test_arch_athlon64 (void) __attribute__((__target__("arch=athlon64"))); +extern void test_arch_athlon64_sse3 (void) __attribute__((__target__("arch=athlon64-sse3"))); +extern void test_arch_athlon_fx (void) __attribute__((__target__("arch=athlon-fx"))); +extern void test_arch_amdfam10 (void) __attribute__((__target__("arch=amdfam10"))); +extern void test_arch_barcelona (void) __attribute__((__target__("arch=barcelona"))); +extern void test_arch_foo (void) __attribute__((__target__("arch=foo"))); /* { dg-error "bad value" } */ -extern void test_tune_i386 (void) __attribute__((__option__("tune=i386"))); -extern void test_tune_i486 (void) __attribute__((__option__("tune=i486"))); -extern void test_tune_i586 (void) __attribute__((__option__("tune=i586"))); -extern void test_tune_pentium (void) __attribute__((__option__("tune=pentium"))); -extern void test_tune_pentium_mmx (void) __attribute__((__option__("tune=pentium-mmx"))); -extern void test_tune_winchip_c6 (void) __attribute__((__option__("tune=winchip-c6"))); -extern void test_tune_winchip2 (void) __attribute__((__option__("tune=winchip2"))); -extern void test_tune_c3 (void) __attribute__((__option__("tune=c3"))); -extern void test_tune_c3_2 (void) __attribute__((__option__("tune=c3-2"))); -extern void test_tune_i686 (void) __attribute__((__option__("tune=i686"))); -extern void test_tune_pentiumpro (void) __attribute__((__option__("tune=pentiumpro"))); -extern void test_tune_pentium2 (void) __attribute__((__option__("tune=pentium2"))); -extern void test_tune_pentium3 (void) __attribute__((__option__("tune=pentium3"))); -extern void test_tune_pentium3m (void) __attribute__((__option__("tune=pentium3m"))); -extern void test_tune_pentium_m (void) __attribute__((__option__("tune=pentium-m"))); -extern void test_tune_pentium4 (void) __attribute__((__option__("tune=pentium4"))); -extern void test_tune_pentium4m (void) __attribute__((__option__("tune=pentium4m"))); -extern void test_tune_prescott (void) __attribute__((__option__("tune=prescott"))); -extern void test_tune_nocona (void) __attribute__((__option__("tune=nocona"))); -extern void test_tune_core2 (void) __attribute__((__option__("tune=core2"))); -extern void test_tune_geode (void) __attribute__((__option__("tune=geode"))); -extern void test_tune_k6 (void) __attribute__((__option__("tune=k6"))); -extern void test_tune_k6_2 (void) __attribute__((__option__("tune=k6-2"))); -extern void test_tune_k6_3 (void) __attribute__((__option__("tune=k6-3"))); -extern void test_tune_athlon (void) __attribute__((__option__("tune=athlon"))); -extern void test_tune_athlon_tbird (void) __attribute__((__option__("tune=athlon-tbird"))); -extern void test_tune_athlon_4 (void) __attribute__((__option__("tune=athlon-4"))); -extern void test_tune_athlon_xp (void) __attribute__((__option__("tune=athlon-xp"))); -extern void test_tune_athlon_mp (void) __attribute__((__option__("tune=athlon-mp"))); -extern void test_tune_k8 (void) __attribute__((__option__("tune=k8"))); -extern void test_tune_k8_sse3 (void) __attribute__((__option__("tune=k8-sse3"))); -extern void test_tune_opteron (void) __attribute__((__option__("tune=opteron"))); -extern void test_tune_opteron_sse3 (void) __attribute__((__option__("tune=opteron-sse3"))); -extern void test_tune_athlon64 (void) __attribute__((__option__("tune=athlon64"))); -extern void test_tune_athlon64_sse3 (void) __attribute__((__option__("tune=athlon64-sse3"))); -extern void test_tune_athlon_fx (void) __attribute__((__option__("tune=athlon-fx"))); -extern void test_tune_amdfam10 (void) __attribute__((__option__("tune=amdfam10"))); -extern void test_tune_barcelona (void) __attribute__((__option__("tune=barcelona"))); -extern void test_tune_generic (void) __attribute__((__option__("tune=generic"))); -extern void test_tune_foo (void) __attribute__((__option__("tune=foo"))); /* { dg-error "bad value" } */ +extern void test_tune_i386 (void) __attribute__((__target__("tune=i386"))); +extern void test_tune_i486 (void) __attribute__((__target__("tune=i486"))); +extern void test_tune_i586 (void) __attribute__((__target__("tune=i586"))); +extern void test_tune_pentium (void) __attribute__((__target__("tune=pentium"))); +extern void test_tune_pentium_mmx (void) __attribute__((__target__("tune=pentium-mmx"))); +extern void test_tune_winchip_c6 (void) __attribute__((__target__("tune=winchip-c6"))); +extern void test_tune_winchip2 (void) __attribute__((__target__("tune=winchip2"))); +extern void test_tune_c3 (void) __attribute__((__target__("tune=c3"))); +extern void test_tune_c3_2 (void) __attribute__((__target__("tune=c3-2"))); +extern void test_tune_i686 (void) __attribute__((__target__("tune=i686"))); +extern void test_tune_pentiumpro (void) __attribute__((__target__("tune=pentiumpro"))); +extern void test_tune_pentium2 (void) __attribute__((__target__("tune=pentium2"))); +extern void test_tune_pentium3 (void) __attribute__((__target__("tune=pentium3"))); +extern void test_tune_pentium3m (void) __attribute__((__target__("tune=pentium3m"))); +extern void test_tune_pentium_m (void) __attribute__((__target__("tune=pentium-m"))); +extern void test_tune_pentium4 (void) __attribute__((__target__("tune=pentium4"))); +extern void test_tune_pentium4m (void) __attribute__((__target__("tune=pentium4m"))); +extern void test_tune_prescott (void) __attribute__((__target__("tune=prescott"))); +extern void test_tune_nocona (void) __attribute__((__target__("tune=nocona"))); +extern void test_tune_core2 (void) __attribute__((__target__("tune=core2"))); +extern void test_tune_geode (void) __attribute__((__target__("tune=geode"))); +extern void test_tune_k6 (void) __attribute__((__target__("tune=k6"))); +extern void test_tune_k6_2 (void) __attribute__((__target__("tune=k6-2"))); +extern void test_tune_k6_3 (void) __attribute__((__target__("tune=k6-3"))); +extern void test_tune_athlon (void) __attribute__((__target__("tune=athlon"))); +extern void test_tune_athlon_tbird (void) __attribute__((__target__("tune=athlon-tbird"))); +extern void test_tune_athlon_4 (void) __attribute__((__target__("tune=athlon-4"))); +extern void test_tune_athlon_xp (void) __attribute__((__target__("tune=athlon-xp"))); +extern void test_tune_athlon_mp (void) __attribute__((__target__("tune=athlon-mp"))); +extern void test_tune_k8 (void) __attribute__((__target__("tune=k8"))); +extern void test_tune_k8_sse3 (void) __attribute__((__target__("tune=k8-sse3"))); +extern void test_tune_opteron (void) __attribute__((__target__("tune=opteron"))); +extern void test_tune_opteron_sse3 (void) __attribute__((__target__("tune=opteron-sse3"))); +extern void test_tune_athlon64 (void) __attribute__((__target__("tune=athlon64"))); +extern void test_tune_athlon64_sse3 (void) __attribute__((__target__("tune=athlon64-sse3"))); +extern void test_tune_athlon_fx (void) __attribute__((__target__("tune=athlon-fx"))); +extern void test_tune_amdfam10 (void) __attribute__((__target__("tune=amdfam10"))); +extern void test_tune_barcelona (void) __attribute__((__target__("tune=barcelona"))); +extern void test_tune_generic (void) __attribute__((__target__("tune=generic"))); +extern void test_tune_foo (void) __attribute__((__target__("tune=foo"))); /* { dg-error "bad value" } */ -extern void test_fpmath_sse (void) __attribute__((__option__("sse2,fpmath=sse"))); -extern void test_fpmath_387 (void) __attribute__((__option__("sse2,fpmath=387"))); -extern void test_fpmath_sse_387 (void) __attribute__((__option__("sse2,fpmath=sse+387"))); -extern void test_fpmath_387_sse (void) __attribute__((__option__("sse2,fpmath=387+sse"))); -extern void test_fpmath_both (void) __attribute__((__option__("sse2,fpmath=both"))); +extern void test_fpmath_sse (void) __attribute__((__target__("sse2,fpmath=sse"))); +extern void test_fpmath_387 (void) __attribute__((__target__("sse2,fpmath=387"))); +extern void test_fpmath_sse_387 (void) __attribute__((__target__("sse2,fpmath=sse+387"))); +extern void test_fpmath_387_sse (void) __attribute__((__target__("sse2,fpmath=387+sse"))); +extern void test_fpmath_both (void) __attribute__((__target__("sse2,fpmath=both"))); diff --git a/gcc/testsuite/gcc.target/i386/funcspec-6.c b/gcc/testsuite/gcc.target/i386/funcspec-6.c index 0c915975894..6b526c2dcc3 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-6.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-6.c @@ -3,69 +3,69 @@ /* { dg-do compile } */ /* { dg-require-effective-target lp64 } */ -extern void test_abm (void) __attribute__((__option__("abm"))); -extern void test_aes (void) __attribute__((__option__("aes"))); -extern void test_fused_madd (void) __attribute__((__option__("fused-madd"))); -extern void test_mmx (void) __attribute__((__option__("mmx"))); -extern void test_pclmul (void) __attribute__((__option__("pclmul"))); -extern void test_popcnt (void) __attribute__((__option__("popcnt"))); -extern void test_recip (void) __attribute__((__option__("recip"))); -extern void test_sse (void) __attribute__((__option__("sse"))); -extern void test_sse2 (void) __attribute__((__option__("sse2"))); -extern void test_sse3 (void) __attribute__((__option__("sse3"))); -extern void test_sse4 (void) __attribute__((__option__("sse4"))); -extern void test_sse4_1 (void) __attribute__((__option__("sse4.1"))); -extern void test_sse4_2 (void) __attribute__((__option__("sse4.2"))); -extern void test_sse4a (void) __attribute__((__option__("sse4a"))); -extern void test_sse5 (void) __attribute__((__option__("sse5"))); -extern void test_ssse3 (void) __attribute__((__option__("ssse3"))); +extern void test_abm (void) __attribute__((__target__("abm"))); +extern void test_aes (void) __attribute__((__target__("aes"))); +extern void test_fused_madd (void) __attribute__((__target__("fused-madd"))); +extern void test_mmx (void) __attribute__((__target__("mmx"))); +extern void test_pclmul (void) __attribute__((__target__("pclmul"))); +extern void test_popcnt (void) __attribute__((__target__("popcnt"))); +extern void test_recip (void) __attribute__((__target__("recip"))); +extern void test_sse (void) __attribute__((__target__("sse"))); +extern void test_sse2 (void) __attribute__((__target__("sse2"))); +extern void test_sse3 (void) __attribute__((__target__("sse3"))); +extern void test_sse4 (void) __attribute__((__target__("sse4"))); +extern void test_sse4_1 (void) __attribute__((__target__("sse4.1"))); +extern void test_sse4_2 (void) __attribute__((__target__("sse4.2"))); +extern void test_sse4a (void) __attribute__((__target__("sse4a"))); +extern void test_sse5 (void) __attribute__((__target__("sse5"))); +extern void test_ssse3 (void) __attribute__((__target__("ssse3"))); -extern void test_no_abm (void) __attribute__((__option__("no-abm"))); -extern void test_no_aes (void) __attribute__((__option__("no-aes"))); -extern void test_no_fused_madd (void) __attribute__((__option__("no-fused-madd"))); -extern void test_no_mmx (void) __attribute__((__option__("no-mmx"))); -extern void test_no_pclmul (void) __attribute__((__option__("no-pclmul"))); -extern void test_no_popcnt (void) __attribute__((__option__("no-popcnt"))); -extern void test_no_recip (void) __attribute__((__option__("no-recip"))); -extern void test_no_sse (void) __attribute__((__option__("no-sse"))); -extern void test_no_sse2 (void) __attribute__((__option__("no-sse2"))); -extern void test_no_sse3 (void) __attribute__((__option__("no-sse3"))); -extern void test_no_sse4 (void) __attribute__((__option__("no-sse4"))); -extern void test_no_sse4_1 (void) __attribute__((__option__("no-sse4.1"))); -extern void test_no_sse4_2 (void) __attribute__((__option__("no-sse4.2"))); -extern void test_no_sse4a (void) __attribute__((__option__("no-sse4a"))); -extern void test_no_sse5 (void) __attribute__((__option__("no-sse5"))); -extern void test_no_ssse3 (void) __attribute__((__option__("no-ssse3"))); +extern void test_no_abm (void) __attribute__((__target__("no-abm"))); +extern void test_no_aes (void) __attribute__((__target__("no-aes"))); +extern void test_no_fused_madd (void) __attribute__((__target__("no-fused-madd"))); +extern void test_no_mmx (void) __attribute__((__target__("no-mmx"))); +extern void test_no_pclmul (void) __attribute__((__target__("no-pclmul"))); +extern void test_no_popcnt (void) __attribute__((__target__("no-popcnt"))); +extern void test_no_recip (void) __attribute__((__target__("no-recip"))); +extern void test_no_sse (void) __attribute__((__target__("no-sse"))); +extern void test_no_sse2 (void) __attribute__((__target__("no-sse2"))); +extern void test_no_sse3 (void) __attribute__((__target__("no-sse3"))); +extern void test_no_sse4 (void) __attribute__((__target__("no-sse4"))); +extern void test_no_sse4_1 (void) __attribute__((__target__("no-sse4.1"))); +extern void test_no_sse4_2 (void) __attribute__((__target__("no-sse4.2"))); +extern void test_no_sse4a (void) __attribute__((__target__("no-sse4a"))); +extern void test_no_sse5 (void) __attribute__((__target__("no-sse5"))); +extern void test_no_ssse3 (void) __attribute__((__target__("no-ssse3"))); -extern void test_arch_nocona (void) __attribute__((__option__("arch=nocona"))); -extern void test_arch_core2 (void) __attribute__((__option__("arch=core2"))); -extern void test_arch_k8 (void) __attribute__((__option__("arch=k8"))); -extern void test_arch_k8_sse3 (void) __attribute__((__option__("arch=k8-sse3"))); -extern void test_arch_opteron (void) __attribute__((__option__("arch=opteron"))); -extern void test_arch_opteron_sse3 (void) __attribute__((__option__("arch=opteron-sse3"))); -extern void test_arch_athlon64 (void) __attribute__((__option__("arch=athlon64"))); -extern void test_arch_athlon64_sse3 (void) __attribute__((__option__("arch=athlon64-sse3"))); -extern void test_arch_athlon_fx (void) __attribute__((__option__("arch=athlon-fx"))); -extern void test_arch_amdfam10 (void) __attribute__((__option__("arch=amdfam10"))); -extern void test_arch_barcelona (void) __attribute__((__option__("arch=barcelona"))); -extern void test_arch_foo (void) __attribute__((__option__("arch=foo"))); /* { dg-error "bad value" } */ +extern void test_arch_nocona (void) __attribute__((__target__("arch=nocona"))); +extern void test_arch_core2 (void) __attribute__((__target__("arch=core2"))); +extern void test_arch_k8 (void) __attribute__((__target__("arch=k8"))); +extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3"))); +extern void test_arch_opteron (void) __attribute__((__target__("arch=opteron"))); +extern void test_arch_opteron_sse3 (void) __attribute__((__target__("arch=opteron-sse3"))); +extern void test_arch_athlon64 (void) __attribute__((__target__("arch=athlon64"))); +extern void test_arch_athlon64_sse3 (void) __attribute__((__target__("arch=athlon64-sse3"))); +extern void test_arch_athlon_fx (void) __attribute__((__target__("arch=athlon-fx"))); +extern void test_arch_amdfam10 (void) __attribute__((__target__("arch=amdfam10"))); +extern void test_arch_barcelona (void) __attribute__((__target__("arch=barcelona"))); +extern void test_arch_foo (void) __attribute__((__target__("arch=foo"))); /* { dg-error "bad value" } */ -extern void test_tune_nocona (void) __attribute__((__option__("tune=nocona"))); -extern void test_tune_core2 (void) __attribute__((__option__("tune=core2"))); -extern void test_tune_k8 (void) __attribute__((__option__("tune=k8"))); -extern void test_tune_k8_sse3 (void) __attribute__((__option__("tune=k8-sse3"))); -extern void test_tune_opteron (void) __attribute__((__option__("tune=opteron"))); -extern void test_tune_opteron_sse3 (void) __attribute__((__option__("tune=opteron-sse3"))); -extern void test_tune_athlon64 (void) __attribute__((__option__("tune=athlon64"))); -extern void test_tune_athlon64_sse3 (void) __attribute__((__option__("tune=athlon64-sse3"))); -extern void test_tune_athlon_fx (void) __attribute__((__option__("tune=athlon-fx"))); -extern void test_tune_amdfam10 (void) __attribute__((__option__("tune=amdfam10"))); -extern void test_tune_barcelona (void) __attribute__((__option__("tune=barcelona"))); -extern void test_tune_generic (void) __attribute__((__option__("tune=generic"))); -extern void test_tune_foo (void) __attribute__((__option__("tune=foo"))); /* { dg-error "bad value" } */ +extern void test_tune_nocona (void) __attribute__((__target__("tune=nocona"))); +extern void test_tune_core2 (void) __attribute__((__target__("tune=core2"))); +extern void test_tune_k8 (void) __attribute__((__target__("tune=k8"))); +extern void test_tune_k8_sse3 (void) __attribute__((__target__("tune=k8-sse3"))); +extern void test_tune_opteron (void) __attribute__((__target__("tune=opteron"))); +extern void test_tune_opteron_sse3 (void) __attribute__((__target__("tune=opteron-sse3"))); +extern void test_tune_athlon64 (void) __attribute__((__target__("tune=athlon64"))); +extern void test_tune_athlon64_sse3 (void) __attribute__((__target__("tune=athlon64-sse3"))); +extern void test_tune_athlon_fx (void) __attribute__((__target__("tune=athlon-fx"))); +extern void test_tune_amdfam10 (void) __attribute__((__target__("tune=amdfam10"))); +extern void test_tune_barcelona (void) __attribute__((__target__("tune=barcelona"))); +extern void test_tune_generic (void) __attribute__((__target__("tune=generic"))); +extern void test_tune_foo (void) __attribute__((__target__("tune=foo"))); /* { dg-error "bad value" } */ -extern void test_fpmath_sse (void) __attribute__((__option__("sse2,fpmath=sse"))); -extern void test_fpmath_387 (void) __attribute__((__option__("sse2,fpmath=387"))); -extern void test_fpmath_sse_387 (void) __attribute__((__option__("sse2,fpmath=sse+387"))); -extern void test_fpmath_387_sse (void) __attribute__((__option__("sse2,fpmath=387+sse"))); -extern void test_fpmath_both (void) __attribute__((__option__("sse2,fpmath=both"))); +extern void test_fpmath_sse (void) __attribute__((__target__("sse2,fpmath=sse"))); +extern void test_fpmath_387 (void) __attribute__((__target__("sse2,fpmath=387"))); +extern void test_fpmath_sse_387 (void) __attribute__((__target__("sse2,fpmath=sse+387"))); +extern void test_fpmath_387_sse (void) __attribute__((__target__("sse2,fpmath=387+sse"))); +extern void test_fpmath_both (void) __attribute__((__target__("sse2,fpmath=both"))); diff --git a/gcc/testsuite/gcc.target/i386/funcspec-7.c b/gcc/testsuite/gcc.target/i386/funcspec-7.c index a65ae251978..56b5490501a 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-7.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-7.c @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -march=k8 -mno-recip -mfpmath=sse -ffast-math" } */ -float do_recip (float a) __attribute__((__option__("recip"))); +float do_recip (float a) __attribute__((__target__("recip"))); float do_normal (float a); float do_recip (float a) { return 1.0f / __builtin_sqrtf (a); } diff --git a/gcc/testsuite/gcc.target/i386/funcspec-8.c b/gcc/testsuite/gcc.target/i386/funcspec-8.c index 115f60866a2..2478c672d0c 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-8.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-8.c @@ -12,7 +12,7 @@ typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); #error "-msse3 should not be set for this test" #endif -__m128d sse3_hsubpd (__m128d a, __m128d b) __attribute__((__option__("sse3"))); +__m128d sse3_hsubpd (__m128d a, __m128d b) __attribute__((__target__("sse3"))); __m128d generic_hsubpd (__m128d a, __m128d b); __m128d @@ -31,7 +31,7 @@ generic_hsubpd (__m128d a, __m128d b) #error "-mssse3 should not be set for this test" #endif -__m128w ssse3_psignd128 (__m128w a, __m128w b) __attribute__((__option__("ssse3"))); +__m128w ssse3_psignd128 (__m128w a, __m128w b) __attribute__((__target__("ssse3"))); __m128w generic_psignd (__m128w ab, __m128w b); __m128w @@ -50,7 +50,7 @@ generic_psignd128 (__m128w a, __m128w b) #error "-msse4.1 should not be set for this test" #endif -__m128d sse4_1_blendvpd (__m128d a, __m128d b, __m128d c) __attribute__((__option__("sse4.1"))); +__m128d sse4_1_blendvpd (__m128d a, __m128d b, __m128d c) __attribute__((__target__("sse4.1"))); __m128d generic_blendvpd (__m128d a, __m128d b, __m128d c); __m128d @@ -69,7 +69,7 @@ generic_blendvpd (__m128d a, __m128d b, __m128d c) #error "-msse4.2 should not be set for this test" #endif -__m128i sse4_2_pcmpgtq (__m128i a, __m128i b) __attribute__((__option__("sse4.2"))); +__m128i sse4_2_pcmpgtq (__m128i a, __m128i b) __attribute__((__target__("sse4.2"))); __m128i generic_pcmpgtq (__m128i ab, __m128i b); __m128i @@ -88,7 +88,7 @@ generic_pcmpgtq (__m128i a, __m128i b) #error "-msse4a should not be set for this test" #endif -__m128i sse4_2_insertq (__m128i a, __m128i b) __attribute__((__option__("sse4a"))); +__m128i sse4_2_insertq (__m128i a, __m128i b) __attribute__((__target__("sse4a"))); __m128i generic_insertq (__m128i ab, __m128i b); __m128i @@ -107,7 +107,7 @@ generic_insertq (__m128i a, __m128i b) #error "-msse5 should not be set for this test" #endif -__m128d sse5_fmaddpd (__m128d a, __m128d b, __m128d c) __attribute__((__option__("sse5"))); +__m128d sse5_fmaddpd (__m128d a, __m128d b, __m128d c) __attribute__((__target__("sse5"))); __m128d generic_fmaddpd (__m128d a, __m128d b, __m128d c); __m128d @@ -126,7 +126,7 @@ generic_fmaddpd (__m128d a, __m128d b, __m128d c) #error "-maes should not be set for this test" #endif -__m128i aes_aesimc128 (__m128i a) __attribute__((__option__("aes"))); +__m128i aes_aesimc128 (__m128i a) __attribute__((__target__("aes"))); __m128i generic_aesimc128 (__m128i a); __m128i @@ -145,7 +145,7 @@ generic_aesimc128 (__m128i a) #error "-mpclmul should not be set for this test" #endif -__m128i pclmul_pclmulqdq128 (__m128i a, __m128i b) __attribute__((__option__("pclmul"))); +__m128i pclmul_pclmulqdq128 (__m128i a, __m128i b) __attribute__((__target__("pclmul"))); __m128i generic_pclmulqdq128 (__m128i a, __m128i b); __m128i diff --git a/gcc/testsuite/gcc.target/i386/funcspec-9.c b/gcc/testsuite/gcc.target/i386/funcspec-9.c index e6d19013101..1a7fc1b5890 100644 --- a/gcc/testsuite/gcc.target/i386/funcspec-9.c +++ b/gcc/testsuite/gcc.target/i386/funcspec-9.c @@ -5,14 +5,14 @@ extern void exit (int); #ifdef __SSE5__ -#warning "__SSE5__ should not be defined before #pragma GCC option." +#warning "__SSE5__ should not be defined before #pragma GCC target." #endif -#pragma GCC option (push) -#pragma GCC option ("sse5,fused-madd") +#pragma GCC push_options +#pragma GCC target ("sse5,fused-madd") #ifndef __SSE5__ -#warning "__SSE5__ should have be defined after #pragma GCC option." +#warning "__SSE5__ should have be defined after #pragma GCC target." #endif float @@ -21,9 +21,9 @@ flt_mul_add (float a, float b, float c) return (a * b) + c; } -#pragma GCC option (pop) +#pragma GCC pop_options #ifdef __SSE5__ -#warning "__SSE5__ should not be defined after #pragma GCC pop option." +#warning "__SSE5__ should not be defined after #pragma GCC pop target." #endif double diff --git a/gcc/testsuite/gcc.target/i386/hot-1.c b/gcc/testsuite/gcc.target/i386/hot-1.c deleted file mode 100644 index 608f52fd6eb..00000000000 --- a/gcc/testsuite/gcc.target/i386/hot-1.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Test whether using attribute((hot)) really turns on -O3. Do this test - by checking whether we vectorize a simple loop. */ -/* { dg-do compile } */ -/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */ -/* { dg-final { scan-assembler "addps" } } */ -/* { dg-final { scan-assembler "subss" } } */ - -#define SIZE 1024 -float a[SIZE] __attribute__((__aligned__(32))); -float b[SIZE] __attribute__((__aligned__(32))); -float c[SIZE] __attribute__((__aligned__(32))); - -/* This should vectorize. */ -void hot (void) __attribute__((__hot__)); - -void -hot (void) -{ - int i; - - for (i = 0; i < SIZE; i++) - a[i] = b[i] + c[i]; -} - -/* This should not vectorize. */ -void -not_hot (void) -{ - int i; - - for (i = 0; i < SIZE; i++) - a[i] = b[i] - c[i]; -} diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp index e28ce933c7f..612bec48e79 100644 --- a/gcc/testsuite/gcc.target/i386/i386.exp +++ b/gcc/testsuite/gcc.target/i386/i386.exp @@ -64,6 +64,19 @@ proc check_effective_target_aes { } { } "-O2 -maes" ] } +# Return 1 if vaes instructions can be compiled. +proc check_effective_target_vaes { } { + return [check_no_compiler_messages vaes object { + typedef long long __m128i __attribute__ ((__vector_size__ (16))); + typedef long long __v2di __attribute__ ((__vector_size__ (16))); + + __m128i _mm_aesimc_si128 (__m128i __X) + { + return (__m128i) __builtin_ia32_aesimc128 ((__v2di)__X); + } + } "-O2 -maes -mavx" ] +} + # Return 1 if pclmul instructions can be compiled. proc check_effective_target_pclmul { } { return [check_no_compiler_messages pclmul object { diff --git a/gcc/testsuite/gcc.target/i386/m128-check.h b/gcc/testsuite/gcc.target/i386/m128-check.h index a20f8215082..071381fd25c 100644 --- a/gcc/testsuite/gcc.target/i386/m128-check.h +++ b/gcc/testsuite/gcc.target/i386/m128-check.h @@ -1,4 +1,7 @@ #include <stdio.h> +#include <xmmintrin.h> + +#ifdef __SSE2__ #include <emmintrin.h> typedef union @@ -10,12 +13,24 @@ typedef union typedef union { __m128i x; + unsigned char a[16]; +} union128i_ub; + +typedef union +{ + __m128i x; short a[8]; } union128i_w; typedef union { __m128i x; + unsigned short a[8]; +} union128i_uw; + +typedef union +{ + __m128i x; int a[4]; } union128i_d; @@ -27,15 +42,16 @@ typedef union typedef union { - __m128 x; - float a[4]; -} union128; - -typedef union -{ __m128d x; double a[2]; } union128d; +#endif + +typedef union +{ + __m128 x; + float a[4]; +} union128; #ifndef ARRAY_SIZE #define ARRAY_SIZE(A) (sizeof (A) / sizeof ((A)[0])) @@ -65,9 +81,82 @@ check_##UINON_TYPE (UINON_TYPE u, const VALUE_TYPE *v) \ return err; \ } +#ifdef __SSE2__ CHECK_EXP (union128i_b, char, "%d") +CHECK_EXP (union128i_ub, unsigned char, "%d") CHECK_EXP (union128i_w, short, "%d") +CHECK_EXP (union128i_uw, unsigned short, "%d") CHECK_EXP (union128i_d, int, "0x%x") CHECK_EXP (union128i_q, long long, "0x%llx") -CHECK_EXP (union128, float, "%f") CHECK_EXP (union128d, double, "%f") +#endif + +CHECK_EXP (union128, float, "%f") + +#define ESP_FLOAT 0.000001 +#define ESP_DOUBLE 0.000001 +#define CHECK_ARRAY(ARRAY, TYPE, FMT) \ +static int \ +__attribute__((noinline, unused)) \ +checkV##ARRAY (const TYPE *v, const TYPE *e, int n) \ +{ \ + int i; \ + int err = 0; \ + \ + for (i = 0; i < n; i++) \ + if (v[i] != e[i]) \ + { \ + err++; \ + PRINTF ("%i: " FMT " != " FMT "\n", \ + i, v[i], e[i]); \ + } \ + return err; \ +} + +CHECK_ARRAY(i, int, "0x%x") +CHECK_ARRAY(l, long long, "0x%llx") + +#define CHECK_FP_ARRAY(ARRAY, TYPE, ESP, FMT) \ +static int \ +__attribute__((noinline, unused)) \ +checkV##ARRAY (const TYPE *v, const TYPE *e, int n) \ +{ \ + int i; \ + int err = 0; \ + \ + for (i = 0; i < n; i++) \ + if (v[i] > (e[i] + (ESP)) || v[i] < (e[i] - (ESP))) \ + if (e[i] != v[i]) \ + { \ + err++; \ + PRINTF ("%i: " FMT " != " FMT "\n", \ + i, v[i], e[i]); \ + } \ + return err; \ +} + +CHECK_FP_ARRAY (d, double, ESP_DOUBLE, "%f") +CHECK_FP_ARRAY (f, float, ESP_FLOAT, "%f") + +union ieee754_float +{ + float d; + struct + { + unsigned long frac : 23; + unsigned exp : 8; + unsigned sign : 1; + } bits __attribute__((packed)); +}; + +union ieee754_double +{ + double d; + struct + { + unsigned long frac1 : 32; + unsigned long frac0 : 20; + unsigned exp : 11; + unsigned sign : 1; + } bits __attribute__((packed)); +}; diff --git a/gcc/testsuite/gcc.target/i386/m256-1.c b/gcc/testsuite/gcc.target/i386/m256-1.c new file mode 100644 index 00000000000..a40b9e88f6d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/m256-1.c @@ -0,0 +1,63 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-mavx" } */ + +#include <assert.h> +#include "avx-check.h" + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; +__m256d n2 = { -93.83, 893.318, 3884.34, -3134.3 }; +__m256i n3 = { 893, -3180, 3334, -3984 }; +int n4 = -30; +double n5 = 40.3; +__m128i n6 = { 8931, -13984 }; +__m128d n7 = { 1893.318, -31134.3 }; +__m256 n8 = +{ + -913.87, 8193.518, 312884.34, -9134.9, + -19093.83, 89312.318, 7884.84, -4134.3 +}; +__m128 n9 = { -1283.3, -213.3, 3213.4, 81119.03 }; +__m128i n10 = { 28131, -313684 }; +int n11 = 103; +double n12 = -3004.3; +__m256d n13 = { 913.73, -93.38, 84.34, -734.3 }; +__m128d n14 = { -73.378, 934.31 }; +__m256 n15 = +{ + 13.73, -8193.318, 384.74, 734.9, + 193.83, 312.78, 7884.34, -8134.3 +}; +__m128i n16 = { 831, -3849 }; + +void +__attribute__((noinline)) +m256_test (__m128 a1, __m256d a2, __m256i a3, int a4, double a5, + __m128i a6, __m128d a7, __m256 a8, __m128 a9, __m128i a10, + int a11, double a12, __m256d a13, __m128d a14, __m256 a15, + __m128i a16) +{ + assert (__builtin_memcmp (&a1, &n1, sizeof (a1)) == 0); + assert (__builtin_memcmp (&a2, &n2, sizeof (a2)) == 0); + assert (__builtin_memcmp (&a3, &n3, sizeof (a3)) == 0); + assert (a4 == n4); + assert (a5 == n5); + assert (__builtin_memcmp (&a6, &n6, sizeof (a6)) == 0); + assert (__builtin_memcmp (&a7, &n7, sizeof (a7)) == 0); + assert (__builtin_memcmp (&a8, &n8, sizeof (a8)) == 0); + assert (__builtin_memcmp (&a9, &n9, sizeof (a9)) == 0); + assert (__builtin_memcmp (&a10, &n10, sizeof (a10)) == 0); + assert (a11 == n11); + assert (a12 == n12); + assert (__builtin_memcmp (&a13, &n13, sizeof (a13)) == 0); + assert (__builtin_memcmp (&a14, &n14, sizeof (a14)) == 0); + assert (__builtin_memcmp (&a15, &n15, sizeof (a15)) == 0); + assert (__builtin_memcmp (&a16, &n16, sizeof (a16)) == 0); +} + +static void +avx_test (void) +{ + m256_test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, + n13, n14, n15, n16); +} diff --git a/gcc/testsuite/gcc.target/i386/m256-2.c b/gcc/testsuite/gcc.target/i386/m256-2.c new file mode 100644 index 00000000000..64e38527d7a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/m256-2.c @@ -0,0 +1,73 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-mavx" } */ + +#include <assert.h> +#include "avx-check.h" + +struct m128 +{ + __m128 v; +}; + +struct m256d +{ + __m256d v; +}; + +struct m128 n1 = { { -283.3, -23.3, 213.4, 1119.03 } }; +struct m256d n2 = { { -93.83, 893.318, 3884.34, -3134.3 } }; +__m256i n3 = { 893, -3180, 3334, -3984 }; +int n4 = -30; +double n5 = 40.3; +__m128i n6 = { 8931, -13984 }; +__m128d n7 = { 1893.318, -31134.3 }; +__m256 n8 = +{ + -913.87, 8193.518, 312884.34, -9134.9, + -19093.83, 89312.318, 7884.84, -4134.3 +}; +__m128 n9 = { -1283.3, -213.3, 3213.4, 81119.03 }; +__m128i n10 = { 28131, -313684 }; +int n11 = 103; +double n12 = -3004.3; +struct m256d n13 = { { 913.73, -93.38, 84.34, -734.3 } }; +__m128d n14 = { -73.378, 934.31 }; +__m256 n15 = +{ + 13.73, -8193.318, 384.74, 734.9, + 193.83, 312.78, 7884.34, -8134.3 +}; +__m128i n16 = { 831, -3849 }; + +void +__attribute__((noinline)) +m256_test (struct m128 a1, struct m256d a2, __m256i a3, int a4, double a5, + __m128i a6, __m128d a7, __m256 a8, __m128 a9, __m128i a10, + int a11, double a12, struct m256d a13, __m128d a14, __m256 a15, + __m128i a16) +{ + assert (__builtin_memcmp (&a1, &n1, sizeof (a1)) == 0); + assert (__builtin_memcmp (&a2, &n2, sizeof (a2)) == 0); + assert (__builtin_memcmp (&a3, &n3, sizeof (a3)) == 0); + assert (a4 == n4); + assert (a5 == n5); + assert (__builtin_memcmp (&a6, &n6, sizeof (a6)) == 0); + assert (__builtin_memcmp (&a7, &n7, sizeof (a7)) == 0); + assert (__builtin_memcmp (&a8, &n8, sizeof (a8)) == 0); + assert (__builtin_memcmp (&a9, &n9, sizeof (a9)) == 0); + assert (__builtin_memcmp (&a10, &n10, sizeof (a10)) == 0); + assert (a11 == n11); + assert (a12 == n12); + assert (__builtin_memcmp (&a13, &n13, sizeof (a13)) == 0); + assert (__builtin_memcmp (&a14, &n14, sizeof (a14)) == 0); + assert (__builtin_memcmp (&a15, &n15, sizeof (a15)) == 0); + assert (__builtin_memcmp (&a16, &n16, sizeof (a16)) == 0); +} + +static void +avx_test (void) +{ + m256_test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, + n13, n14, n15, n16); +} diff --git a/gcc/testsuite/gcc.target/i386/m256-check.h b/gcc/testsuite/gcc.target/i386/m256-check.h new file mode 100644 index 00000000000..324af75ba64 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/m256-check.h @@ -0,0 +1,73 @@ +#include <gmmintrin.h> +#include "m128-check.h" + +#ifndef max +#define max(a, b) (((a) > (b)) ? (a):(b)) +#endif +#ifndef min +#define min(a, b) (((a) < (b)) ? (a):(b)) +#endif + +typedef union +{ + __m256i x; + char a[32]; +} union256i_b; + +typedef union +{ + __m256i x; + short a[16]; +} union256i_w; + +typedef union +{ + __m256i x; + int a[8]; +} union256i_d; + +typedef union +{ + __m256i x; + long long a[4]; +} union256i_q; + +typedef union +{ + __m256 x; + float a[8]; +} union256; + +typedef union +{ + __m256d x; + double a[4]; +} union256d; + +CHECK_EXP (union256i_b, char, "%d") +CHECK_EXP (union256i_w, short, "%d") +CHECK_EXP (union256i_d, int, "0x%x") +CHECK_EXP (union256i_q, long long, "0x%llx") +CHECK_EXP (union256, float, "%f") +CHECK_EXP (union256d, double, "%f") + +#define CHECK_FP_EXP(UINON_TYPE, VALUE_TYPE, ESP, FMT) \ +static int \ +__attribute__((noinline, unused)) \ +check_fp_##UINON_TYPE (UINON_TYPE u, const VALUE_TYPE *v) \ +{ \ + int i; \ + int err = 0; \ + \ + for (i = 0; i < ARRAY_SIZE (u.a); i++) \ + if (u.a[i] > (v[i] + (ESP)) || u.a[i] < (v[i] - (ESP))) \ + { \ + err++; \ + PRINTF ("%i: " FMT " != " FMT "\n", \ + i, v[i], u.a[i]); \ + } \ + return err; \ +} + +CHECK_FP_EXP (union256, float, ESP_FLOAT, "%f") +CHECK_FP_EXP (union256d, double, ESP_DOUBLE, "%f") diff --git a/gcc/testsuite/gcc.target/i386/opt-2.c b/gcc/testsuite/gcc.target/i386/opt-2.c index 8d6ba6fe925..d2791e071c3 100644 --- a/gcc/testsuite/gcc.target/i386/opt-2.c +++ b/gcc/testsuite/gcc.target/i386/opt-2.c @@ -12,7 +12,7 @@ float b[SIZE] __attribute__((__aligned__(32))); float c[SIZE] __attribute__((__aligned__(32))); /* This should vectorize. */ -#pragma GCC optimize push +#pragma GCC push_options #pragma GCC optimize (3, "unroll-all-loops", "-fprefetch-loop-arrays") void @@ -24,7 +24,7 @@ opt3 (void) a[i] = b[i] + c[i]; } -#pragma GCC optimize pop +#pragma GCC pop_options /* This should not vectorize. */ void diff --git a/gcc/testsuite/gcc.target/i386/pr37184.c b/gcc/testsuite/gcc.target/i386/pr37184.c new file mode 100644 index 00000000000..14e11f70795 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr37184.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target ilp32 } */ +/* { dg-options "-O1" } */ + +static inline unsigned int +rshift_u_s (unsigned int left, int right) +{ + return left >> right; +} + +unsigned int g_15; + +int func_29 (int p_30) +{ + unsigned int l_31; + unsigned long long int l_35 = 0x7736EAE11771B705LL; + unsigned int l_36 = 0xEDB553A8L; + + l_31 = g_15; + if ((l_31 < + (rshift_u_s ((g_15 - (g_15 >= l_35)), (l_36 <= 1)))) + mod_rhs (1)) + return 1; +} + diff --git a/gcc/testsuite/gcc.target/i386/pr37191.c b/gcc/testsuite/gcc.target/i386/pr37191.c new file mode 100644 index 00000000000..b7b65df12b1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr37191.c @@ -0,0 +1,43 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -mmmx" } */ + +#include <mmintrin.h> +#include <stddef.h> +#include <stdint.h> + +extern const uint64_t ff_bone; + +static inline void transpose4x4(uint8_t *dst, uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride) { + __m64 row0 = _mm_cvtsi32_si64(*(unsigned*)(src + (0 * src_stride))); + __m64 row1 = _mm_cvtsi32_si64(*(unsigned*)(src + (1 * src_stride))); + __m64 row2 = _mm_cvtsi32_si64(*(unsigned*)(src + (2 * src_stride))); + __m64 row3 = _mm_cvtsi32_si64(*(unsigned*)(src + (3 * src_stride))); + __m64 tmp0 = _mm_unpacklo_pi8(row0, row1); + __m64 tmp1 = _mm_unpacklo_pi8(row2, row3); + __m64 row01 = _mm_unpacklo_pi16(tmp0, tmp1); + __m64 row23 = _mm_unpackhi_pi16(tmp0, tmp1); + *((unsigned*)(dst + (0 * dst_stride))) = _mm_cvtsi64_si32(row01); + *((unsigned*)(dst + (1 * dst_stride))) = _mm_cvtsi64_si32(_mm_unpackhi_pi32(row01, row01)); + *((unsigned*)(dst + (2 * dst_stride))) = _mm_cvtsi64_si32(row23); + *((unsigned*)(dst + (3 * dst_stride))) = _mm_cvtsi64_si32(_mm_unpackhi_pi32(row23, row23)); +} + +static inline void h264_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha1, int beta1) +{ + asm volatile( + "" + :: "r"(pix-2*stride), "r"(pix), "r"((long)stride), + "m"(alpha1), "m"(beta1), "m"(ff_bone) + ); +} + +void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta) +{ + + uint8_t trans[8*4] __attribute__ ((aligned (8))); + transpose4x4(trans, pix-2, 8, stride); + transpose4x4(trans+4, pix-2+4*stride, 8, stride); + h264_loop_filter_chroma_intra_mmx2(trans+2*8, 8, alpha-1, beta-1); + transpose4x4(pix-2, trans, stride, 8); + transpose4x4(pix-2+4*stride, trans+4, stride, 8); +} diff --git a/gcc/testsuite/gcc.target/i386/pr37197.c b/gcc/testsuite/gcc.target/i386/pr37197.c new file mode 100644 index 00000000000..95565e8027e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr37197.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse4" } */ + +int testl (unsigned long *a, int b) +{ + return b ? 1 : __builtin_parityl (*a); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c index a9b10333157..f530e54ec30 100644 --- a/gcc/testsuite/gcc.target/i386/sse-22.c +++ b/gcc/testsuite/gcc.target/i386/sse-22.c @@ -37,7 +37,7 @@ #ifndef DIFFERENT_PRAGMAS -#pragma GCC option ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse5,aes,pclmul") +#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse5,aes,pclmul") #endif /* Following intrinsics require immediate arguments. They @@ -45,19 +45,19 @@ /* mmintrin.h (MMX). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("mmx") +#pragma GCC target ("mmx") #endif #include <mmintrin.h> /* mm3dnow.h (3DNOW). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("3dnow") +#pragma GCC target ("3dnow") #endif #include <mm3dnow.h> /* xmmintrin.h (SSE). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("sse") +#pragma GCC target ("sse") #endif #include <xmmintrin.h> test_2 (_mm_shuffle_ps, __m128, __m128, __m128, 1) @@ -71,7 +71,7 @@ test_1 (_mm_prefetch, void, void *, _MM_HINT_NTA) /* emmintrin.h (SSE2). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("sse2") +#pragma GCC target ("sse2") #endif #include <emmintrin.h> test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1) @@ -85,13 +85,13 @@ test_1 (_mm_shuffle_epi32, __m128i, __m128i, 1) /* pmmintrin.h (SSE3). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("sse3") +#pragma GCC target ("sse3") #endif #include <pmmintrin.h> /* tmmintrin.h (SSSE3). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("ssse3") +#pragma GCC target ("ssse3") #endif #include <tmmintrin.h> test_2 (_mm_alignr_epi8, __m128i, __m128i, __m128i, 1) @@ -99,7 +99,7 @@ test_2 (_mm_alignr_pi8, __m64, __m64, __m64, 1) /* ammintrin.h (SSE4A). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("sse4a") +#pragma GCC target ("sse4a") #endif #include <ammintrin.h> test_1x (_mm_extracti_si64, __m128i, __m128i, 1, 1) @@ -110,7 +110,7 @@ test_2x (_mm_inserti_si64, __m128i, __m128i, __m128i, 1, 1) /* Note, nmmintrin.h includes smmintrin.h, and smmintrin.h checks for the #ifdef. So just set the option to SSE4.2. */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("sse4.2") +#pragma GCC target ("sse4.2") #endif #include <nmmintrin.h> test_2 (_mm_blend_epi16, __m128i, __m128i, __m128i, 1) @@ -148,7 +148,7 @@ test_4 (_mm_cmpestrz, int, __m128i, int, __m128i, int, 1) /* bmmintrin.h (SSE5). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("sse5") +#pragma GCC target ("sse5") #endif #include <bmmintrin.h> test_1 (_mm_roti_epi8, __m128i, __m128i, 1) @@ -158,7 +158,7 @@ test_1 (_mm_roti_epi64, __m128i, __m128i, 1) /* wmmintrin.h (AES/PCLMUL). */ #ifdef DIFFERENT_PRAGMAS -#pragma GCC option ("aes,pclmul") +#pragma GCC target ("aes,pclmul") #endif #include <wmmintrin.h> test_1 (_mm_aeskeygenassist_si128, __m128i, __m128i, 1) diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c index 27b601452a5..4488568f450 100644 --- a/gcc/testsuite/gcc.target/i386/sse-23.c +++ b/gcc/testsuite/gcc.target/i386/sse-23.c @@ -101,7 +101,7 @@ #define __builtin_ia32_protqi(A, B) __builtin_ia32_protqi(A,1) -#pragma GCC option ("3dnow,sse4,sse5,aes,pclmul") +#pragma GCC target ("3dnow,sse4,sse5,aes,pclmul") #include <wmmintrin.h> #include <bmmintrin.h> #include <smmintrin.h> diff --git a/gcc/testsuite/gcc.target/i386/sse-addps-1.c b/gcc/testsuite/gcc.target/i386/sse-addps-1.c new file mode 100644 index 00000000000..2aa1cfa411a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-addps-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_add_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + int i; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] + s2.a[i]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-addss-1.c b/gcc/testsuite/gcc.target/i386/sse-addss-1.c new file mode 100644 index 00000000000..911a6cd9192 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-addss-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_add_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] + s2.a[0]; + e[1] = s1.a[1]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-andnps-1.c b/gcc/testsuite/gcc.target/i386/sse-andnps-1.c new file mode 100644 index 00000000000..06d1e07dd40 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-andnps-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_andnot_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + int source1[4]={34, 545, 955, 67}; + int source2[4]={67, 4, 57, 897}; + int e[4]; + + s1.x = _mm_loadu_ps ((float *)source1); + s2.x = _mm_loadu_ps ((float *)source2); + u.x = test (s1.x, s2.x); + + e[0] = (~source1[0]) & source2[0]; + e[1] = (~source1[1]) & source2[1]; + e[2] = (~source1[2]) & source2[2]; + e[3] = (~source1[3]) & source2[3]; + + if (check_union128 (u, (float *)e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-andps-1.c b/gcc/testsuite/gcc.target/i386/sse-andps-1.c new file mode 100644 index 00000000000..aa46b8a28b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-andps-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_and_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + union + { + float f[4]; + int i[4]; + }source1, source2, e; + + s1.x = _mm_set_ps (34, 545, 955, 67); + s2.x = _mm_set_ps (67, 4, 57, 897); + + _mm_storeu_ps (source1.f, s1.x); + _mm_storeu_ps (source2.f, s2.x); + + u.x = test (s1.x, s2.x); + + e.i[0] = source1.i[0] & source2.i[0]; + e.i[1] = source1.i[1] & source2.i[1]; + e.i[2] = source1.i[2] & source2.i[2]; + e.i[3] = source1.i[3] & source2.i[3]; + + if (check_union128 (u, e.f)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-check.h b/gcc/testsuite/gcc.target/i386/sse-check.h index d485b8dfa03..79ea4815517 100644 --- a/gcc/testsuite/gcc.target/i386/sse-check.h +++ b/gcc/testsuite/gcc.target/i386/sse-check.h @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include "m128-check.h" #include "cpuid.h" diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-1.c b/gcc/testsuite/gcc.target/i386/sse-comiss-1.c new file mode 100644 index 00000000000..2892a70a67b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-comiss-1.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_comieq_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] == s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-2.c b/gcc/testsuite/gcc.target/i386/sse-comiss-2.c new file mode 100644 index 00000000000..63b6d6d113f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-comiss-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_comilt_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] < s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-3.c b/gcc/testsuite/gcc.target/i386/sse-comiss-3.c new file mode 100644 index 00000000000..75ac4e4faaf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-comiss-3.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_comile_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] <= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-4.c b/gcc/testsuite/gcc.target/i386/sse-comiss-4.c new file mode 100644 index 00000000000..ceeeca79472 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-comiss-4.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_comigt_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] > s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-5.c b/gcc/testsuite/gcc.target/i386/sse-comiss-5.c new file mode 100644 index 00000000000..8f503512ffa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-comiss-5.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_comige_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] >= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-comiss-6.c b/gcc/testsuite/gcc.target/i386/sse-comiss-6.c new file mode 100644 index 00000000000..38df9b8e47b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-comiss-6.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_comineq_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] != s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c new file mode 100644 index 00000000000..e5435b6b733 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-1.c @@ -0,0 +1,36 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 p, int b) +{ + return _mm_cvtsi32_ss (p, b); +} + +static void +TEST (void) +{ + union128 u, s1; + int b = 498; + float e[4] = { 24.43, 68.346, 43.35, 546.46 }; + + s1.x = _mm_set_ps (e[3], e[2], e[1], e[0]); + u.x = test (s1.x, b); + e[0] = (float)b; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c new file mode 100644 index 00000000000..aa74e11ec55 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-cvtsi2ss-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 p, long long b) +{ + return _mm_cvtsi64_ss (p, b); +} + +static void +TEST (void) +{ + union128 u, s1; + long long b = 4294967295133LL; + float e[4] = { 24.43, 68.346, 43.35, 546.46 }; + + s1.x = _mm_set_ps (e[3], e[2], e[1], e[0]); + u.x = test (s1.x, b); + e[0] = (float)b; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c new file mode 100644 index 00000000000..5740626659a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-1.c @@ -0,0 +1,36 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 p) +{ + return _mm_cvtss_si32 (p); +} + +static void +TEST (void) +{ + union128 s1; + int d; + int e; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + d = test (s1.x); + e = (int)s1.a[0]; + + if (e != d) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c new file mode 100644 index 00000000000..e136b7198a0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-cvtss2si-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static long long +__attribute__((noinline, unused)) +test (__m128 p) +{ + return _mm_cvtss_si64 (p); +} + +static void +TEST (void) +{ + union128 s1; + long long d; + long long e; + + s1.x = _mm_set_ps (344.4, 68.346, 43.35, 429496729501.4); + d = test (s1.x); + e = (long long)s1.a[0]; + + if (e != d) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c new file mode 100644 index 00000000000..8edc197eafd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-1.c @@ -0,0 +1,36 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 p) +{ + return _mm_cvttss_si32 (p); +} + +static void +TEST (void) +{ + union128 s1; + int d; + int e; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + d = test (s1.x); + e = (int)s1.a[0]; + + if (e != d) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c new file mode 100644 index 00000000000..94e831e782f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-cvttss2si-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static long long +__attribute__((noinline, unused)) +test (__m128 p) +{ + return _mm_cvttss_si64 (p); +} + +static void +TEST (void) +{ + union128 s1; + long long d; + long long e; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 429496729501.4); + d = test (s1.x); + e = (long long)s1.a[0]; + + if (e != d) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-divps-1.c b/gcc/testsuite/gcc.target/i386/sse-divps-1.c new file mode 100644 index 00000000000..d4d441aeb1f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-divps-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_div_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] / s2.a[0]; + e[1] = s1.a[1] / s2.a[1]; + e[2] = s1.a[2] / s2.a[2]; + e[3] = s1.a[3] / s2.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-divss-1.c b/gcc/testsuite/gcc.target/i386/sse-divss-1.c new file mode 100644 index 00000000000..e7449496e0a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-divss-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_div_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] / s2.a[0]; + e[1] = s1.a[1]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-maxps-1.c b/gcc/testsuite/gcc.target/i386/sse-maxps-1.c new file mode 100644 index 00000000000..5e6fcd654ef --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-maxps-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_max_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + int i; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] > s2.a[i] ? s1.a[i]:s2.a[i]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-maxss-1.c b/gcc/testsuite/gcc.target/i386/sse-maxss-1.c new file mode 100644 index 00000000000..5b5215a5772 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-maxss-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_max_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] > s2.a[0] ? s1.a[0]:s2.a[0]; + e[1] = s1.a[1]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-minps-1.c b/gcc/testsuite/gcc.target/i386/sse-minps-1.c new file mode 100644 index 00000000000..a41139f8b96 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-minps-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_min_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + int i; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] < s2.a[i] ? s1.a[i]:s2.a[i]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-minss-1.c b/gcc/testsuite/gcc.target/i386/sse-minss-1.c new file mode 100644 index 00000000000..9280b07052d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-minss-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_min_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] < s2.a[0] ? s1.a[0]:s2.a[0]; + e[1] = s1.a[1]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movaps-1.c b/gcc/testsuite/gcc.target/i386/sse-movaps-1.c new file mode 100644 index 00000000000..3677ac44288 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movaps-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (float *e) +{ + return _mm_load_ps (e); +} + +static void +TEST (void) +{ + union128 u; + float e[4] __attribute__ ((aligned (16))) = {2134.3343,1234.635654, 1.2234, 876.8976}; + + u.x = test (e); + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movaps-2.c b/gcc/testsuite/gcc.target/i386/sse-movaps-2.c new file mode 100644 index 00000000000..46b971a9d9c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movaps-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static void +__attribute__((noinline, unused)) +test (float *e, __m128 a) +{ + _mm_store_ps (e, a); +} + +static void +TEST (void) +{ + union128 u; + float e[4] __attribute__ ((aligned (16))) = {0.0}; + + u.x = _mm_set_ps (2134.3343,1234.635654, 1.414, 3.3421); + + test (e, u.x); + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movhlps-1.c b/gcc/testsuite/gcc.target/i386/sse-movhlps-1.c new file mode 100644 index 00000000000..7023bf95d1e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movhlps-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_movehl_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = test (s1.x, s2.x); + + e[0] = s2.a[2]; + e[1] = s2.a[3]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movhps-1.c b/gcc/testsuite/gcc.target/i386/sse-movhps-1.c new file mode 100644 index 00000000000..9f28927a881 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movhps-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 a, __m64 *p) +{ + return _mm_loadh_pi (a, p); +} + +static void +TEST (void) +{ + union128 u, s1; + float d[2] = {24.43, 68.346}; + float e[4] = {1.17, 2.16, 3.15, 4.14}; + + s1.x = _mm_set_ps (5.13, 6.12, 7.11, 8.9); + u.x = _mm_loadu_ps (e); + + u.x = test (s1.x, (__m64 *)d); + + e[0] = s1.a[0]; + e[1] = s1.a[1]; + e[2] = d[0]; + e[3] = d[1]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movhps-2.c b/gcc/testsuite/gcc.target/i386/sse-movhps-2.c new file mode 100644 index 00000000000..023937b6633 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movhps-2.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static void +__attribute__((noinline, unused)) +test (__m64 *p, __m128 a) +{ + return _mm_storeh_pi (p, a); +} + +static void +TEST (void) +{ + union128 s1; + float e[2]; + float d[2]; + + s1.x = _mm_set_ps (5.13, 6.12, 7.11, 8.9); + + test ((__m64 *)d, s1.x); + + e[0] = s1.a[2]; + e[1] = s1.a[3]; + + if (checkVf (d, e, 2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movlhps-1.c b/gcc/testsuite/gcc.target/i386/sse-movlhps-1.c new file mode 100644 index 00000000000..aba9a9aa413 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movlhps-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 a, __m128 b) +{ + return _mm_movelh_ps (a, b); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + u.x = _mm_set1_ps (0.0); + + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0]; + e[1] = s1.a[1]; + e[2] = s2.a[0]; + e[3] = s2.a[1]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movmskps-1.c b/gcc/testsuite/gcc.target/i386/sse-movmskps-1.c new file mode 100644 index 00000000000..f1f0d7ed5a4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movmskps-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 a) +{ + return _mm_movemask_ps (a); +} + +static void +TEST (void) +{ + union128 u; + float s[4] = {2134.3343,1234.635654, 1.2234, 876.8976}; + int d; + int e = 0; + int i; + + u.x = _mm_loadu_ps (s); + d = test (u.x); + + for (i = 0; i < 4; i++) + if (s[i] < 0) + e |= (1 << i); + + if (checkVi (&d, &e, 1)) + abort (); + +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movntps-1.c b/gcc/testsuite/gcc.target/i386/sse-movntps-1.c new file mode 100644 index 00000000000..8c45da31dde --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movntps-1.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static void +__attribute__((noinline, unused)) +test (float *p, __m128 s) +{ + return _mm_stream_ps (p, s); +} + +static void +TEST (void) +{ + union128 u; + float e[4] __attribute__ ((aligned(16))); + + u.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + test (e, u.x); + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movss-1.c b/gcc/testsuite/gcc.target/i386/sse-movss-1.c new file mode 100644 index 00000000000..eccdf5af907 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movss-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (float *e) +{ + return _mm_load_ss (e); +} + +static void +TEST (void) +{ + union128 u; + float e[4] = {1.1, 2.2, 3.3, 4.4}; + + u.x = _mm_set_ps (2134.3343,1234.635654, 1.2234, 876.8976); + + u.x = test (e); + + e[1] = u.a[1]; + e[2] = u.a[2]; + e[3] = u.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movss-2.c b/gcc/testsuite/gcc.target/i386/sse-movss-2.c new file mode 100644 index 00000000000..f64fa4db698 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movss-2.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static void +__attribute__((noinline, unused)) +test (float *e, __m128 a) +{ + return _mm_store_ss (e, a); +} + +static void +TEST (void) +{ + union128 u; + float d[1]; + float e[1]; + + u.x = _mm_set_ps (2134.3343,1234.635654, 1.2234, 876.8976); + + test (d, u.x); + + e[0] = u.a[0]; + + if (checkVf (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movss-3.c b/gcc/testsuite/gcc.target/i386/sse-movss-3.c new file mode 100644 index 00000000000..1212622b7ea --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movss-3.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 a, __m128 b) +{ + return _mm_move_ss (a, b); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (2134.3343,1234.635654, 1.2234, 876.8976); + s2.x = _mm_set_ps (1.1, 2.2, 3.3, 4.4); + u.x = _mm_set_ps (5.5, 6.6, 7.7, 8.8); + u.x = test (s1.x, s2.x); + + e[0] = s2.a[0]; + e[1] = s1.a[1]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movups-1.c b/gcc/testsuite/gcc.target/i386/sse-movups-1.c new file mode 100644 index 00000000000..222da79d940 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movups-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (float *e) +{ + return _mm_loadu_ps (e); +} + +static void +TEST (void) +{ + union128 u; + float e[4] = {2134.3343,1234.635654, 1.2234, 876.8976}; + + u.x = test (e); + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-movups-2.c b/gcc/testsuite/gcc.target/i386/sse-movups-2.c new file mode 100644 index 00000000000..41657239c32 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-movups-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static void +__attribute__((noinline, unused)) +test (float *e, __m128 a) +{ + _mm_storeu_ps (e, a); +} + +static void +TEST (void) +{ + union128 u; + float e[4] = {0.0}; + + u.x = _mm_set_ps (2134.3343,1234.635654, 1.414, 3.3421); + + test (e, u.x); + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-mulps-1.c b/gcc/testsuite/gcc.target/i386/sse-mulps-1.c new file mode 100644 index 00000000000..a07b5abf610 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-mulps-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_mul_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] * s2.a[0]; + e[1] = s1.a[1] * s2.a[1]; + e[2] = s1.a[2] * s2.a[2]; + e[3] = s1.a[3] * s2.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-mulss-1.c b/gcc/testsuite/gcc.target/i386/sse-mulss-1.c new file mode 100644 index 00000000000..7b45063508d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-mulss-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_mul_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] * s2.a[0]; + e[1] = s1.a[1]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-orps-1.c b/gcc/testsuite/gcc.target/i386/sse-orps-1.c new file mode 100644 index 00000000000..6c8dac5cc5c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-orps-1.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_or_ps (s1, s2); +} + +static void +TEST (void) +{ + union { + float f[4]; + int i[4]; + }source1, source2, e; + + union128 u, s1, s2; + int i; + + s1.x = _mm_set_ps (24.43, 168.346, 43.35, 546.46); + s2.x = _mm_set_ps (10.17, 2.16, 3.15, 4.14); + + _mm_storeu_ps (source1.f, s1.x); + _mm_storeu_ps (source2.f, s2.x); + + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e.i[i] = source1.i[i] | source2.i[i]; + + if (check_union128 (u, e.f)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-rcpps-1.c b/gcc/testsuite/gcc.target/i386/sse-rcpps-1.c new file mode 100644 index 00000000000..7a1a8fa7370 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-rcpps-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1) +{ + return _mm_rcp_ps (s1); +} + +static void +TEST (void) +{ + union128 u, s1; + float e[4]; + int i; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + u.x = test (s1.x); + + for (i = 0; i < 4; i++) + { + __m128 tmp = _mm_load_ss (&s1.a[i]); + tmp = _mm_rcp_ss (tmp); + _mm_store_ss (&e[i], tmp); + } + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c b/gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c new file mode 100644 index 00000000000..4052c21f010 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-rsqrtps-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1) +{ + return _mm_rsqrt_ps (s1); +} + +static void +TEST (void) +{ + union128 u, s1; + float e[4]; + int i; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + u.x = test (s1.x); + + for (i = 0; i < 4; i++) + { + __m128 tmp = _mm_load_ss (&s1.a[i]); + tmp = _mm_rsqrt_ss (tmp); + _mm_store_ss (&e[i], tmp); + } + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c b/gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c new file mode 100644 index 00000000000..9f0658d0e27 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-sqrtps-1.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1) +{ + return _mm_sqrt_ps (s1); +} + +static void +TEST (void) +{ + union128 u, s1; + float e[4]; + int i; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + u.x = test (s1.x); + + for (i = 0; i < 4; i++) { + __m128 tmp = _mm_load_ss (&s1.a[i]); + tmp = _mm_sqrt_ss (tmp); + _mm_store_ss (&e[i], tmp); + } + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-subps-1.c b/gcc/testsuite/gcc.target/i386/sse-subps-1.c new file mode 100644 index 00000000000..2e7e8d50231 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-subps-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_sub_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] - s2.a[0]; + e[1] = s1.a[1] - s2.a[1]; + e[2] = s1.a[2] - s2.a[2]; + e[3] = s1.a[3] - s2.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-subss-1.c b/gcc/testsuite/gcc.target/i386/sse-subss-1.c new file mode 100644 index 00000000000..5b3ef26bd9f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-subss-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_sub_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] - s2.a[0]; + e[1] = s1.a[1]; + e[2] = s1.a[2]; + e[3] = s1.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c new file mode 100644 index 00000000000..b38b1fd424a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-1.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_ucomieq_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] == s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c new file mode 100644 index 00000000000..e0212a4e3df --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_ucomilt_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] < s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c new file mode 100644 index 00000000000..dc728fb503b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-3.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_ucomile_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] <= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c new file mode 100644 index 00000000000..3251c0b8fb0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-4.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_ucomigt_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] > s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c new file mode 100644 index 00000000000..ad34f01d979 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-5.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_ucomige_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] >= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c b/gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c new file mode 100644 index 00000000000..b9b2f4b2892 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-ucomiss-6.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_ucomineq_ss (s1, s2); +} + +static void +TEST (void) +{ + union128 s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] != s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c b/gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c new file mode 100644 index 00000000000..be4ab3659cb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-unpckhps-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_unpackhi_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[2]; + e[1] = s2.a[2]; + e[2] = s1.a[3]; + e[3] = s2.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c b/gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c new file mode 100644 index 00000000000..5a5da2064a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-unpcklps-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_unpacklo_ps (s1, s2); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4]; + + s1.x = _mm_set_ps (41124.234,6678.346,8653.65635,856.43576); + s2.x = _mm_set_ps (2134.3343,6678.346,453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0]; + e[1] = s2.a[0]; + e[2] = s1.a[1]; + e[3] = s2.a[1]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-xorps-1.c b/gcc/testsuite/gcc.target/i386/sse-xorps-1.c new file mode 100644 index 00000000000..6f96e691064 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-xorps-1.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse" } */ + +#ifndef CHECK_H +#define CHECK_H "sse-check.h" +#endif + +#ifndef TEST +#define TEST sse_test +#endif + +#include CHECK_H + +#include <xmmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_xor_ps (s1, s2); +} + +static void +TEST (void) +{ + union { + float f[4]; + int i[4]; + }source1, source2, e; + + union128 u, s1, s2; + int i; + + s1.x = _mm_set_ps (24.43, 68.346, 43.35, 546.46); + s2.x = _mm_set_ps (1.17, 2.16, 3.15, 4.14); + + _mm_storeu_ps (source1.f, s1.x); + _mm_storeu_ps (source2.f, s2.x); + + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e.i[i] = source1.i[i] ^ source2.i[i]; + + if (check_union128 (u, e.f)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-addpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-addpd-1.c new file mode 100644 index 00000000000..2c1e81d857b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-addpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_add_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] + s2.a[0]; + e[1] = s1.a[1] + s2.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-addsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-addsd-1.c new file mode 100644 index 00000000000..d81b1bb929e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-addsd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_add_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] + s2.a[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-andnpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-andnpd-1.c new file mode 100644 index 00000000000..36b3c3194ab --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-andnpd-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_andnot_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + long long source1[2]={34545, 95567}; + long long source2[2]={674, 57897}; + long long e[2]; + + s1.x = _mm_loadu_pd ((double *)source1); + s2.x = _mm_loadu_pd ((double *)source2); + u.x = test (s1.x, s2.x); + + e[0] = (~source1[0]) & source2[0]; + e[1] = (~source1[1]) & source2[1]; + + if (check_union128d (u, (double *)e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-andpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-andpd-1.c new file mode 100644 index 00000000000..90902bfcd94 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-andpd-1.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_and_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + + union + { + double d[2]; + long long ll[2]; + }source1, source2, e; + + s1.x = _mm_set_pd (34545, 95567); + s2.x = _mm_set_pd (674, 57897); + + _mm_storeu_pd (source1.d, s1.x); + _mm_storeu_pd (source2.d, s2.x); + + u.x = test (s1.x, s2.x); + + e.ll[0] = source1.ll[0] & source2.ll[0]; + e.ll[1] = source1.ll[1] & source2.ll[1]; + + if (check_union128d (u, e.d)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-comisd-1.c b/gcc/testsuite/gcc.target/i386/sse2-comisd-1.c new file mode 100644 index 00000000000..e8478d9ad08 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-comisd-1.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_comieq_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,2344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] == s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-comisd-2.c b/gcc/testsuite/gcc.target/i386/sse2-comisd-2.c new file mode 100644 index 00000000000..f18cf1617f7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-comisd-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_comilt_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,2344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] < s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-comisd-3.c b/gcc/testsuite/gcc.target/i386/sse2-comisd-3.c new file mode 100644 index 00000000000..6bd88552766 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-comisd-3.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_comile_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,2344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] <= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-comisd-4.c b/gcc/testsuite/gcc.target/i386/sse2-comisd-4.c new file mode 100644 index 00000000000..cf377c490df --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-comisd-4.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_comigt_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,12344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] > s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-comisd-5.c b/gcc/testsuite/gcc.target/i386/sse2-comisd-5.c new file mode 100644 index 00000000000..dd2127bc3d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-comisd-5.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_comige_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,2344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] >= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-comisd-6.c b/gcc/testsuite/gcc.target/i386/sse2-comisd-6.c new file mode 100644 index 00000000000..13371172ace --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-comisd-6.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_comineq_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,2344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] != s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtdq2pd-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtdq2pd-1.c new file mode 100644 index 00000000000..5640e398f77 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtdq2pd-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128i p) +{ + return _mm_cvtepi32_pd (p); +} + +static void +TEST (void) +{ + union128d u; + union128i_d s; + double e[2]; + + s.x = _mm_set_epi32 (123, 321, 456, 987); + + u.x = test (s.x); + + e[0] = (double)s.a[0]; + e[1] = (double)s.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtdq2ps-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtdq2ps-1.c new file mode 100644 index 00000000000..a8839a4c537 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtdq2ps-1.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128i p) +{ + return _mm_cvtepi32_ps (p); +} + +static void +TEST (void) +{ + union128 u; + union128i_d s; + float e[4]; + + s.x = _mm_set_epi32 (123, 321, 456, 987); + + u.x = test (s.x); + + e[0] = (float)s.a[0]; + e[1] = (float)s.a[1]; + e[2] = (float)s.a[2]; + e[3] = (float)s.a[3]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtpd2dq-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtpd2dq-1.c new file mode 100644 index 00000000000..f25290c2e4e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtpd2dq-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_cvtpd_epi32 (p); +} + +static void +TEST (void) +{ + union128i_d u; + union128d s; + int e[4] = {0}; + + s.x = _mm_set_pd (2.78, 7777768.82); + + u.x = test (s.x); + + e[0] = (int)(s.a[0] + 0.5); + e[1] = (int)(s.a[1] + 0.5); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtpd2ps-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtpd2ps-1.c new file mode 100644 index 00000000000..365d5e70463 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtpd2ps-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128 +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_cvtpd_ps (p); +} + +static void +TEST (void) +{ + union128 u; + union128d s; + float e[4] = {0}; + + s.x = _mm_set_pd (123.321, 456.987); + + u.x = test (s.x); + + e[0] = (float)s.a[0]; + e[1] = (float)s.a[1]; + + if (check_union128 (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtps2dq-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtps2dq-1.c new file mode 100644 index 00000000000..68c2a996da8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtps2dq-1.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128 p) +{ + return _mm_cvtps_epi32 (p); +} + +static void +TEST (void) +{ + union128i_d u; + union128 s; + int e[4] = {0}; + + s.x = _mm_set_ps (2.78, 7777768.82, 2.331, 3.456); + + u.x = test (s.x); + + e[0] = (int)(s.a[0] + 0.5); + e[1] = (int)(s.a[1] + 0.5); + e[2] = (int)(s.a[2] + 0.5); + e[3] = (int)(s.a[3] + 0.5); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtps2pd-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtps2pd-1.c new file mode 100644 index 00000000000..16093ef4f0a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtps2pd-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128 p) +{ + return _mm_cvtps_pd (p); +} + +static void +TEST (void) +{ + union128d u; + union128 s; + double e[2]; + + s.x = _mm_set_ps (2.78, 7777768.82, 2.331, 3.456); + + u.x = test (s.x); + + e[0] = (double)s.a[0]; + e[1] = (double)s.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtsd2si-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtsd2si-1.c new file mode 100644 index 00000000000..75770eeb1b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtsd2si-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + + +static int +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_cvtsd_si32 (p); +} + +static void +TEST (void) +{ + union128d s; + int e; + int d; + + s.x = _mm_set_pd (123.321, 456.987); + + d = test (s.x); + + e = (int)(s.a[0] + 0.5); + + if (d != e) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtsd2si-2.c b/gcc/testsuite/gcc.target/i386/sse2-cvtsd2si-2.c new file mode 100644 index 00000000000..dfc543f19d1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtsd2si-2.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static long long +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_cvtsd_si64 (p); +} + +static void +TEST (void) +{ + union128d s; + long long e; + long long d; + + s.x = _mm_set_pd (829496729501.4, 429496729501.4); + + d = test (s.x); + + e = (long long)(s.a[0] + 0.5); + + if (d != e) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtsd2ss-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtsd2ss-1.c new file mode 100644 index 00000000000..ae0b2c353a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtsd2ss-1.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + + +static __m128 +__attribute__((noinline, unused)) +test (__m128 p1, __m128d p2) +{ + return _mm_cvtsd_ss (p1, p2); +} + +static void +TEST (void) +{ + union128d s1; + union128 u, s2; + double source1[2] = {123.345, 67.3321}; + float e[4] = {5633.098, 93.21, 3.34, 4555.2}; + + s1.x = _mm_loadu_pd (source1); + s2.x = _mm_loadu_ps (e); + + u.x = test(s2.x, s1.x); + + e[0] = (float)source1[0]; + + if (check_union128(u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtsi2sd-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtsi2sd-1.c new file mode 100644 index 00000000000..12ca895fc9f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtsi2sd-1.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d p, int b) +{ + return _mm_cvtsi32_sd (p, b); +} + +static void +TEST (void) +{ + union128d u, s; + int b = 128; + double e[2]; + + s.x = _mm_set_pd (123.321, 456.987); + + u.x = test (s.x, b); + e[0] = (double)b; + e[1] = s.a[1]; + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtsi2sd-2.c b/gcc/testsuite/gcc.target/i386/sse2-cvtsi2sd-2.c new file mode 100644 index 00000000000..29d6d86a6bf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtsi2sd-2.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d p, long long b) +{ + return _mm_cvtsi64_sd (p, b); +} + +static void +TEST (void) +{ + union128d u, s; + long long b = 42949672951333LL; + double e[2]; + + s.x = _mm_set_pd (123.321, 456.987); + + u.x = test (s.x, b); + e[0] = (double)b; + e[1] = s.a[1]; + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvtss2sd-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvtss2sd-1.c new file mode 100644 index 00000000000..e8172d38ec4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvtss2sd-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d a, __m128 b) +{ + return _mm_cvtss_sd (a, b); +} + +static void +TEST (void) +{ + union128d u, s1; + union128 s2; + double e[2]; + + s1.x = _mm_set_pd (123.321, 456.987); + s2.x = _mm_set_ps (123.321, 456.987, 666.45, 231.987); + + u.x = test (s1.x, s2.x); + + e[0] = (double)s2.a[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvttpd2dq-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvttpd2dq-1.c new file mode 100644 index 00000000000..93dd62493d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvttpd2dq-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_cvttpd_epi32 (p); +} + +static void +TEST (void) +{ + union128d s; + union128i_d u; + int e[4] = {0}; + + s.x = _mm_set_pd (123.321, 456.987); + + u.x = test (s.x); + + e[0] = (int)s.a[0]; + e[1] = (int)s.a[1]; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvttps2dq-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvttps2dq-1.c new file mode 100644 index 00000000000..1c963a10e5e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvttps2dq-1.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128 p) +{ + return _mm_cvttps_epi32 (p); +} + +static void +TEST (void) +{ + union128 s; + union128i_d u; + int e[4] = {0}; + + s.x = _mm_set_ps (123.321, 456.987, 33.56, 7765.321); + + u.x = test (s.x); + + e[0] = (int)s.a[0]; + e[1] = (int)s.a[1]; + e[2] = (int)s.a[2]; + e[3] = (int)s.a[3]; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvttsd2si-1.c b/gcc/testsuite/gcc.target/i386/sse2-cvttsd2si-1.c new file mode 100644 index 00000000000..a87ec1a1315 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvttsd2si-1.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_cvttsd_si32 (p); +} + +static void +TEST (void) +{ + union128d s; + int e; + int d; + + s.x = _mm_set_pd (123.321, 456.987); + + d = test (s.x); + e = (int)(s.a[0]); + + if (d != e) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-cvttsd2si-2.c b/gcc/testsuite/gcc.target/i386/sse2-cvttsd2si-2.c new file mode 100644 index 00000000000..ec0fe20eefe --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-cvttsd2si-2.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static long long +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_cvttsd_si64 (p); +} + +static void +TEST (void) +{ + union128d s; + long long e; + long long d; + + s.x = _mm_set_pd (123.321, 42949672339501.4); + + d = test (s.x); + e = (long long)(s.a[0]); + + if (d != e) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-divpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-divpd-1.c new file mode 100644 index 00000000000..cc4f9d11678 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-divpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_div_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] / s2.a[0]; + e[1] = s1.a[1] / s2.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-divsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-divsd-1.c new file mode 100644 index 00000000000..e8b9e8c4c87 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-divsd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_div_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] / s2.a[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c b/gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c new file mode 100644 index 00000000000..da36efa1d9d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse4 -march=core2" } */ + +#include <emmintrin.h> + +__m128i +test (long long b) +{ + return _mm_cvtsi64_si128 (b); +} + +/* { dg-final { scan-assembler "movq" } } */ diff --git a/gcc/testsuite/gcc.target/i386/sse2-maxpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-maxpd-1.c new file mode 100644 index 00000000000..3ca51a2c3c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-maxpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_max_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] > s2.a[0] ? s1.a[0]:s2.a[0]; + e[1] = s1.a[1] > s2.a[1] ? s1.a[1]:s2.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-maxsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-maxsd-1.c new file mode 100644 index 00000000000..e2c6829f2eb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-maxsd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_max_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] > s2.a[0] ? s1.a[0]:s2.a[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-minpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-minpd-1.c new file mode 100644 index 00000000000..9ec53e22c52 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-minpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_min_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] < s2.a[0] ? s1.a[0]:s2.a[0]; + e[1] = s1.a[1] < s2.a[1] ? s1.a[1]:s2.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-minsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-minsd-1.c new file mode 100644 index 00000000000..50dc124b451 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-minsd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_min_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] < s2.a[0] ? s1.a[0]:s2.a[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movapd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movapd-1.c new file mode 100644 index 00000000000..0a047dd93fd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movapd-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (double *e) +{ + return _mm_load_pd (e); +} + +static void +TEST (void) +{ + union128d u; + double e[2] __attribute__ ((aligned (8))) = {2134.3343,1234.635654}; + + u.x = test (e); + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movapd-2.c b/gcc/testsuite/gcc.target/i386/sse2-movapd-2.c new file mode 100644 index 00000000000..decfd22b5b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movapd-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (double *e, __m128d a) +{ + _mm_store_pd (e, a); +} + +static void +TEST (void) +{ + union128d u; + double e[2] __attribute__ ((aligned (8))) = {0.0}; + + u.x = _mm_set_pd (2134.3343,1234.635654); + + test (e, u.x); + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movd-1.c new file mode 100644 index 00000000000..2475bbc354b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movd-1.c @@ -0,0 +1,36 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (int b) +{ + return _mm_cvtsi32_si128 (b); +} + +static void +TEST (void) +{ + union128i_d u; + int b = 128; + int e[4] = {0}; + + u.x = test (b); + + e[0] = b; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movd-2.c b/gcc/testsuite/gcc.target/i386/sse2-movd-2.c new file mode 100644 index 00000000000..f986e6e2558 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movd-2.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128i b) +{ + return _mm_cvtsi128_si32 (b); +} + +static void +TEST (void) +{ + union128i_d u; + int e; + + u.x = _mm_set_epi32 (2134, -128, 655366, 9999); + e = test (u.x); + if (e != u.a[0]) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movdqa-1.c b/gcc/testsuite/gcc.target/i386/sse2-movdqa-1.c new file mode 100644 index 00000000000..cf95b629b50 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movdqa-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i *p) +{ + return _mm_load_si128 (p); +} + +static void +TEST (void) +{ + union128i_d u; + int e[4] __attribute__ ((aligned(16))) = {1, 2, 3, 4}; + + u.x = test ((__m128i *)e); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movdqa-2.c b/gcc/testsuite/gcc.target/i386/sse2-movdqa-2.c new file mode 100644 index 00000000000..7bf49dcffa9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movdqa-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (__m128i *p, __m128i a) +{ + return _mm_store_si128 (p, a); +} + +static void +TEST (void) +{ + union128i_d u; + int e[4] __attribute__ ((aligned(16))) = {0}; + + u.x = _mm_set_epi32 (1, 2, 3, 4); + + test ((__m128i *)e, u.x); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movdqu-1.c b/gcc/testsuite/gcc.target/i386/sse2-movdqu-1.c new file mode 100644 index 00000000000..c24e128f48c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movdqu-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i *p) +{ + return _mm_loadu_si128 (p); +} + +static void +TEST (void) +{ + union128i_d u; + int e[4] = {1, 2, 3, 4}; + + u.x = test ((__m128i *)e); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movdqu-2.c b/gcc/testsuite/gcc.target/i386/sse2-movdqu-2.c new file mode 100644 index 00000000000..9ab0195e596 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movdqu-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (__m128i *p, __m128i a) +{ + return _mm_storeu_si128 (p, a); +} + +static void +TEST (void) +{ + union128i_d u; + int e[4] = {0}; + + u.x = _mm_set_epi32 (1, 2, 3, 4); + + test ((__m128i *)e, u.x); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movhpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movhpd-1.c new file mode 100644 index 00000000000..82e7671bc5c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movhpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mfpmath=sse -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, double *p) +{ + return _mm_loadh_pd (s1, p); +} + +static void +TEST (void) +{ + union128d u, s1; + double s2[2] = {41124.234,2344.2354}; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + u.x = test (s1.x, s2); + + e[0] = s1.a[0]; + e[1] = s2[0]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movhpd-2.c b/gcc/testsuite/gcc.target/i386/sse2-movhpd-2.c new file mode 100644 index 00000000000..335c89810b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movhpd-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mfpmath=sse -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (double *p, __m128d a) +{ + return _mm_storeh_pd (p, a); +} + +static void +TEST (void) +{ + union128d s; + double d[1]; + double e[1]; + + s.x = _mm_set_pd (2134.3343,1234.635654); + test (d, s.x); + + e[0] = s.a[1]; + + if (e[0] != d[0]) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movlpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movlpd-1.c new file mode 100644 index 00000000000..548f2e6254b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movlpd-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d a, double *e) +{ + return _mm_loadl_pd (a, e); +} + +static void +TEST (void) +{ + union128d u, s1; + double d[2] = {2134.3343,1234.635654}; + double e[2]; + + s1.x = _mm_set_pd (41124.234,2344.2354); + u.x = _mm_loadu_pd (d); + + u.x = test (s1.x, d); + + e[0] = d[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movlpd-2.c b/gcc/testsuite/gcc.target/i386/sse2-movlpd-2.c new file mode 100644 index 00000000000..d63aedf0614 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movlpd-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (double *e, __m128d a) +{ + return _mm_storel_pd (e, a); +} + +static void +TEST (void) +{ + union128d u; + double e[2]; + + u.x = _mm_set_pd (41124.234,2344.2354); + + test (e, u.x); + + e[1] = u.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movmskpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movmskpd-1.c new file mode 100644 index 00000000000..cef6f8d72af --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movmskpd-1.c @@ -0,0 +1,44 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d p) +{ + return _mm_movemask_pd (p); +} + +static void +TEST (void) +{ + double source[2] = {1.234, -2234.23}; + union128d s1; + int d; + int e; + + s1.x = _mm_loadu_pd (source); + + d = test (s1.x); + + e = 0; + if (source[0] < 0) + e |= 1; + + if (source[1] < 0) + e |= 1 << 1; + + if (checkVi (&d, &e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movntdq-1.c b/gcc/testsuite/gcc.target/i386/sse2-movntdq-1.c new file mode 100644 index 00000000000..b219e29a988 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movntdq-1.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (__m128i *p, __m128i s) +{ + return _mm_stream_si128 (p, s); +} + +static void +TEST (void) +{ + union128i_d u; + int e[4] __attribute__ ((aligned(32))); + + u.x = _mm_set_epi32 (21, 34, 334, 8567); + + test ((__m128i *)e, u.x); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movntpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movntpd-1.c new file mode 100644 index 00000000000..7f5274efa45 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movntpd-1.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (double *p, __m128d s) +{ + return _mm_stream_pd (p, s); +} + +static void +TEST (void) +{ + union128d u; + double e[2] __attribute__ ((aligned(32))); + + u.x = _mm_set_pd (2134.3343,1234.635654); + test (e, u.x); + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movq-1.c b/gcc/testsuite/gcc.target/i386/sse2-movq-1.c new file mode 100644 index 00000000000..9d22df95744 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movq-1.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i b) +{ + return _mm_move_epi64 (b); +} + +static void +TEST (void) +{ + union128i_q u, s1; + long long e[2] = {0}; + + s1.x = _mm_set_epi64x(12876, 3376590); + u.x = test (s1.x); + e[0] = s1.a[0]; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movq-2.c b/gcc/testsuite/gcc.target/i386/sse2-movq-2.c new file mode 100644 index 00000000000..1b4c02a9c98 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movq-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (long long b) +{ + return _mm_cvtsi64_si128 (b); +} + +static void +TEST (void) +{ + union128i_q u; + long long b = 4294967295133LL; + long long e[2] = {0}; + + u.x = test (b); + + e[0] = b; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movq-3.c b/gcc/testsuite/gcc.target/i386/sse2-movq-3.c new file mode 100644 index 00000000000..3538bd3ad47 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movq-3.c @@ -0,0 +1,34 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static long long +__attribute__((noinline, unused)) +test (__m128i b) +{ + return _mm_cvtsi128_si64 (b); +} + +static void +TEST (void) +{ + union128i_q u; + long long e; + + u.x = _mm_set_epi64x (4294967295133LL, 3844294967295133LL); + e = test (u.x); + if (e != u.a[0]) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movsd-1.c new file mode 100644 index 00000000000..98f9987cfd0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movsd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (double *p) +{ + return _mm_load_sd (p); +} + +static void +TEST (void) +{ + union128d u; + double d[2] = {128.023, 3345.1234}; + double e[2]; + + u.x = _mm_loadu_pd (e); + u.x = test (d); + + e[0] = d[0]; + e[1] = 0.0; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movsd-2.c b/gcc/testsuite/gcc.target/i386/sse2-movsd-2.c new file mode 100644 index 00000000000..e6e83d10b91 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movsd-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (double *p, __m128d a) +{ + _mm_store_sd (p, a); +} + +static void +TEST (void) +{ + union128d u; + double d[1]; + double e[1]; + + u.x = _mm_set_pd (128.023, 3345.1234); + test (d, u.x); + + e[0] = u.a[0]; + + if (checkVd (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movupd-1.c b/gcc/testsuite/gcc.target/i386/sse2-movupd-1.c new file mode 100644 index 00000000000..f9bf5851f21 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movupd-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (double *e) +{ + return _mm_loadu_pd (e); +} + +static void +TEST (void) +{ + union128d u; + double e[2] = {2134.3343,1234.635654}; + + u.x = test (e); + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-movupd-2.c b/gcc/testsuite/gcc.target/i386/sse2-movupd-2.c new file mode 100644 index 00000000000..b5c59b8c524 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-movupd-2.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static void +__attribute__((noinline, unused)) +test (double *e, __m128d a) +{ + _mm_storeu_pd (e, a); +} + +static void +TEST (void) +{ + union128d u; + double e[2] = {0.0}; + + u.x = _mm_set_pd (2134.3343,1234.635654); + + test (e, u.x); + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-mulpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-mulpd-1.c new file mode 100644 index 00000000000..c87e9e20de6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-mulpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_mul_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] * s2.a[0]; + e[1] = s1.a[1] * s2.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-mulsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-mulsd-1.c new file mode 100644 index 00000000000..1b665733e81 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-mulsd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_mul_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] * s2.a[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-orpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-orpd-1.c new file mode 100644 index 00000000000..4eaa70a76e0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-orpd-1.c @@ -0,0 +1,47 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_or_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + + union + { + double d[2]; + long long ll[2]; + }d1, d2, e; + + s1.x = _mm_set_pd (1234, 44386); + s2.x = _mm_set_pd (5198, 23098); + + _mm_storeu_pd (d1.d, s1.x); + _mm_storeu_pd (d2.d, s2.x); + + u.x = test (s1.x, s2.x); + + e.ll[0] = d1.ll[0] | d2.ll[0]; + e.ll[1] = d1.ll[1] | d2.ll[1]; + + if (check_union128d (u, e.d)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-packssdw-1.c b/gcc/testsuite/gcc.target/i386/sse2-packssdw-1.c new file mode 100644 index 00000000000..a6103261dc4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-packssdw-1.c @@ -0,0 +1,57 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_packs_epi32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d s1, s2; + union128i_w u; + short e[8]; + int i; + + s1.x = _mm_set_epi32 (2134, -128, 655366, 9999); + s2.x = _mm_set_epi32 (41124, 234, 2, -800900); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + { + if (s1.a[i] > 32767) + e[i] = 32767; + else if (s1.a[i] < -32768) + e[i] = -32768; + else + e[i] = s1.a[i]; + } + + for (i = 0; i < 4; i++) + { + if (s2.a[i] > 32767) + e[i+4] = 32767; + else if (s2.a[i] < -32768) + e[i+4] = -32768; + else + e[i+4] = s2.a[i]; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-packsswb-1.c b/gcc/testsuite/gcc.target/i386/sse2-packsswb-1.c new file mode 100644 index 00000000000..76532fb32ea --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-packsswb-1.c @@ -0,0 +1,57 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_packs_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w s1, s2; + union128i_b u; + char e[16]; + int i; + + s1.x = _mm_set_epi16 (2134, -128, 1234, 6354, 1002, 3004, 4050, 9999); + s2.x = _mm_set_epi16 (41124, 234, 2344, 2354, 607, 1, 2, -8009); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + if (s1.a[i] > 127) + e[i] = 127; + else if (s1.a[i] < -128) + e[i] = -128; + else + e[i] = s1.a[i]; + } + + for (i = 0; i < 8; i++) + { + if (s2.a[i] > 127) + e[i+8] = 127; + else if (s2.a[i] < -128) + e[i+8] = -128; + else + e[i+8] = s2.a[i]; + } + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-packuswb-1.c b/gcc/testsuite/gcc.target/i386/sse2-packuswb-1.c new file mode 100644 index 00000000000..d176ac0a692 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-packuswb-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_packus_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w s1, s2; + union128i_ub u; + unsigned char e[16]; + int i, tmp; + + s1.x = _mm_set_epi16 (1, 2, 3, 4, -5, -6, -7, -8); + s2.x = _mm_set_epi16 (-9, -10, -11, -12, 13, 14, 15, 16); + u.x = test (s1.x, s2.x); + + for (i=0; i<8; i++) + { + tmp = s1.a[i]<0 ? 0 : s1.a[i]; + tmp = tmp>255 ? 255 : tmp; + e[i] = tmp; + + tmp = s2.a[i]<0 ? 0 : s2.a[i]; + tmp = tmp>255 ? 255 : tmp; + e[i+8] = tmp; + } + + if (check_union128i_ub (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddb-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddb-1.c new file mode 100644 index 00000000000..d9414ca07be --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddb-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_add_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = s1.a[i] + s2.a[i]; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddd-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddd-1.c new file mode 100644 index 00000000000..c2d9b048a94 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddd-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_add_epi32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d u, s1, s2; + int e[4]; + int i; + + s1.x = _mm_set_epi32 (30,90,-80,-40); + s2.x = _mm_set_epi32 (76, -100, -34, -78); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] + s2.a[i]; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddq-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddq-1.c new file mode 100644 index 00000000000..4867cb42e2d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddq-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_add_epi64 (s1, s2); +} + +static void +TEST (void) +{ + union128i_q u, s1, s2; + long long e[2]; + int i; + + s1.x = _mm_set_epi64x (90,-80); + s2.x = _mm_set_epi64x (76, -100); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 2; i++) + e[i] = s1.a[i] + s2.a[i]; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddsb-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddsb-1.c new file mode 100644 index 00000000000..bb3bafcf502 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddsb-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_adds_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i, tmp; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + { + tmp = s1.a[i] + s2.a[i]; + + if (tmp > 127) + tmp = 127; + if (tmp < -128) + tmp = -128; + + e[i] = tmp; + } + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddsw-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddsw-1.c new file mode 100644 index 00000000000..885ed26098d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddsw-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_adds_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i, tmp; + + s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15); + s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + tmp = s1.a[i] + s2.a[i]; + + if (tmp > 32767) + tmp = 32767; + if (tmp < -32768) + tmp = -32768; + + e[i] = tmp; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddusb-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddusb-1.c new file mode 100644 index 00000000000..ee1f038694a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddusb-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_adds_epu8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16] = {0}; + int i, tmp; + + s1.x = _mm_set_epi8 (30, 2, 3, 4, 10, 20, 30, 90, 80, 40, 100, 15, 98, 25, 98, 7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, 100, 34, 78, 39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + { + tmp = s1.a[i] + s2.a[i]; + + if (tmp > 255) + tmp = -1; + if (tmp < 0) + tmp = 0; + + e[i] = tmp; + } + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddusw-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddusw-1.c new file mode 100644 index 00000000000..449d141566e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddusw-1.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_adds_epu16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i, tmp; + + s1.x = _mm_set_epi16 (10,20,30,90,80,40,100,15); + s2.x = _mm_set_epi16 (11, 98, 76, 100, 34, 78, 39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + tmp = s1.a[i] + s2.a[i]; + + if (tmp > 65535) + tmp = -1; + + if (tmp < 0) + tmp = 0; + + e[i] = tmp; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-paddw-1.c b/gcc/testsuite/gcc.target/i386/sse2-paddw-1.c new file mode 100644 index 00000000000..db1664fbe7a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-paddw-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_add_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15); + s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] + s2.a[i]; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pand-1.c b/gcc/testsuite/gcc.target/i386/sse2-pand-1.c new file mode 100644 index 00000000000..cab3c1fc945 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pand-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_and_si128 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = s1.a[i] & s2.a[i]; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pandn-1.c b/gcc/testsuite/gcc.target/i386/sse2-pandn-1.c new file mode 100644 index 00000000000..5a300c19877 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pandn-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_andnot_si128 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = (~s1.a[i]) & s2.a[i]; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pavgb-1.c b/gcc/testsuite/gcc.target/i386/sse2-pavgb-1.c new file mode 100644 index 00000000000..cb80431c510 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pavgb-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_avg_epu8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_ub u, s1, s2; + unsigned char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,80,40,100,15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, 100, 34, 78, 39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = (s1.a[i] + s2.a[i]+1)>>1; + + if (check_union128i_ub (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pavgw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pavgw-1.c new file mode 100644 index 00000000000..341e5afacc3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pavgw-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_avg_epu16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_uw u, s1, s2; + unsigned short e[8]; + int i; + + s1.x = _mm_set_epi16 (10,20,30,90,80,40,100,15); + s2.x = _mm_set_epi16 (11, 98, 76, 100, 34, 78, 39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = (s1.a[i] + s2.a[i]+1)>>1; + + if (check_union128i_uw (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pcmpeqb-1.c b/gcc/testsuite/gcc.target/i386/sse2-pcmpeqb-1.c new file mode 100644 index 00000000000..240fa0dc1b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pcmpeqb-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_cmpeq_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,80,40,100,15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, 100, 34, 78, 39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = (s1.a[i] == s2.a[i]) ? -1:0; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pcmpeqd-1.c b/gcc/testsuite/gcc.target/i386/sse2-pcmpeqd-1.c new file mode 100644 index 00000000000..cb18d111984 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pcmpeqd-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_cmpeq_epi32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d u, s1, s2; + int e[4]; + int i; + + s1.x = _mm_set_epi32 (98, 25, 98,7); + s2.x = _mm_set_epi32 (88, 44, 33, 229); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = (s1.a[i] == s2.a[i]) ? -1:0; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pcmpeqw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pcmpeqw-1.c new file mode 100644 index 00000000000..e87e9b113ca --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pcmpeqw-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_cmpeq_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (20,30,90,80,40,100,15,98); + s2.x = _mm_set_epi16 (34, 78, 39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = (s1.a[i] == s2.a[i]) ? -1:0; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pcmpgtb-1.c b/gcc/testsuite/gcc.target/i386/sse2-pcmpgtb-1.c new file mode 100644 index 00000000000..916ec3c3333 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pcmpgtb-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_cmpgt_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,80,40,100,15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, 100, 34, 78, 39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = (s1.a[i] > s2.a[i]) ? -1:0; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pcmpgtd-1.c b/gcc/testsuite/gcc.target/i386/sse2-pcmpgtd-1.c new file mode 100644 index 00000000000..bba5eae01a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pcmpgtd-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_cmpgt_epi32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d u, s1, s2; + int e[4]; + int i; + + s1.x = _mm_set_epi32 (98, 25, 98,7); + s2.x = _mm_set_epi32 (88, 44, 33, 229); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = (s1.a[i] > s2.a[i]) ? -1:0; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pcmpgtw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pcmpgtw-1.c new file mode 100644 index 00000000000..bfa58a9b775 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pcmpgtw-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_cmpgt_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (20,30,90,80,40,100,15,98); + s2.x = _mm_set_epi16 (34, 78, 39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = (s1.a[i] > s2.a[i]) ? -1:0; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmaddwd-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmaddwd-1.c new file mode 100644 index 00000000000..df1907a34e9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmaddwd-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_madd_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w s1, s2; + union128i_d u; + int e[4]; + int i; + + s1.x = _mm_set_epi16 (2134,3343,1234,6354, 1, 3, 4, 5); + s2.x = _mm_set_epi16 (41124,234,2344,2354,9, -1, -8, -10); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = (s1.a[i*2] * s2.a[i*2])+(s1.a[(i*2) + 1] * s2.a[(i*2) + 1]); + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmaxsw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmaxsw-1.c new file mode 100644 index 00000000000..b07fcb6b916 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmaxsw-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_max_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (1,2,3,4,5,6,7,8); + s2.x = _mm_set_epi16 (8,7,6,5,4,3,2,1); + u.x = test (s1.x, s2.x); + + for (i=0; i<8; i++) + e[i] = s1.a[i]>s2.a[i]?s1.a[i]:s2.a[i]; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmaxub-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmaxub-1.c new file mode 100644 index 00000000000..e5eafc13226 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmaxub-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_max_epu8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_ub u, s1, s2; + unsigned char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); + s2.x = _mm_set_epi8 (16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1); + u.x = test (s1.x, s2.x); + + for (i=0; i<16; i++) + e[i] = s1.a[i]>s2.a[i]?s1.a[i]:s2.a[i]; + + if (check_union128i_ub (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pminsw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pminsw-1.c new file mode 100644 index 00000000000..ad26ca95771 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pminsw-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_min_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (1,2,3,4,5,6,7,8); + s2.x = _mm_set_epi16 (8,7,6,5,4,3,2,1); + u.x = test (s1.x, s2.x); + + for (i=0; i<8; i++) + e[i] = s1.a[i]<s2.a[i]?s1.a[i]:s2.a[i]; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pminub-1.c b/gcc/testsuite/gcc.target/i386/sse2-pminub-1.c new file mode 100644 index 00000000000..953f8dd8a8a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pminub-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_min_epu8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_ub u, s1, s2; + unsigned char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); + s2.x = _mm_set_epi8 (16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1); + u.x = test (s1.x, s2.x); + + for (i=0; i<16; i++) + e[i] = s1.a[i]<s2.a[i]?s1.a[i]:s2.a[i]; + + if (check_union128i_ub (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmovmskb-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmovmskb-1.c new file mode 100644 index 00000000000..f1f5ff7568e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmovmskb-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_movemask_epi8 (s1); +} + +static void +TEST (void) +{ + union128i_b s1; + int i, u, e=0; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + u = test (s1.x); + + for (i = 0; i < 16; i++) + if (s1.a[i] & (1<<7)) + e = e | (1<<i); + + if (checkVi (&u, &e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmulhuw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmulhuw-1.c new file mode 100644 index 00000000000..fd6a3d24514 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmulhuw-1.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_mulhi_epu16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_uw u, s1, s2; + unsigned short e[8]; + int i, tmp; + + s1.x = _mm_set_epi16 (10,2067,3033,90,80,40,1000,15); + s2.x = _mm_set_epi16 (11, 9834, 7444, 10222, 34, 7833, 39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + tmp = s1.a[i] * s2.a[i]; + + e[i] = (tmp & 0xffff0000)>>16; + } + + if (check_union128i_uw (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmulhw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmulhw-1.c new file mode 100644 index 00000000000..447b5ca295f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmulhw-1.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_mulhi_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i, tmp; + + s1.x = _mm_set_epi16 (10,2067,-3033,90,80,40,-1000,15); + s2.x = _mm_set_epi16 (11, 9834, 7444, -10222, 34, -7833, 39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + tmp = s1.a[i] * s2.a[i]; + + e[i] = (tmp & 0xffff0000)>>16; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmullw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmullw-1.c new file mode 100644 index 00000000000..a68d0659dd3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmullw-1.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_mullo_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i, tmp; + + s1.x = _mm_set_epi16 (10,2067,-3033,90,80,40,-1000,15); + s2.x = _mm_set_epi16 (11, 9834, 7444, -10222, 34, -7833, 39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + tmp = s1.a[i] * s2.a[i]; + + e[i] = tmp; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pmuludq-1.c b/gcc/testsuite/gcc.target/i386/sse2-pmuludq-1.c new file mode 100644 index 00000000000..dac14ef5ce5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pmuludq-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_mul_epu32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d s1, s2; + union128i_q u; + long long e[2]; + + s1.x = _mm_set_epi32 (10,2067,3033,905); + s2.x = _mm_set_epi32 (11, 9834, 7444, 10222); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] * s2.a[0]; + e[1] = s1.a[2] * s2.a[2]; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-por-1.c b/gcc/testsuite/gcc.target/i386/sse2-por-1.c new file mode 100644 index 00000000000..7c332ed9ce1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-por-1.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_or_si128 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15); + s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + e[i] = s1.a[i] | s2.a[i]; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psadbw-1.c b/gcc/testsuite/gcc.target/i386/sse2-psadbw-1.c new file mode 100644 index 00000000000..c5fa0b22605 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psadbw-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_sad_epu8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_ub s1, s2; + union128i_w u; + short e[8] = {0}; + unsigned char tmp[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); + s2.x = _mm_set_epi8 (16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + tmp [i] = __builtin_abs (s1.a[i] - s2.a[i]); + + for (i = 0; i < 8; i++) + e[0] += tmp[i]; + + for (i = 8; i < 16; i++) + e[4] += tmp[i]; + + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pshufd-1.c b/gcc/testsuite/gcc.target/i386/sse2-pshufd-1.c new file mode 100644 index 00000000000..b106283aa25 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pshufd-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xec + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_shuffle_epi32 (s1, N); +} + +static void +TEST (void) +{ + union128i_d u, s1; + int e[4] = {0}; + int i; + + s1.x = _mm_set_epi32 (16,15,14,13); + u.x = test (s1.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[((N & (0x3<<(2*i)))>>(2*i))]; + + if (check_union128i_d(u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pshufhw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pshufhw-1.c new file mode 100644 index 00000000000..4eec55d04aa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pshufhw-1.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xec + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_shufflehi_epi16 (s1, N); +} + +static void +TEST (void) +{ + union128i_q s1; + union128i_w u; + short e[8] = {0}; + int i; + int m1[4] = {0x3, 0x3<<2, 0x3<<4, 0x3<<6}; + int m2[4]; + + s1.x = _mm_set_epi64x (0xabcde,0xef58a234); + u.x = test (s1.x); + + for (i = 0; i < 4; i++) + e[i] = (s1.a[0]>>(16 * i)) & 0xffff; + + for (i = 0; i < 4; i++) + m2[i] = (N & m1[i])>>(2*i); + + for (i = 0; i < 4; i++) + e[i+4] = (s1.a[1] >> (16 * m2[i])) & 0xffff; + + if (check_union128i_w(u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pshuflw-1.c b/gcc/testsuite/gcc.target/i386/sse2-pshuflw-1.c new file mode 100644 index 00000000000..37496251c55 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pshuflw-1.c @@ -0,0 +1,49 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xec + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_shufflelo_epi16 (s1, N); +} + +static void +TEST (void) +{ + union128i_q s1; + union128i_w u; + short e[8] = {0}; + int i; + int m1[4] = {0x3, 0x3<<2, 0x3<<4, 0x3<<6}; + int m2[4]; + + s1.x = _mm_set_epi64x (0xabcde,0xef58a234); + u.x = test (s1.x); + + for (i = 0; i < 4; i++) + e[i+4] = (s1.a[1]>>(16 * i)) & 0xffff; + + for (i = 0; i < 4; i++) + m2[i] = (N & m1[i])>>(2*i); + + for (i = 0; i < 4; i++) + e[i] = (s1.a[0] >> (16 * m2[i])) & 0xffff; + + if (check_union128i_w(u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pslld-1.c b/gcc/testsuite/gcc.target/i386/sse2-pslld-1.c new file mode 100644 index 00000000000..4fbde24a5b5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pslld-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xf + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_slli_epi32 (s1, N); +} + +static void +TEST (void) +{ + union128i_d u, s; + int e[4] = {0}; + int i; + + s.x = _mm_set_epi32 (1, -2, 3, 4); + + u.x = test (s.x); + + if (N < 32) + for (i = 0; i < 4; i++) + e[i] = s.a[i] << N; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pslld-2.c b/gcc/testsuite/gcc.target/i386/sse2-pslld-2.c new file mode 100644 index 00000000000..adef576e15d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pslld-2.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i c) +{ + return _mm_sll_epi32 (s1, c); +} + +static void +TEST (void) +{ + union128i_d u, s; + union128i_q c; + int e[4] = {0}; + int i; + + s.x = _mm_set_epi32 (2, -3, 0x7000, 0x9000); + c.x = _mm_set_epi64x (12, 23); + + u.x = test (s.x, c.x); + + if (c.a[0] < 32) + for (i = 0; i < 4; i++) + e[i] = s.a[i] << c.a[0]; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pslldq-1.c b/gcc/testsuite/gcc.target/i386/sse2-pslldq-1.c new file mode 100644 index 00000000000..3189106a448 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pslldq-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0x5 + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_slli_si128 (s1, N); +} + +static void +TEST (void) +{ + union128i_b u, s; + char src[16] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; + char e[16] = {0}; + int i; + + s.x = _mm_loadu_si128 ((__m128i *)src); + + u.x = test (s.x); + + for (i = 0; i < 16-N; i++) + e[i+N] = src[i]; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psllq-1.c b/gcc/testsuite/gcc.target/i386/sse2-psllq-1.c new file mode 100644 index 00000000000..cd916ebf3ea --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psllq-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 60 + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_slli_epi64 (s1, N); +} + +static void +TEST (void) +{ + union128i_q u, s; + long long e[2] = {0}; + int i; + + s.x = _mm_set_epi64x (-1, 0xf); + + u.x = test (s.x); + + if (N < 64) + for (i = 0; i < 2; i++) + e[i] = s.a[i] << N; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psllq-2.c b/gcc/testsuite/gcc.target/i386/sse2-psllq-2.c new file mode 100644 index 00000000000..b20e872ffe1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psllq-2.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i c) +{ + return _mm_sll_epi64 (s1, c); +} + +static void +TEST (void) +{ + union128i_q u, s, c; + long long e[2] = {0}; + int i; + + s.x = _mm_set_epi64x (-1, 0xf); + c.x = _mm_set_epi64x (60,50); + + u.x = test (s.x, c.x); + + if (c.a[0] < 64) + for (i = 0; i < 2; i++) + e[i] = s.a[i] << c.a[0]; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psllw-1.c b/gcc/testsuite/gcc.target/i386/sse2-psllw-1.c new file mode 100644 index 00000000000..1fc5aa406af --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psllw-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xb + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_slli_epi16 (s1, N); +} + +static void +TEST (void) +{ + union128i_w u, s; + short e[8] = {0}; + int i; + + s.x = _mm_set_epi16 (1, 2, 3, 4, 5, 6, 0x7000, 0x9000); + + u.x = test (s.x); + + if (N < 16) + for (i = 0; i < 8; i++) + e[i] = s.a[i] << N; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psllw-2.c b/gcc/testsuite/gcc.target/i386/sse2-psllw-2.c new file mode 100644 index 00000000000..22a54b6a95f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psllw-2.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i c) +{ + return _mm_sll_epi16 (s1, c); +} + +static void +TEST (void) +{ + union128i_w u, s; + union128i_q c; + short e[8] = {0}; + int i; + + s.x = _mm_set_epi16 (1, 2, 3, 4, 5, 6, 0x7000, 0x9000); + c.x = _mm_set_epi64x (12, 13); + + u.x = test (s.x, c.x); + + if (c.a[0] < 16) + for (i = 0; i < 8; i++) + e[i] = s.a[i] << c.a[0]; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrad-1.c b/gcc/testsuite/gcc.target/i386/sse2-psrad-1.c new file mode 100644 index 00000000000..37091ba8413 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrad-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xf + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_srai_epi32 (s1, N); +} + +static void +TEST (void) +{ + union128i_d u, s; + int e[4] = {0}; + int i; + + s.x = _mm_set_epi32 (1, -2, 3, 4); + + u.x = test (s.x); + + if (N < 32) + for (i = 0; i < 4; i++) + e[i] = s.a[i] >> N; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrad-2.c b/gcc/testsuite/gcc.target/i386/sse2-psrad-2.c new file mode 100644 index 00000000000..dc24a0f27d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrad-2.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i count) +{ + return _mm_sra_epi32 (s1, count); +} + +static void +TEST (void) +{ + union128i_d u, s; + union128i_q c; + int e[4] = {0}; + int i; + + s.x = _mm_set_epi32 (1, -2, 3, 4); + c.x = _mm_set_epi64x (16, 29); + + u.x = test (s.x, c.x); + + if (c.a[0] < 32) + for (i = 0; i < 4; i++) + e[i] = s.a[i] >> c.a[0]; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psraw-1.c b/gcc/testsuite/gcc.target/i386/sse2-psraw-1.c new file mode 100644 index 00000000000..3e0d88f1649 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psraw-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xb + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_srai_epi16 (s1, N); +} + +static void +TEST (void) +{ + union128i_w u, s; + short e[8] = {0}; + int i; + + s.x = _mm_set_epi16 (1, -2, 3, 4, -5, 6, 0x7000, 0x9000); + + u.x = test (s.x); + + if (N < 16) + for (i = 0; i < 8; i++) + e[i] = s.a[i] >> N; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psraw-2.c b/gcc/testsuite/gcc.target/i386/sse2-psraw-2.c new file mode 100644 index 00000000000..c3823ebee2d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psraw-2.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i c) +{ + return _mm_sra_epi16 (s1, c); +} + +static void +TEST (void) +{ + union128i_w u, s; + union128i_q c; + short e[8] = {0}; + int i; + + s.x = _mm_set_epi16 (1, -2, 3, 4, 5, 6, -0x7000, 0x9000); + c.x = _mm_set_epi64x (12, 13); + + u.x = test (s.x, c.x); + + if (c.a[0] < 16) + for (i = 0; i < 8; i++) + e[i] = s.a[i] >> c.a[0]; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrld-1.c b/gcc/testsuite/gcc.target/i386/sse2-psrld-1.c new file mode 100644 index 00000000000..0e5773167c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrld-1.c @@ -0,0 +1,45 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xf + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_srli_epi32 (s1, N); +} + +static void +TEST (void) +{ + union128i_d u, s; + int e[4] = {0}; + unsigned int tmp; + int i; + + s.x = _mm_set_epi32 (1, -2, 3, 4); + + u.x = test (s.x); + + if (N < 32) + for (i = 0; i < 4; i++) { + tmp = s.a[i]; + e[i] = tmp >> N; + } + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrld-2.c b/gcc/testsuite/gcc.target/i386/sse2-psrld-2.c new file mode 100644 index 00000000000..0270d927404 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrld-2.c @@ -0,0 +1,45 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i c) +{ + return _mm_srl_epi32 (s1, c); +} + +static void +TEST (void) +{ + union128i_d u, s; + union128i_q c; + int e[4] = {0}; + unsigned int tmp; + int i; + + s.x = _mm_set_epi32 (2, -3, 0x7000, 0x9000); + c.x = _mm_set_epi64x (12, 23); + + u.x = test (s.x, c.x); + + if (c.a[0] < 32) + for (i = 0; i < 4; i++) { + tmp = s.a[i]; + e[i] = tmp >> c.a[0]; + } + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrldq-1.c b/gcc/testsuite/gcc.target/i386/sse2-psrldq-1.c new file mode 100644 index 00000000000..75131916434 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrldq-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0x5 + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_srli_si128 (s1, N); +} + +static void +TEST (void) +{ + union128i_b u, s; + char src[16] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; + char e[16] = {0}; + int i; + + s.x = _mm_loadu_si128 ((__m128i *)src); + + u.x = test (s.x); + + for (i = 0; i < 16-N; i++) + e[i] = src[i+N]; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrlq-1.c b/gcc/testsuite/gcc.target/i386/sse2-psrlq-1.c new file mode 100644 index 00000000000..9c1ce5e873c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrlq-1.c @@ -0,0 +1,45 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 60 + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_srli_epi64 (s1, N); +} + +static void +TEST (void) +{ + union128i_q u, s; + long long e[2] = {0}; + unsigned long long tmp; + int i; + + s.x = _mm_set_epi64x (-1, 0xf); + + u.x = test (s.x); + + if (N < 64) + for (i = 0; i < 2; i++) { + tmp = s.a[i]; + e[i] = tmp >> N; + } + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrlq-2.c b/gcc/testsuite/gcc.target/i386/sse2-psrlq-2.c new file mode 100644 index 00000000000..8c6594079ae --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrlq-2.c @@ -0,0 +1,44 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i c) +{ + return _mm_srl_epi64 (s1, c); +} + +static void +TEST (void) +{ + union128i_q u, s, c; + long long e[2] = {0}; + unsigned long long tmp; + int i; + + s.x = _mm_set_epi64x (-1, 0xf); + c.x = _mm_set_epi64x (60,50); + + u.x = test (s.x, c.x); + + if (c.a[0] < 64) + for (i = 0; i < 2; i++){ + tmp = s.a[i]; + e[i] =tmp >> c.a[0]; + } + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrlw-1.c b/gcc/testsuite/gcc.target/i386/sse2-psrlw-1.c new file mode 100644 index 00000000000..e5375f735db --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrlw-1.c @@ -0,0 +1,46 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xb + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1) +{ + return _mm_srli_epi16 (s1, N); +} + +static void +TEST (void) +{ + union128i_w u, s; + short e[8] = {0}; + unsigned short tmp; + int i; + + s.x = _mm_set_epi16 (1, -2, 3, -4, 5, 6, 0x7000, 0x9000); + + u.x = test (s.x); + + if (N < 16) + for (i = 0; i < 8; i++) + { + tmp = s.a[i]; + e[i] = tmp >> N; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psrlw-2.c b/gcc/testsuite/gcc.target/i386/sse2-psrlw-2.c new file mode 100644 index 00000000000..dbe6a68e18f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psrlw-2.c @@ -0,0 +1,46 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i c) +{ + return _mm_srl_epi16 (s1, c); +} + +static void +TEST (void) +{ + union128i_w u, s; + union128i_q c; + short e[8] = {0}; + unsigned short tmp; + int i; + + s.x = _mm_set_epi16 (1, -2, 3, 4, 5, 6, -0x7000, 0x9000); + c.x = _mm_set_epi64x (12, 13); + + u.x = test (s.x, c.x); + + if (c.a[0] < 16) + for (i = 0; i < 8; i++) + { + tmp = s.a[i]; + e[i] = tmp >> c.a[0]; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psubb-1.c b/gcc/testsuite/gcc.target/i386/sse2-psubb-1.c new file mode 100644 index 00000000000..a8d5b67ddec --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psubb-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_sub_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = s1.a[i] - s2.a[i]; + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psubd-1.c b/gcc/testsuite/gcc.target/i386/sse2-psubd-1.c new file mode 100644 index 00000000000..296a261d3ab --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psubd-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_sub_epi32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d u, s1, s2; + int e[4]; + int i; + + s1.x = _mm_set_epi32 (30,90,-80,-40); + s2.x = _mm_set_epi32 (76, -100, -34, -78); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + e[i] = s1.a[i] - s2.a[i]; + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psubq-1.c b/gcc/testsuite/gcc.target/i386/sse2-psubq-1.c new file mode 100644 index 00000000000..fe8c0f43199 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psubq-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_sub_epi64 (s1, s2); +} + +static void +TEST (void) +{ + union128i_q u, s1, s2; + long long e[2]; + int i; + + s1.x = _mm_set_epi64x (90,-80); + s2.x = _mm_set_epi64x (76, -100); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 2; i++) + e[i] = s1.a[i] - s2.a[i]; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psubsb-1.c b/gcc/testsuite/gcc.target/i386/sse2-psubsb-1.c new file mode 100644 index 00000000000..d9cb1af5fac --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psubsb-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_subs_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i, tmp; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + { + tmp = s1.a[i] - s2.a[i]; + + if (tmp > 127) + tmp = 127; + if (tmp < -128) + tmp = -128; + + e[i] = tmp; + } + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psubsw-1.c b/gcc/testsuite/gcc.target/i386/sse2-psubsw-1.c new file mode 100644 index 00000000000..85fdbeb427e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psubsw-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_subs_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i, tmp; + + s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15); + s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + tmp = s1.a[i] - s2.a[i]; + + if (tmp > 32767) + tmp = 32767; + if (tmp < -32768) + tmp = -32768; + + e[i] = tmp; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-psubw-1.c b/gcc/testsuite/gcc.target/i386/sse2-psubw-1.c new file mode 100644 index 00000000000..e2d8be50c6b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-psubw-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_sub_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15); + s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + e[i] = s1.a[i] - s2.a[i]; + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpckhbw-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpckhbw-1.c new file mode 100644 index 00000000000..f673b0b9dbc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpckhbw-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpackhi_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + e[2*i] = s1.a[8+i]; + e[2*i + 1] = s2.a[8+i]; + } + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpckhdq-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpckhdq-1.c new file mode 100644 index 00000000000..7fcef77842c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpckhdq-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpackhi_epi32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d u, s1, s2; + int e[4]; + int i; + + s1.x = _mm_set_epi32 (10,20,-80,-40); + s2.x = _mm_set_epi32 (11, -34, -78, -39); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 2; i++) + { + e[2*i] = s1.a[2+i]; + e[2*i+1] = s2.a[2+i]; + } + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpckhqdq-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpckhqdq-1.c new file mode 100644 index 00000000000..4cb60d719ba --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpckhqdq-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpackhi_epi64 (s1, s2); +} + +static void +TEST (void) +{ + union128i_q u, s1, s2; + long long e[2]; + + s1.x = _mm_set_epi64x (10,-40); + s2.x = _mm_set_epi64x (1134, -7839); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[1]; + e[1] = s2.a[1]; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpckhwd-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpckhwd-1.c new file mode 100644 index 00000000000..1ba04e16223 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpckhwd-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpackhi_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15); + s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + { + e[2*i] = s1.a[4+i]; + e[2*i+1] = s2.a[4+i]; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpcklbw-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpcklbw-1.c new file mode 100644 index 00000000000..4e63885e3be --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpcklbw-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpacklo_epi8 (s1, s2); +} + +static void +TEST (void) +{ + union128i_b u, s1, s2; + char e[16]; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 8; i++) + { + e[2*i] = s1.a[i]; + e[2*i + 1] = s2.a[i]; + } + + if (check_union128i_b (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpckldq-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpckldq-1.c new file mode 100644 index 00000000000..1e7b44f1549 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpckldq-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpacklo_epi32 (s1, s2); +} + +static void +TEST (void) +{ + union128i_d u, s1, s2; + int e[4]; + int i; + + s1.x = _mm_set_epi32 (10,20,-80,-40); + s2.x = _mm_set_epi32 (11, -34, -78, -39); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 2; i++) + { + e[2*i] = s1.a[i]; + e[2*i+1] = s2.a[i]; + } + + if (check_union128i_d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpcklqdq-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpcklqdq-1.c new file mode 100644 index 00000000000..4f84ca10d1c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpcklqdq-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpacklo_epi64 (s1, s2); +} + +static void +TEST (void) +{ + union128i_q u, s1, s2; + long long e[2]; + + s1.x = _mm_set_epi64x (10,-40); + s2.x = _mm_set_epi64x (1134, -7839); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0]; + e[1] = s2.a[0]; + + if (check_union128i_q (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-punpcklwd-1.c b/gcc/testsuite/gcc.target/i386/sse2-punpcklwd-1.c new file mode 100644 index 00000000000..8ba26b3484a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-punpcklwd-1.c @@ -0,0 +1,42 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_unpacklo_epi16 (s1, s2); +} + +static void +TEST (void) +{ + union128i_w u, s1, s2; + short e[8]; + int i; + + s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15); + s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 4; i++) + { + e[2*i] = s1.a[i]; + e[2*i+1] = s2.a[i]; + } + + if (check_union128i_w (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-pxor-1.c b/gcc/testsuite/gcc.target/i386/sse2-pxor-1.c new file mode 100644 index 00000000000..7e06440a10a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pxor-1.c @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128i +__attribute__((noinline, unused)) +test (__m128i s1, __m128i s2) +{ + return _mm_xor_si128 (s1, s2); +} + +static void +TEST (void) +{ + union128i_ub u, s1, s2; + unsigned char e[16] = {0}; + int i; + + s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,80,40,100,15,98, 25, 98,7); + s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, 100, 34, 78, 39, 6, 3, 4, 5, 119); + u.x = test (s1.x, s2.x); + + for (i = 0; i < 16; i++) + e[i] = s1.a[i] ^ s2.a[i]; + + if (check_union128i_ub (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-shufpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-shufpd-1.c new file mode 100644 index 00000000000..cffa4695c84 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-shufpd-1.c @@ -0,0 +1,40 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define N 0xab + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_shuffle_pd (s1, s2, N); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2] = {0.0}; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (453.345635,54646.464356); + u.x = test (s1.x, s2.x); + + e[0] = (N & (1 << 0)) ? s1.a[1] : s1.a[0]; + e[1] = (N & (1 << 1)) ? s2.a[1] : s2.a[0]; + + if (check_union128d(u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-shufps-1.c b/gcc/testsuite/gcc.target/i386/sse2-shufps-1.c new file mode 100644 index 00000000000..f1ef347612e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-shufps-1.c @@ -0,0 +1,57 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#define MASK 0xab + +#include CHECK_H + +#include <emmintrin.h> + +float select4(const float *src, unsigned int control) +{ + switch(control) { + case 0: + return src[0]; + case 1: + return src[1]; + case 2: + return src[2]; + case 3: + return src[3]; + } + return -1; +} + +static __m128 +__attribute__((noinline, unused)) +test (__m128 s1, __m128 s2) +{ + return _mm_shuffle_ps (s1, s2, MASK); +} + +static void +TEST (void) +{ + union128 u, s1, s2; + float e[4] = {0.0}; + + s1.x = _mm_set_ps (1.1, 1.2, 1.3, 1.4); + s2.x = _mm_set_ps (2.1, 2.2, 2.3, 2.4); + u.x = test (s1.x, s2.x); + + e[0] = select4(s1.a, (MASK >> 0) & 0x3); + e[1] = select4(s1.a, (MASK >> 2) & 0x3); + e[2] = select4(s2.a, (MASK >> 4) & 0x3); + e[3] = select4(s2.a, (MASK >> 6) & 0x3); + + if (check_union128(u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-sqrtpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-sqrtpd-1.c new file mode 100644 index 00000000000..3a476cfa38e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-sqrtpd-1.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> +#include <math.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1) +{ + return _mm_sqrt_pd (s1); +} + +static void +TEST (void) +{ + union128d u, s1; + double e[2]; + int i; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + u.x = test (s1.x); + + for (i = 0; i < 2; i++) + { + __m128d tmp = _mm_load_sd (&s1.a[i]); + tmp = _mm_sqrt_sd (tmp, tmp); + _mm_store_sd (&e[i], tmp); + } + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-subpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-subpd-1.c new file mode 100644 index 00000000000..e8ac1b820c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-subpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_sub_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] - s2.a[0]; + e[1] = s1.a[1] - s2.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-subsd-1.c b/gcc/testsuite/gcc.target/i386/sse2-subsd-1.c new file mode 100644 index 00000000000..d70c3f85584 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-subsd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_sub_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0] - s2.a[0]; + e[1] = s1.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-ucomisd-1.c b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-1.c new file mode 100644 index 00000000000..deae8e70fc8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-1.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_ucomieq_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,2344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] == s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-ucomisd-2.c b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-2.c new file mode 100644 index 00000000000..110f7cd4bff --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-2.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_ucomilt_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,12344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] < s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-ucomisd-3.c b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-3.c new file mode 100644 index 00000000000..1e3a1a60a65 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-3.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_ucomile_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1] = {0}; + int e[1] = {0}; + + s1.x = _mm_set_pd (2134.3343,12344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] <= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-ucomisd-4.c b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-4.c new file mode 100644 index 00000000000..99c9aa2ada4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-4.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_ucomigt_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,12344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] > s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-ucomisd-5.c b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-5.c new file mode 100644 index 00000000000..19a730a97b0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-5.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_ucomige_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,12344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] >= s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-ucomisd-6.c b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-6.c new file mode 100644 index 00000000000..dd5ed70e274 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-ucomisd-6.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static int +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_ucomineq_sd (s1, s2); +} + +static void +TEST (void) +{ + union128d s1, s2; + int d[1]; + int e[1]; + + s1.x = _mm_set_pd (2134.3343,12344.2354); + s2.x = _mm_set_pd (41124.234,2344.2354); + d[0] = test (s1.x, s2.x); + e[0] = s1.a[0] != s2.a[0]; + + if (checkVi (d, e, 1)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c b/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c new file mode 100644 index 00000000000..a2676396cd3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-unpack-1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +#include <emmintrin.h> + +__m128i +foo1 (__m128i s1, __m128i s2) +{ + return _mm_unpackhi_epi64 (s1, s2); +} + +__m128i +foo2 (__m128i s1, __m128i s2) +{ + return _mm_unpacklo_epi64 (s1, s2); +} + +/* { dg-final { scan-assembler "punpcklqdq" } } */ +/* { dg-final { scan-assembler "punpckhqdq" } } */ diff --git a/gcc/testsuite/gcc.target/i386/sse2-unpckhpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-unpckhpd-1.c new file mode 100644 index 00000000000..a682725d146 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-unpckhpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_unpackhi_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[1]; + e[1] = s2.a[1]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-unpcklpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-unpcklpd-1.c new file mode 100644 index 00000000000..0e4a5cce9ff --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-unpcklpd-1.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_unpacklo_pd (s1, s2); +} + +static void +TEST (void) +{ + union128d u, s1, s2; + double e[2]; + + s1.x = _mm_set_pd (2134.3343,1234.635654); + s2.x = _mm_set_pd (41124.234,2344.2354); + u.x = test (s1.x, s2.x); + + e[0] = s1.a[0]; + e[1] = s2.a[0]; + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse2-xorpd-1.c b/gcc/testsuite/gcc.target/i386/sse2-xorpd-1.c new file mode 100644 index 00000000000..88cf0d3794c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-xorpd-1.c @@ -0,0 +1,48 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#ifndef CHECK_H +#define CHECK_H "sse2-check.h" +#endif + +#ifndef TEST +#define TEST sse2_test +#endif + +#include CHECK_H + +#include <emmintrin.h> + +static __m128d +__attribute__((noinline, unused)) +test (__m128d s1, __m128d s2) +{ + return _mm_xor_pd (s1, s2); +} + +static void +TEST (void) +{ + union + { + double d[2]; + long long l[2]; + }source1, source2, e; + + union128d u, s1, s2; + int i; + + s1.x = _mm_set_pd (11.1321456, 2.287332); + s2.x = _mm_set_pd (3.37768, 4.43222234); + + _mm_storeu_pd (source1.d, s1.x); + _mm_storeu_pd (source2.d, s2.x); + + u.x = test (s1.x, s2.x); + + for (i = 0; i < 2; i++) + e.l[i] = source1.l[i] ^ source2.l[i]; + + if (check_union128d (u, e.d)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c b/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c index de5b14be872..e82fa76c5a5 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c +++ b/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c @@ -1,7 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif + +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> @@ -60,7 +68,7 @@ double vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; @@ -87,6 +95,4 @@ sse3_test (void) if (fail != 0) abort (); - - exit (0); } diff --git a/gcc/testsuite/gcc.target/i386/sse3-addsubps.c b/gcc/testsuite/gcc.target/i386/sse3-addsubps.c index 182fb5e0da7..091b58c8411 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-addsubps.c +++ b/gcc/testsuite/gcc.target/i386/sse3-addsubps.c @@ -1,7 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif + +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> @@ -60,7 +68,7 @@ static float vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-haddpd.c b/gcc/testsuite/gcc.target/i386/sse3-haddpd.c index d44db5e2307..8750ddfe298 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-haddpd.c +++ b/gcc/testsuite/gcc.target/i386/sse3-haddpd.c @@ -1,8 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> static void @@ -60,7 +67,7 @@ static double vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-haddps.c b/gcc/testsuite/gcc.target/i386/sse3-haddps.c index 11660498240..dcb0a7c58c8 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-haddps.c +++ b/gcc/testsuite/gcc.target/i386/sse3-haddps.c @@ -1,7 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif + +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> @@ -60,7 +68,7 @@ static float vals[80] = }; static void -sse3_test () +TEST () { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c b/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c index 90053a1d0f7..77018f5740f 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c +++ b/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c @@ -1,8 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> static void @@ -60,7 +67,7 @@ static double vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-hsubps.c b/gcc/testsuite/gcc.target/i386/sse3-hsubps.c index aa1375a61a7..326adfd045d 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-hsubps.c +++ b/gcc/testsuite/gcc.target/i386/sse3-hsubps.c @@ -1,8 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> static void @@ -62,7 +69,7 @@ static float vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-lddqu.c b/gcc/testsuite/gcc.target/i386/sse3-lddqu.c index d3dc094b36e..5df19a62af6 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-lddqu.c +++ b/gcc/testsuite/gcc.target/i386/sse3-lddqu.c @@ -1,8 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> static void @@ -45,7 +52,7 @@ static double vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-movddup.c b/gcc/testsuite/gcc.target/i386/sse3-movddup.c index 5464eb89a69..2eb33ad49c7 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-movddup.c +++ b/gcc/testsuite/gcc.target/i386/sse3-movddup.c @@ -1,7 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif + +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> @@ -86,7 +94,7 @@ static double vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-movshdup.c b/gcc/testsuite/gcc.target/i386/sse3-movshdup.c index 63a881ddc9e..8f6706cf939 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-movshdup.c +++ b/gcc/testsuite/gcc.target/i386/sse3-movshdup.c @@ -1,7 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif + +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> @@ -55,7 +63,7 @@ static float vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse3-movsldup.c b/gcc/testsuite/gcc.target/i386/sse3-movsldup.c index 66c64b3b154..9ae8454e0a5 100644 --- a/gcc/testsuite/gcc.target/i386/sse3-movsldup.c +++ b/gcc/testsuite/gcc.target/i386/sse3-movsldup.c @@ -1,7 +1,15 @@ /* { dg-do run } */ /* { dg-options "-O2 -msse3 -mfpmath=sse" } */ -#include "sse3-check.h" +#ifndef CHECK_H +#define CHECK_H "sse3-check.h" +#endif + +#ifndef TEST +#define TEST sse3_test +#endif + +#include CHECK_H #include <pmmintrin.h> @@ -38,7 +46,6 @@ chk_ps (float *v1, float *v2) static float p1[4] __attribute__ ((aligned(16))); static float p2[4]; -static float p3[4]; static float ck[4]; static float vals[80] = @@ -56,7 +63,7 @@ static float vals[80] = }; static void -sse3_test (void) +TEST (void) { int i; int fail = 0; diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c b/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c index f938e2fffb6..aff188c631f 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -42,7 +50,7 @@ check_blendpd (__m128d *dst, double *src1, double *src2) } static void -sse4_1_test (void) +TEST (void) { __m128d x, y; union diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c b/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c index a8691a60957..b4d8e8ee166 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -41,7 +49,7 @@ check_blendps (__m128 *dst, float *src1, float *src2) } static void -sse4_1_test (void) +TEST (void) { __m128 x, y; union diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c index 8adc4dd2993..b8e58d47aad 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -22,7 +30,7 @@ #endif static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c index 10fe37206f5..6dc328c0574 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c @@ -2,9 +2,18 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> + #include <string.h> #define lmskN 0x00 @@ -27,7 +36,7 @@ #endif static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c index 03fb2588709..77232567cdc 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -37,7 +45,7 @@ #endif static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c index 0b8d4c1fb88..48483b6c824 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c @@ -2,9 +2,18 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> + #include <string.h> #define lmskN 0x00 @@ -42,7 +51,7 @@ #endif static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c b/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c index 36294b8c6c6..d63296fe2f0 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -14,7 +22,7 @@ int masks[4]; #define msk3 0x03 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c index d4aad1aa3e6..2f5741288c2 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -18,7 +26,7 @@ #define msk7 0x0F static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c index 694aaf136c1..fbb96ca501f 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c @@ -2,12 +2,19 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif -#include <smmintrin.h> +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H +#include <smmintrin.h> static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c b/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c index ae7a9e755ea..bc5cf23839c 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -23,7 +31,7 @@ init_movntdqa (int *src) } static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c b/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c index c47d95b8c9e..0fc24e86111 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -44,7 +52,7 @@ compute_mpsadbw (unsigned char *v1, unsigned char *v2, int mask) } static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c b/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c index 2b6307a788e..f9815779414 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -23,7 +31,7 @@ int_to_ushort (int iVal) } static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c index 1fefc27df2f..58e94471e91 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -41,7 +49,7 @@ check_pblendvb (__m128i *dst, unsigned char *src1, } static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c index fa18ccdd981..5f5a253535b 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -41,7 +49,7 @@ check_pblendw (__m128i *dst, short *src1, short *src2) } static void -sse4_1_test (void) +TEST (void) { __m128i x, y; union diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c index a15356a2cba..8611b82482f 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c index 15d08fad809..bef4d2d167e 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c @@ -2,8 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define msk0 0 @@ -24,7 +31,7 @@ #define msk15 15 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c index 751dca241cb..3091e5a054a 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c @@ -2,17 +2,25 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> + #define msk0 0 #define msk1 1 #define msk2 2 #define msk3 3 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c index c9ff97db382..b90f4e2f12b 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c @@ -3,7 +3,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -11,7 +19,8 @@ #define msk1 1 static void -sse4_1_test (void) +__attribute__((noinline)) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c index 19d783fe505..2a0f03c07dc 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -16,7 +24,7 @@ #define msk7 7 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c b/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c index 24fdf2af160..ab4683401b8 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c index dd5ee0355dd..18427360f5b 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -25,7 +33,7 @@ #define mskF 0x0F static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c index e8168815ab3..7a5d5fbc914 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -13,7 +21,7 @@ #define msk3 0x03 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c index beeaf839d95..1640439e598 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c @@ -3,7 +3,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #include <string.h> @@ -12,7 +20,8 @@ #define msk1 0x01 static void -sse4_1_test (void) +__attribute__((noinline)) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c index 5bd007e52c2..ab445eefd58 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 1024 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c index 5e480b3b709..37c77aef515 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c index 844f8dab519..693c078fedb 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c index 99248c1f579..7b5cfcd8fc0 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c index 55192ded5a6..6f32d8b8312 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 1024 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c index c3aeb08244b..a3de148a043 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c index 64d69d28823..9daffc07062 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c index afe2f887f82..6ed5d9e2e60 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c index 7da95a7ccf7..00ce3ef77f2 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c index 9a1b3e138ca..0df6a61c70b 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c index df908998af3..36accff4cdc 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c index 96d06cd2099..e46ba1961f9 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c index 7266320154c..61d9d3c2ea9 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c index d7e1ded2c20..160d6467da9 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c index e5aa7ee3884..6ebd6cf4e4d 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c index 173ebd41a07..8b2f18a22d9 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c index 890e5baab39..8e1452bf70b 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c index d24f76690d1..cb2a4383eb8 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c index ed2c0e81cef..b525f4c6ae6 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c index 5a5608cb8a2..98f552aac45 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 128 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c index 597219b6a68..dda1ba3c19e 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c index d77d4539c14..9fb77d0ac7e 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> #define NUM 64 static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c index ec752b7247e..8b57a21114d 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -53,7 +61,7 @@ make_ptestc (__m128i m, __m128i v) } static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c index 5343dd24238..2e6df9538e6 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c @@ -2,7 +2,15 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> @@ -32,7 +40,7 @@ make_ptestnzc (__m128i m, __m128i v) } static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c index 1300d7b121f..bf2df320e1a 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c @@ -2,12 +2,20 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif + +#ifndef TEST +#define TEST sse4_1_test +#endif + +#include CHECK_H #include <smmintrin.h> static void -sse4_1_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c index 17da21fbf4b..37f20285f54 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c @@ -2,17 +2,37 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif -#define VEC_T __m128d -#define FP_T double -#define ASM_SUFFIX "l" +#ifndef TEST +#define TEST sse4_1_test +#endif -#define ROUND_INTRIN(x, mode) _mm_ceil_pd(x) -#define ROUND_MODE _MM_FROUND_CEIL -#define CHECK_ROUND_MODE 0x02 +#include CHECK_H -#define LOOP_INCREMENT 2 -#define CHECK_LOOP_INCREMENT 1 +#include <smmintrin.h> -#include "sse4_1-round.h" +#define iRoundMode 0x2 + +static void +TEST (void) +{ + union128d u, s; + double e[2] = {0.0}; + int i; + + s.x = _mm_set_pd (1.1234, -2.3478); + u.x = _mm_round_pd (s.x, iRoundMode); + + for (i = 0; i < 2; i++) + { + __m128d tmp = _mm_load_sd (&s.a[i]); + tmp = _mm_round_sd (tmp, tmp, iRoundMode); + _mm_store_sd (&e[i], tmp); + } + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c index 1ad9814ebee..7f0475f75ce 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c @@ -2,17 +2,35 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif -#define VEC_T __m128d -#define FP_T double -#define ASM_SUFFIX "l" +#ifndef TEST +#define TEST sse4_1_test +#endif -#define ROUND_INTRIN _mm_round_pd -#define ROUND_MODE _MM_FROUND_NINT -#define CHECK_ROUND_MODE 0x00 +#include CHECK_H -#define LOOP_INCREMENT 2 -#define CHECK_LOOP_INCREMENT 1 +#include <smmintrin.h> -#include "sse4_1-round.h" +static void +TEST (void) +{ + union128d u, s; + double e[2] = {0.0}; + int i; + + s.x = _mm_set_pd (1.1234, -2.3478); + u.x = _mm_floor_pd (s.x); + + for (i = 0; i < 2; i++) + { + __m128d tmp = _mm_load_sd (&s.a[i]); + tmp = _mm_floor_sd (tmp, tmp); + _mm_store_sd (&e[i], tmp); + } + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c index 39505788943..4a1f81026f0 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c @@ -2,17 +2,35 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.1" } */ -#include "sse4_1-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_1-check.h" +#endif -#define VEC_T __m128d -#define FP_T double -#define ASM_SUFFIX "l" +#ifndef TEST +#define TEST sse4_1_test +#endif -#define ROUND_INTRIN(x, mode) _mm_floor_pd(x) -#define ROUND_MODE _MM_FROUND_FLOOR -#define CHECK_ROUND_MODE 0x01 +#include CHECK_H -#define LOOP_INCREMENT 2 -#define CHECK_LOOP_INCREMENT 1 +#include <smmintrin.h> -#include "sse4_1-round.h" +static void +TEST (void) +{ + union128d u, s; + double e[2] = {0.0}; + int i; + + s.x = _mm_set_pd (1.1234, -2.3478); + u.x = _mm_ceil_pd (s.x); + + for (i = 0; i < 2; i++) + { + __m128d tmp = _mm_load_sd (&s.a[i]); + tmp = _mm_ceil_sd (tmp, tmp); + _mm_store_sd (&e[i], tmp); + } + + if (check_union128d (u, e)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c index c84ddd3f449..5b7f3ad7747 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -20,7 +29,7 @@ static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c index bc35eb7a323..800084ff67c 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -20,7 +29,7 @@ static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c index 1c75a9b2e4d..f02bb7e6941 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -20,7 +29,7 @@ static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c index baf377c3aad..845471f0bab 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -19,7 +28,7 @@ | _SIDD_MASKED_NEGATIVE_POLARITY | _SIDD_UNIT_MASK) static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c index c782d85cd31..e2ef66f2a17 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c @@ -2,14 +2,22 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H #include <nmmintrin.h> #define NUM 64 static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c index 9dbeb30b01c..b74df024d61 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -20,7 +29,7 @@ static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c index 6bad02e9d07..5aea655edc2 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -20,7 +29,7 @@ static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c index 3975728c09d..b8ec890cbd4 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -20,7 +29,7 @@ static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c index 6d3a23a75db..c6896ee6182 100644 --- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c @@ -2,7 +2,16 @@ /* { dg-require-effective-target sse4 } */ /* { dg-options "-O2 -msse4.2" } */ -#include "sse4_2-check.h" +#ifndef CHECK_H +#define CHECK_H "sse4_2-check.h" +#endif + +#ifndef TEST +#define TEST sse4_2_test +#endif + +#include CHECK_H + #include "sse4_2-pcmpstr.h" #define NUM 1024 @@ -19,7 +28,7 @@ | _SIDD_POSITIVE_POLARITY | _SIDD_UNIT_MASK) static void -sse4_2_test (void) +TEST (void) { union { diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c b/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c index 1a2445d4f29..7caa1b6c3a6 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c @@ -2,11 +2,20 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" -#include "ssse3-vals.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif +#include CHECK_H + +#include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_pabsb (int *i1, int *r) @@ -15,6 +24,7 @@ ssse3_test_pabsb (int *i1, int *r) *(__m64 *) r = _mm_abs_pi8 (t1); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -41,7 +51,7 @@ compute_correct_result (int *i1, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -53,10 +63,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result(&vals[i + 0], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_pabsb (&vals[i + 0], &r[0]); ssse3_test_pabsb (&vals[i + 2], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_pabsb128 (&vals[i + 0], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c b/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c index 22eb512ed35..3a73cf01170 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_pabsd (int *i1, int *r) @@ -15,6 +25,7 @@ ssse3_test_pabsd (int *i1, int *r) *(__m64 *) r = _mm_abs_pi32 (t1); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -39,7 +50,7 @@ compute_correct_result (int *i1, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -51,10 +62,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result(&vals[i + 0], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_pabsd (&vals[i + 0], &r[0]); ssse3_test_pabsd (&vals[i + 2], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_pabsd128 (&vals[i + 0], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c b/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c index aba4f050315..67e4721b8e6 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_pabsw (int *i1, int *r) @@ -15,6 +25,7 @@ ssse3_test_pabsw (int *i1, int *r) *(__m64 *) r = _mm_abs_pi16 (t1); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -41,7 +52,7 @@ compute_correct_result (int *i1, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -53,10 +64,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_pabsw (&vals[i + 0], &r[0]); ssse3_test_pabsw (&vals[i + 2], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_pabsw128 (&vals[i + 0], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-palignr.c b/gcc/testsuite/gcc.target/i386/ssse3-palignr.c index 386cddb2ee6..dbee9bee4aa 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-palignr.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-palignr.c @@ -2,12 +2,22 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> #include <string.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_palignr (int *i1, int *i2, unsigned int imm, int *r) @@ -72,6 +82,7 @@ ssse3_test_palignr (int *i1, int *i2, unsigned int imm, int *r) _mm_empty(); } +#endif /* Test the 128-bit form */ static void @@ -203,6 +214,7 @@ compute_correct_result_128 (int *i1, int *i2, unsigned int imm, int *r) bout[i] = buf[imm + i]; } +#ifndef __AVX__ static void compute_correct_result_64 (int *i1, int *i2, unsigned int imm, int *r) { @@ -230,9 +242,10 @@ compute_correct_result_64 (int *i1, int *i2, unsigned int imm, int *r) else bout[i + 8] = buf[imm + i]; } +#endif static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -243,6 +256,7 @@ ssse3_test (void) for (i = 0; i < 256; i += 8) for (imm = 0; imm < 100; imm++) { +#ifndef __AVX__ /* Manually compute the result */ compute_correct_result_64 (&vals[i + 0], &vals[i + 4], imm, ck); @@ -250,6 +264,7 @@ ssse3_test (void) ssse3_test_palignr (&vals[i + 0], &vals[i + 4], imm, &r[0]); ssse3_test_palignr (&vals[i + 2], &vals[i + 6], imm, &r[2]); fail += chk_128 (ck, r); +#endif /* Recompute the results for 128-bits */ compute_correct_result_128 (&vals[i + 0], &vals[i + 4], imm, ck); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c b/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c index 675d233360c..bef78168659 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_phaddd (int *i1, int *i2, int *r) @@ -16,6 +26,7 @@ ssse3_test_phaddd (int *i1, int *i2, int *r) *(__m64 *) r = _mm_hadd_pi32 (t1, t2); _mm_empty(); } +#endif /* Test the 128-bit form */ static void @@ -40,7 +51,7 @@ compute_correct_result(int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -53,10 +64,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_phaddd (&vals[i + 0], &vals[i + 2], &r[0]); ssse3_test_phaddd (&vals[i + 4], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_phaddd128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c b/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c index 563dcdb6af1..ff31fe5a5fe 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_phaddsw (int *i1, int *i2, int *r) @@ -16,6 +26,7 @@ ssse3_test_phaddsw (int *i1, int *i2, int *r) *(__m64 *) r = _mm_hadds_pi16 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -55,7 +66,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -67,10 +78,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_phaddsw (&vals[i + 0], &vals[i + 2], &r[0]); ssse3_test_phaddsw (&vals[i + 4], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_phaddsw128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c b/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c index 008a0db2d38..05c0afd4f69 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_phaddw (int *i1, int *i2, int *r) @@ -16,6 +26,7 @@ ssse3_test_phaddw (int *i1, int *i2, int *r) *(__m64 *) r = _mm_hadd_pi16 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -44,7 +55,7 @@ compute_correct_result(int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -56,10 +67,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_phaddw (&vals[i + 0], &vals[i + 2], &r[0]); ssse3_test_phaddw (&vals[i + 4], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_phaddw128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c b/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c index 19a1dc1da07..5884e5c12fe 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_phsubd (int *i1, int *i2, int *r) @@ -16,6 +26,7 @@ ssse3_test_phsubd (int *i1, int *i2, int *r) *(__m64 *) r = _mm_hsub_pi32(t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -40,7 +51,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -52,10 +63,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_phsubd (&vals[i + 0], &vals[i + 2], &r[0]); ssse3_test_phsubd (&vals[i + 4], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_phsubd128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c b/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c index 506844f7b10..371c8d112d1 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_phsubsw (int *i1, int *i2, int *r) @@ -18,6 +28,7 @@ ssse3_test_phsubsw (int *i1, int *i2, int *r) _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -58,7 +69,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -70,10 +81,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_phsubsw (&vals[i + 0], &vals[i + 2], &r[0]); ssse3_test_phsubsw (&vals[i + 4], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_phsubsw128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c b/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c index 7fd67faa20e..f3dbf9c9896 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c @@ -2,11 +2,20 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_phsubw (int *i1, int *i2, int *r) @@ -16,6 +25,7 @@ ssse3_test_phsubw (int *i1, int *i2, int *r) *(__m64 *) r = _mm_hsub_pi16 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -44,7 +54,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -56,10 +66,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_phsubw (&vals[i + 0], &vals[i + 2], &r[0]); ssse3_test_phsubw (&vals[i + 4], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_phsubw128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c b/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c index 3a2a27c0f3a..00bfc844f42 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_pmaddubsw (int *i1, int *i2, int *r) @@ -16,6 +26,7 @@ ssse3_test_pmaddubsw (int *i1, int *i2, int *r) *(__m64 *) r = _mm_maddubs_pi16 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -58,7 +69,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -70,10 +81,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_pmaddubsw (&vals[i + 0], &vals[i + 4], &r[0]); ssse3_test_pmaddubsw (&vals[i + 2], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_pmaddubsw128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c b/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c index 193c4fc9aca..24570b3bd63 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_pmulhrsw (int *i1, int *i2, int *r) @@ -16,6 +26,7 @@ ssse3_test_pmulhrsw (int *i1, int *i2, int *r) *(__m64 *) r = _mm_mulhrs_pi16 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -45,7 +56,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -57,10 +68,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_pmulhrsw (&vals[i + 0], &vals[i + 4], &r[0]); ssse3_test_pmulhrsw (&vals[i + 2], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_pmulhrsw128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c b/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c index 0a24d9e87f9..b995456b61c 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c @@ -2,11 +2,21 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H + #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_pshufb (int *i1, int *i2, int *r) @@ -16,6 +26,7 @@ ssse3_test_pshufb (int *i1, int *i2, int *r) *(__m64 *)r = _mm_shuffle_pi8 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -27,6 +38,7 @@ ssse3_test_pshufb128 (int *i1, int *i2, int *r) *(__m128i *)r = _mm_shuffle_epi8 (t1, t2); } +#ifndef __AVX__ /* Routine to manually compute the results */ static void compute_correct_result_64 (int *i1, int *i2, int *r) @@ -48,6 +60,7 @@ compute_correct_result_64 (int *i1, int *i2, int *r) bout[i] = b1[8 + (select & 0x7)]; } } +#endif static void compute_correct_result_128 (int *i1, int *i2, int *r) @@ -69,7 +82,7 @@ compute_correct_result_128 (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -78,6 +91,7 @@ ssse3_test (void) for (i = 0; i < 256; i += 8) { +#ifndef __AVX__ /* Manually compute the result */ compute_correct_result_64 (&vals[i + 0], &vals[i + 4], ck); @@ -85,6 +99,7 @@ ssse3_test (void) ssse3_test_pshufb (&vals[i + 0], &vals[i + 4], &r[0]); ssse3_test_pshufb (&vals[i + 2], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Recompute the result for 128-bits */ compute_correct_result_128 (&vals[i + 0], &vals[i + 4], ck); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-psignb.c b/gcc/testsuite/gcc.target/i386/ssse3-psignb.c index ba7617bf869..7462929aa20 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-psignb.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-psignb.c @@ -2,11 +2,20 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_psignb (int *i1, int *i2, int *r) @@ -16,6 +25,7 @@ ssse3_test_psignb (int *i1, int *i2, int *r) *(__m64 *) r = _mm_sign_pi8 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -46,7 +56,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -58,10 +68,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_psignb (&vals[i + 0], &vals[i + 4], &r[0]); ssse3_test_psignb (&vals[i + 2], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_psignb128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-psignd.c b/gcc/testsuite/gcc.target/i386/ssse3-psignd.c index 8b1ab4d880a..eca0489f8d3 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-psignd.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-psignd.c @@ -2,11 +2,20 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_psignd (int *i1, int *i2, int *r) @@ -16,6 +25,7 @@ ssse3_test_psignd (int *i1, int *i2, int *r) *(__m64 *) r = _mm_sign_pi32 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -43,7 +53,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -55,10 +65,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_psignd (&vals[i + 0], &vals[i + 4], &r[0]); ssse3_test_psignd (&vals[i + 2], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_psignd128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/ssse3-psignw.c b/gcc/testsuite/gcc.target/i386/ssse3-psignw.c index 04e9ed27cfa..00a506fd894 100644 --- a/gcc/testsuite/gcc.target/i386/ssse3-psignw.c +++ b/gcc/testsuite/gcc.target/i386/ssse3-psignw.c @@ -2,11 +2,20 @@ /* { dg-require-effective-target ssse3 } */ /* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */ -#include "ssse3-check.h" +#ifndef CHECK_H +#define CHECK_H "ssse3-check.h" +#endif + +#ifndef TEST +#define TEST ssse3_test +#endif + +#include CHECK_H #include "ssse3-vals.h" #include <tmmintrin.h> +#ifndef __AVX__ /* Test the 64-bit form */ static void ssse3_test_psignw (int *i1, int *i2, int *r) @@ -16,6 +25,7 @@ ssse3_test_psignw (int *i1, int *i2, int *r) *(__m64 *) r = _mm_sign_pi16 (t1, t2); _mm_empty (); } +#endif /* Test the 128-bit form */ static void @@ -46,7 +56,7 @@ compute_correct_result (int *i1, int *i2, int *r) } static void -ssse3_test (void) +TEST (void) { int i; int r [4] __attribute__ ((aligned(16))); @@ -58,10 +68,12 @@ ssse3_test (void) /* Manually compute the result */ compute_correct_result (&vals[i + 0], &vals[i + 4], ck); +#ifndef __AVX__ /* Run the 64-bit tests */ ssse3_test_psignw (&vals[i + 0], &vals[i + 4], &r[0]); ssse3_test_psignw (&vals[i + 2], &vals[i + 6], &r[2]); fail += chk_128 (ck, r); +#endif /* Run the 128-bit tests */ ssse3_test_psignw128 (&vals[i + 0], &vals[i + 4], r); diff --git a/gcc/testsuite/gcc.target/i386/vararg-10.c b/gcc/testsuite/gcc.target/i386/vararg-10.c new file mode 100644 index 00000000000..053649877ed --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-10.c @@ -0,0 +1,112 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-mavx" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "avx-check.h" + +struct m256d +{ + __m256d v; +}; + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; +struct m256d n2 = { { -93.83, 893.318, 3994.3, -39484.0 } }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +struct m256d n8 = { { -123.3, 2.3, 3.4, -10.03 } }; +__m128 n9 = { -123.3, 2.3, 3.4, -10.03 }; +__m128i n10 = { 1233, -100 }; +int n11 = 407; +double n12 = 304.9; +__m128i n13 = { 233, -110 }; +__m256i n14 = { -1233, 23, 34, -1003 }; +__m128i n15 = { -393, -180 }; +__m128d n16 = { 73.0, 63.18 }; +__m256 n17 = { -183.3, -22.3, 13.9, -119.3, 483.1, 122.3, -33.4, -9.37 }; +__m128 n18 = { -183.3, 22.3, 13.4, -19.03 }; + +__m128 e1; +struct m256d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +struct m256d e8; +__m128 e9; +__m128i e10; +int e11; +double e12; +__m128i e13; +__m256i e14; +__m128i e15; +__m128d e16; +__m256 e17; +__m128 e18; + +static void +__attribute__((noinline)) +foo (va_list va_arglist) +{ + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, struct m256d); + e9 = va_arg (va_arglist, __m128); + e10 = va_arg (va_arglist, __m128i); + e11 = va_arg (va_arglist, int); + e12 = va_arg (va_arglist, double); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m256i); + e15 = va_arg (va_arglist, __m128i); + e16 = va_arg (va_arglist, __m128d); + e17 = va_arg (va_arglist, __m256); + e18 = va_arg (va_arglist, __m128); + va_end (va_arglist); +} + +static void +__attribute__((noinline)) +test (__m128 a1, struct m256d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + foo (va_arglist); + va_end (va_arglist); +} + +static void +avx_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, + n13, n14, n15, n16, n17, n18); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (__builtin_memcmp (&e10, &n10, sizeof (e10)) == 0); + assert (n11 == e11); + assert (n12 == e12); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); + assert (__builtin_memcmp (&e16, &n16, sizeof (e16)) == 0); + assert (__builtin_memcmp (&e17, &n17, sizeof (e17)) == 0); + assert (__builtin_memcmp (&e18, &n18, sizeof (e18)) == 0); +} diff --git a/gcc/testsuite/gcc.target/i386/vararg-3.c b/gcc/testsuite/gcc.target/i386/vararg-3.c new file mode 100644 index 00000000000..a6b5876f5db --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-3.c @@ -0,0 +1,85 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "sse2-check.h" + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; +__m128d n2 = { -93.83, 893.318 }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +__m128 n8 = { -123.3, 2.3, 3.4, -10.03 }; +__m128i n9 = { 1233, -100 }; +int n10 = 407; +double n11 = 304.9; +__m128i n12 = { 233, -110 }; +__m128i n13 = { -393, -180 }; +__m128d n14 = { 73.0, 63.18 }; +__m128 n15 = { -183.3, 22.3, 13.4, -19.03 }; + +__m128 e1; +__m128d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +__m128 e8; +__m128i e9; +int e10; +double e11; +__m128i e12; +__m128i e13; +__m128d e14; +__m128 e15; + +static void +__attribute__((noinline)) +test (__m128 a1, __m128d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, __m128); + e9 = va_arg (va_arglist, __m128i); + e10 = va_arg (va_arglist, int); + e11 = va_arg (va_arglist, double); + e12 = va_arg (va_arglist, __m128i); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m128d); + e15 = va_arg (va_arglist, __m128); + va_end (va_arglist); +} + +static void +sse2_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (n10 == e10); + assert (n11 == e11); + assert (__builtin_memcmp (&e12, &n12, sizeof (e12)) == 0); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); +} diff --git a/gcc/testsuite/gcc.target/i386/vararg-4.c b/gcc/testsuite/gcc.target/i386/vararg-4.c new file mode 100644 index 00000000000..e2f83b0c4a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-4.c @@ -0,0 +1,92 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "sse2-check.h" + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; +__m128d n2 = { -93.83, 893.318 }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +__m128 n8 = { -123.3, 2.3, 3.4, -10.03 }; +__m128i n9 = { 1233, -100 }; +int n10 = 407; +double n11 = 304.9; +__m128i n12 = { 233, -110 }; +__m128i n13 = { -393, -180 }; +__m128d n14 = { 73.0, 63.18 }; +__m128 n15 = { -183.3, 22.3, 13.4, -19.03 }; + +__m128 e1; +__m128d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +__m128 e8; +__m128i e9; +int e10; +double e11; +__m128i e12; +__m128i e13; +__m128d e14; +__m128 e15; + +static void +__attribute__((noinline)) +foo (va_list va_arglist) +{ + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, __m128); + e9 = va_arg (va_arglist, __m128i); + e10 = va_arg (va_arglist, int); + e11 = va_arg (va_arglist, double); + e12 = va_arg (va_arglist, __m128i); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m128d); + e15 = va_arg (va_arglist, __m128); +} + +static void +__attribute__((noinline)) +test (__m128 a1, __m128d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + foo (va_arglist); + va_end (va_arglist); +} + +static void +sse2_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (n10 == e10); + assert (n11 == e11); + assert (__builtin_memcmp (&e12, &n12, sizeof (e12)) == 0); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); +} diff --git a/gcc/testsuite/gcc.target/i386/vararg-5.c b/gcc/testsuite/gcc.target/i386/vararg-5.c new file mode 100644 index 00000000000..03ff60cd748 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-5.c @@ -0,0 +1,99 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-mavx" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "avx-check.h" + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; +__m256d n2 = { -93.83, 893.318, 3994.3, -39484.0 }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +__m256d n8 = { -123.3, 2.3, 3.4, -10.03 }; +__m128 n9 = { -123.3, 2.3, 3.4, -10.03 }; +__m128i n10 = { 1233, -100 }; +int n11 = 407; +double n12 = 304.9; +__m128i n13 = { 233, -110 }; +__m256i n14 = { -1233, 23, 34, -1003 }; +__m128i n15 = { -393, -180 }; +__m128d n16 = { 73.0, 63.18 }; +__m256 n17 = { -183.3, -22.3, 13.9, -119.3, 483.1, 122.3, -33.4, -9.37 }; +__m128 n18 = { -183.3, 22.3, 13.4, -19.03 }; + +__m128 e1; +__m256d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +__m256d e8; +__m128 e9; +__m128i e10; +int e11; +double e12; +__m128i e13; +__m256i e14; +__m128i e15; +__m128d e16; +__m256 e17; +__m128 e18; + +static void +__attribute__((noinline)) +test (__m128 a1, __m256d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, __m256d); + e9 = va_arg (va_arglist, __m128); + e10 = va_arg (va_arglist, __m128i); + e11 = va_arg (va_arglist, int); + e12 = va_arg (va_arglist, double); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m256i); + e15 = va_arg (va_arglist, __m128i); + e16 = va_arg (va_arglist, __m128d); + e17 = va_arg (va_arglist, __m256); + e18 = va_arg (va_arglist, __m128); + va_end (va_arglist); +} + +static void +avx_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, + n13, n14, n15, n16, n17, n18); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (__builtin_memcmp (&e10, &n10, sizeof (e10)) == 0); + assert (n11 == e11); + assert (n12 == e12); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); + assert (__builtin_memcmp (&e16, &n16, sizeof (e16)) == 0); + assert (__builtin_memcmp (&e17, &n17, sizeof (e17)) == 0); + assert (__builtin_memcmp (&e18, &n18, sizeof (e18)) == 0); +} diff --git a/gcc/testsuite/gcc.target/i386/vararg-6.c b/gcc/testsuite/gcc.target/i386/vararg-6.c new file mode 100644 index 00000000000..5c645c41d6d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-6.c @@ -0,0 +1,107 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-mavx" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "avx-check.h" + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; +__m256d n2 = { -93.83, 893.318, 3994.3, -39484.0 }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +__m256d n8 = { -123.3, 2.3, 3.4, -10.03 }; +__m128 n9 = { -123.3, 2.3, 3.4, -10.03 }; +__m128i n10 = { 1233, -100 }; +int n11 = 407; +double n12 = 304.9; +__m128i n13 = { 233, -110 }; +__m256i n14 = { -1233, 23, 34, -1003 }; +__m128i n15 = { -393, -180 }; +__m128d n16 = { 73.0, 63.18 }; +__m256 n17 = { -183.3, -22.3, 13.9, -119.3, 483.1, 122.3, -33.4, -9.37 }; +__m128 n18 = { -183.3, 22.3, 13.4, -19.03 }; + +__m128 e1; +__m256d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +__m256d e8; +__m128 e9; +__m128i e10; +int e11; +double e12; +__m128i e13; +__m256i e14; +__m128i e15; +__m128d e16; +__m256 e17; +__m128 e18; + +static void +__attribute__((noinline)) +foo (va_list va_arglist) +{ + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, __m256d); + e9 = va_arg (va_arglist, __m128); + e10 = va_arg (va_arglist, __m128i); + e11 = va_arg (va_arglist, int); + e12 = va_arg (va_arglist, double); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m256i); + e15 = va_arg (va_arglist, __m128i); + e16 = va_arg (va_arglist, __m128d); + e17 = va_arg (va_arglist, __m256); + e18 = va_arg (va_arglist, __m128); + va_end (va_arglist); +} + +static void +__attribute__((noinline)) +test (__m128 a1, __m256d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + foo (va_arglist); + va_end (va_arglist); +} + +static void +avx_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, + n13, n14, n15, n16, n17, n18); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (__builtin_memcmp (&e10, &n10, sizeof (e10)) == 0); + assert (n11 == e11); + assert (n12 == e12); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); + assert (__builtin_memcmp (&e16, &n16, sizeof (e16)) == 0); + assert (__builtin_memcmp (&e17, &n17, sizeof (e17)) == 0); + assert (__builtin_memcmp (&e18, &n18, sizeof (e18)) == 0); +} diff --git a/gcc/testsuite/gcc.target/i386/vararg-7.c b/gcc/testsuite/gcc.target/i386/vararg-7.c new file mode 100644 index 00000000000..bebf6092492 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-7.c @@ -0,0 +1,90 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "sse2-check.h" + +struct m128 +{ + __m128 v; +}; + +struct m128 n1 = { { -283.3, -23.3, 213.4, 1119.03 } }; +__m128d n2 = { -93.83, 893.318 }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +struct m128 n8 = { { -123.3, 2.3, 3.4, -10.03 } }; +__m128i n9 = { 1233, -100 }; +int n10 = 407; +double n11 = 304.9; +__m128i n12 = { 233, -110 }; +__m128i n13 = { -393, -180 }; +__m128d n14 = { 73.0, 63.18 }; +struct m128 n15 = { { -183.3, 22.3, 13.4, -19.03 } }; + +struct m128 e1; +__m128d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +struct m128 e8; +__m128i e9; +int e10; +double e11; +__m128i e12; +__m128i e13; +__m128d e14; +struct m128 e15; + +static void +__attribute__((noinline)) +test (struct m128 a1, __m128d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, struct m128); + e9 = va_arg (va_arglist, __m128i); + e10 = va_arg (va_arglist, int); + e11 = va_arg (va_arglist, double); + e12 = va_arg (va_arglist, __m128i); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m128d); + e15 = va_arg (va_arglist, struct m128); + va_end (va_arglist); +} + +static void +sse2_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (n10 == e10); + assert (n11 == e11); + assert (__builtin_memcmp (&e12, &n12, sizeof (e12)) == 0); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); +} diff --git a/gcc/testsuite/gcc.target/i386/vararg-8.c b/gcc/testsuite/gcc.target/i386/vararg-8.c new file mode 100644 index 00000000000..bf6d3b52327 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-8.c @@ -0,0 +1,97 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -msse2" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "sse2-check.h" + +struct m128 +{ + __m128 v; +}; + +struct m128 n1 = { { -283.3, -23.3, 213.4, 1119.03 } }; +__m128d n2 = { -93.83, 893.318 }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +struct m128 n8 = { { -123.3, 2.3, 3.4, -10.03 } }; +__m128i n9 = { 1233, -100 }; +int n10 = 407; +double n11 = 304.9; +__m128i n12 = { 233, -110 }; +__m128i n13 = { -393, -180 }; +__m128d n14 = { 73.0, 63.18 }; +struct m128 n15 = { { -183.3, 22.3, 13.4, -19.03 } }; + +struct m128 e1; +__m128d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +struct m128 e8; +__m128i e9; +int e10; +double e11; +__m128i e12; +__m128i e13; +__m128d e14; +struct m128 e15; + +static void +__attribute__((noinline)) +foo (va_list va_arglist) +{ + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, struct m128); + e9 = va_arg (va_arglist, __m128i); + e10 = va_arg (va_arglist, int); + e11 = va_arg (va_arglist, double); + e12 = va_arg (va_arglist, __m128i); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m128d); + e15 = va_arg (va_arglist, struct m128); +} + +static void +__attribute__((noinline)) +test (struct m128 a1, __m128d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + foo (va_arglist); + va_end (va_arglist); +} + +static void +sse2_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (n10 == e10); + assert (n11 == e11); + assert (__builtin_memcmp (&e12, &n12, sizeof (e12)) == 0); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); +} diff --git a/gcc/testsuite/gcc.target/i386/vararg-9.c b/gcc/testsuite/gcc.target/i386/vararg-9.c new file mode 100644 index 00000000000..581abb178a3 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vararg-9.c @@ -0,0 +1,104 @@ +/* { dg-do run } */ +/* { dg-require-effective-target avx } */ +/* { dg-options "-mavx" } */ + +#include <stdarg.h> +#include <assert.h> + +#include "avx-check.h" + +struct m256d +{ + __m256d v; +}; + +__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 }; +struct m256d n2 = { { -93.83, 893.318, 3994.3, -39484.0 } }; +__m128i n3 = { 893, -3180 } ; +int n4 = 324; +double n5 = 103.3; +__m128i n6 = { -123, 2 }; +__m128d n7 = { -91.387, -8193.518 }; +struct m256d n8 = { { -123.3, 2.3, 3.4, -10.03 } }; +__m128 n9 = { -123.3, 2.3, 3.4, -10.03 }; +__m128i n10 = { 1233, -100 }; +int n11 = 407; +double n12 = 304.9; +__m128i n13 = { 233, -110 }; +__m256i n14 = { -1233, 23, 34, -1003 }; +__m128i n15 = { -393, -180 }; +__m128d n16 = { 73.0, 63.18 }; +__m256 n17 = { -183.3, -22.3, 13.9, -119.3, 483.1, 122.3, -33.4, -9.37 }; +__m128 n18 = { -183.3, 22.3, 13.4, -19.03 }; + +__m128 e1; +struct m256d e2; +__m128i e3; +int e4; +double e5; +__m128i e6; +__m128d e7; +struct m256d e8; +__m128 e9; +__m128i e10; +int e11; +double e12; +__m128i e13; +__m256i e14; +__m128i e15; +__m128d e16; +__m256 e17; +__m128 e18; + +static void +__attribute__((noinline)) +test (__m128 a1, struct m256d a2, __m128i a3, ...) +{ + va_list va_arglist; + + e1 = a1; + e2 = a2; + e3 = a3; + va_start (va_arglist, a3); + e4 = va_arg (va_arglist, int); + e5 = va_arg (va_arglist, double); + e6 = va_arg (va_arglist, __m128i); + e7 = va_arg (va_arglist, __m128d); + e8 = va_arg (va_arglist, struct m256d); + e9 = va_arg (va_arglist, __m128); + e10 = va_arg (va_arglist, __m128i); + e11 = va_arg (va_arglist, int); + e12 = va_arg (va_arglist, double); + e13 = va_arg (va_arglist, __m128i); + e14 = va_arg (va_arglist, __m256i); + e15 = va_arg (va_arglist, __m128i); + e16 = va_arg (va_arglist, __m128d); + e17 = va_arg (va_arglist, __m256); + e18 = va_arg (va_arglist, __m128); + va_end (va_arglist); +} + +static void +avx_test (void) +{ + test (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, + n13, n14, n15, n16, n17, n18); + assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0); + assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0); + assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0); + assert (n4 == e4); + assert (n5 == e5); + assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0); + assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0); + assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0); + assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0); + assert (__builtin_memcmp (&e10, &n10, sizeof (e10)) == 0); + assert (n11 == e11); + assert (n12 == e12); + assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0); + assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0); + assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0); + assert (__builtin_memcmp (&e16, &n16, sizeof (e16)) == 0); + assert (__builtin_memcmp (&e17, &n17, sizeof (e17)) == 0); + assert (__builtin_memcmp (&e18, &n18, sizeof (e18)) == 0); +} diff --git a/gcc/testsuite/gcc.target/ia64/types-1.c b/gcc/testsuite/gcc.target/ia64/types-1.c index 521588b47bd..ace49ebb3ea 100644 --- a/gcc/testsuite/gcc.target/ia64/types-1.c +++ b/gcc/testsuite/gcc.target/ia64/types-1.c @@ -2,40 +2,40 @@ /* Test that __fpreg is distinct from any other builtin type. */ -extern float fr1; /* { dg-error "" } */ +extern float fr1; /* { dg-message "note: previous declaration of " } */ extern __fpreg fr1; /* { dg-error "" } */ -extern double fr2; /* { dg-error "" } */ +extern double fr2; /* { dg-message "note: previous declaration of " } */ extern __fpreg fr2; /* { dg-error "" } */ -extern long double fr3; /* { dg-error "" } */ +extern long double fr3; /* { dg-message "note: previous declaration of " } */ extern __fpreg fr3; /* { dg-error "" } */ -extern __float80 fr4; /* { dg-error "" } */ +extern __float80 fr4; /* { dg-message "note: previous declaration of " } */ extern __fpreg fr4; /* { dg-error "" } */ -extern __float128 fr5; /* { dg-error "" } */ +extern __float128 fr5; /* { dg-message "note: previous declaration of " } */ extern __fpreg fr5; /* { dg-error "" } */ /* Test that __float80 is distinct from any other builtin type. */ -extern float f801; /* { dg-error "" } */ +extern float f801; /* { dg-message "note: previous declaration of " } */ extern __float80 f801; /* { dg-error "" } */ -extern double f802; /* { dg-error "" } */ +extern double f802; /* { dg-message "note: previous declaration of " } */ extern __float80 f802; /* { dg-error "" } */ -extern long double f803; /* { dg-error "" } */ +extern long double f803; /* { dg-message "note: previous declaration of " } */ extern __float80 f803; /* { dg-error "" } */ -extern __fpreg f804; /* { dg-error "" } */ +extern __fpreg f804; /* { dg-message "note: previous declaration of " } */ extern __float80 f804; /* { dg-error "" } */ -extern __float128 f805; /* { dg-error "" } */ +extern __float128 f805; /* { dg-message "note: previous declaration of " } */ extern __float80 f805; /* { dg-error "" } */ /* Test that __float128 is distinct from any other builtin type -- except "long double", for which it is a synonym. */ -extern float f1281; /* { dg-error "" } */ +extern float f1281; /* { dg-message "note: previous declaration of " } */ extern __float128 f1281; /* { dg-error "" } */ -extern double f1282; /* { dg-error "" } */ +extern double f1282; /* { dg-message "note: previous declaration of " } */ extern __float128 f1282; /* { dg-error "" } */ extern long double f1283; extern __float128 f1283; -extern __fpreg f1284; /* { dg-error "" } */ +extern __fpreg f1284; /* { dg-message "note: previous declaration of " } */ extern __float128 f1284; /* { dg-error "" } */ -extern __float80 f1285; /* { dg-error "" } */ +extern __float80 f1285; /* { dg-message "note: previous declaration of " } */ extern __float128 f1285; /* { dg-error "" } */ diff --git a/gcc/testsuite/gcc.target/mips/dmult-1.c b/gcc/testsuite/gcc.target/mips/dmult-1.c new file mode 100644 index 00000000000..561bdf4bb15 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/dmult-1.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target mips16_attribute } } */ +/* { dg-mips-options "-mips64 -mgp64" } */ +/* { dg-add-options mips16_attribute } */ +/* { dg-final { scan-assembler "\tdmult\t" } } */ +/* { dg-final { scan-assembler "\tmflo\t" } } */ +/* { dg-final { scan-assembler-not "\tdmul\t" } } */ + +long long +f (long long a, long long b) +{ + return a * b; +} diff --git a/gcc/testsuite/gcc.target/mips/ext-1.c b/gcc/testsuite/gcc.target/mips/ext-1.c index 1cd111d5e33..2d9368a8bd1 100644 --- a/gcc/testsuite/gcc.target/mips/ext-1.c +++ b/gcc/testsuite/gcc.target/mips/ext-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-mips-options "-O -mips64r2" } */ +/* { dg-mips-options "-O -mips64r2 -mgp64" } */ /* { dg-final { scan-assembler "\tdext\t" } } */ /* { dg-final { scan-assembler-not "and" } } */ diff --git a/gcc/testsuite/gcc.target/mips/octeon-bbit-1.c b/gcc/testsuite/gcc.target/mips/octeon-bbit-1.c new file mode 100644 index 00000000000..24fd72884e7 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-bbit-1.c @@ -0,0 +1,55 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O2 -march=octeon" } */ +/* { dg-final { scan-assembler-times "\tbbit1\t" 4 } } */ +/* { dg-final { scan-assembler-times "\tbbit0\t" 2 } } */ +/* { dg-final { scan-assembler-not "andi\t" } } */ + +NOMIPS16 void +f1 (long long i) +{ + if (i & 0x80) + foo (); +} + +NOMIPS16 void +f2 (int i) +{ + if (!(i & 0x80)) + foo (); +} + +NOMIPS16 void +f3 (int i) +{ + if (i % 2) + foo (); +} + +NOMIPS16 void +f4 (int i) +{ + if (i & 1) + foo (); +} + +NOMIPS16 void +f5 (long long i) +{ + if ((i >> 3) & 1) + foo (); +} + +unsigned long long r; + +NOMIPS16 static inline __attribute__((always_inline)) int +test_bit(unsigned long long nr, const unsigned long long *addr) +{ + return 1UL & (addr[nr >> 6] >> (nr & 63ULL)); +} + +NOMIPS16 void +f6 () +{ + if (!test_bit(0, &r)) + g (); +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-bbit-2.c b/gcc/testsuite/gcc.target/mips/octeon-bbit-2.c new file mode 100644 index 00000000000..6be7ef58643 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-bbit-2.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O2 -march=octeon -mbranch-likely" } */ +/* { dg-final { scan-assembler "\tbbit\[01\]\t" } } */ +/* { dg-final { scan-assembler-not "\tbbit\[01\]l\t" } } */ +/* { dg-final { scan-assembler "\tbnel\t" } } */ +/* { dg-final { scan-assembler-not "\tbne\t" } } */ + +NOMIPS16 int +f (int n, int i) +{ + int s = 0; + for (; i & 1; i++) + s += i; + return s; +} + +NOMIPS16 int +g (int n, int i) +{ + int s = 0; + for (i = 0; i < n; i++) + s += i; + return s; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c new file mode 100644 index 00000000000..ac8d0ca5c7a --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-bbit-3.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O2 -march=octeon" } */ +/* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t" 2 } } */ +/* { dg-final { scan-assembler-not "ext\t" } } */ + +void abort (void); +void exit (int); + +typedef unsigned long long ulong64; + +typedef struct bitfield_s { + ulong64 a:1; + ulong64 b:29; + ulong64 c:1; + ulong64 d:15; + ulong64 f:18; +} bitfield_t; + +bitfield_t bar; + +NOMIPS16 void +f () +{ + foo(&bar); + if (bar.a != 0x1) + abort (); + else if (!bar.c) + abort (); + else + exit (0); +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-dmul-1.c b/gcc/testsuite/gcc.target/mips/octeon-dmul-1.c new file mode 100644 index 00000000000..1cbf7a63c51 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-dmul-1.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-march=octeon -mgp64" } */ +/* { dg-final { scan-assembler "\tdmul\t" } } */ +/* { dg-final { scan-assembler-not "\tdmult\t" } } */ +/* { dg-final { scan-assembler-not "\tmflo\t" } } */ + +NOMIPS16 long long +f (long long a, long long b) +{ + return a * b; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-dmul-2.c b/gcc/testsuite/gcc.target/mips/octeon-dmul-2.c new file mode 100644 index 00000000000..2e8e4e61033 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-dmul-2.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-march=octeon -mgp64" } */ +/* { dg-final { scan-assembler-not "\tdmul" } } */ + +NOMIPS16 long long +f (long long a) +{ + return a * 7; +} diff --git a/gcc/testsuite/gcc.target/mips/octeon-pop-1.c b/gcc/testsuite/gcc.target/mips/octeon-pop-1.c new file mode 100644 index 00000000000..2554af6c821 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/octeon-pop-1.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-mips-options "-O -march=octeon -mgp64" } */ +/* { dg-final { scan-assembler "\tpop\t" } } */ +/* { dg-final { scan-assembler "\tdpop\t" } } */ + +NOMIPS16 int +f (long long a) +{ + return __builtin_popcountll (a); +} + +NOMIPS16 int +g (int a) +{ + return __builtin_popcount (a); +} diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-macros.c b/gcc/testsuite/gcc.target/powerpc/altivec-macros.c index ef497a44161..8ea8df241db 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-macros.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-macros.c @@ -55,9 +55,9 @@ _Pragma ("__vector") /* { dg-warning "redefined" "pixel redefined" { target *-*-* } 48 } */ /* { dg-warning "redefined" "bool redefined" { target *-*-* } 49 } */ -/* { dg-message "note: previous" "prev __vector defn" { target *-*-* } 24 } */ -/* { dg-message "note: previous" "prev __pixel defn" { target *-*-* } 27 } */ -/* { dg-message "note: previous" "prev __bool defn" { target *-*-* } 30 } */ -/* { dg-message "note: previous" "prev vector defn" { target *-*-* } 33 } */ -/* { dg-message "note: previous" "prev pixel defn" { target *-*-* } 36 } */ -/* { dg-message "note: previous" "prev bool defn" { target *-*-* } 39 } */ +/* { dg-message "location of the previous" "prev __vector defn" { target *-*-* } 24 } */ +/* { dg-message "location of the previous" "prev __pixel defn" { target *-*-* } 27 } */ +/* { dg-message "location of the previous" "prev __bool defn" { target *-*-* } 30 } */ +/* { dg-message "location of the previous" "prev vector defn" { target *-*-* } 33 } */ +/* { dg-message "location of the previous" "prev pixel defn" { target *-*-* } 36 } */ +/* { dg-message "location of the previous" "prev bool defn" { target *-*-* } 39 } */ diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c b/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c index 56bf4b9a7ed..d293042d64f 100644 --- a/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c +++ b/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c @@ -86,3 +86,6 @@ __vector __bool float vbf; /* { dg-error "" "" } */ __vector __bool double vbd; /* { dg-error "" "" } */ __vector __bool short float blf; /* { dg-error "" "" } */ __vector __bool short double vlbd; /* { dg-error "" "" } */ + +/* { dg-message "note: previous" "prev vsf" { target *-*-* } 79 } */ +/* { dg-message "note: previous" "prev vsd" { target *-*-* } 82 } */ diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-volatile.c b/gcc/testsuite/gcc.target/powerpc/altivec-volatile.c new file mode 100644 index 00000000000..594ec88b4e7 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/altivec-volatile.c @@ -0,0 +1,13 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec" } */ + +/* Check that "volatile" type qualifier is propagated to vector type. */ + +#include <altivec.h> + +vector float *f (volatile vector float *a) +{ + return a; /* { dg-warning "discards qualifiers" } */ +} + diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c b/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c index 452060e9f61..c45a90f0f5c 100644 --- a/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c +++ b/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c @@ -1,5 +1,6 @@ /* { dg-do run { target powerpc*-*-* } } */ /* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-skip-if "need to be able to execute AltiVec" { ! { powerpc_altivec_ok && vmx_hw } } } */ /* { dg-options "-maltivec" } */ /* With altivec turned on, Darwin wants to save the world but we did not mark lr as being saved any more diff --git a/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c index bfdf7426600..3d9afb25aa7 100644 --- a/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c +++ b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c @@ -1,5 +1,5 @@ /* { dg-do link { target { *-*-linux* && powerpc_fprs } } } */ -/* { dg-options "-W -Wall -mcpu=cell" } */ +/* { dg-options "-W -Wall -Wno-uninitialized -mcpu=cell" } */ /* Test some PPU intrinsics from <ppu_intrinsics.h>. */ #include <ppu_intrinsics.h> diff --git a/gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp b/gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp index 4f9fd46441f..61dc3e4586b 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp +++ b/gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp @@ -39,7 +39,7 @@ foreach src [lsort [find $srcdir/$subdir test_*.c]] { $additional_flags } else { c-torture-execute [list $src \ - $srcdir/$subdir/asm-support.s] \ + $srcdir/$subdir/asm-support.S] \ $additional_flags } } diff --git a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.s b/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S index 00a08c020fd..61b66e1490a 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.s +++ b/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S @@ -1,4 +1,7 @@ .file "snapshot.S" +#ifdef __AVX__ + .sse_check none +#endif .text .p2align 4,,15 .globl snapshot diff --git a/gcc/testsuite/gfortran.dg/argument_checking_7.f90 b/gcc/testsuite/gfortran.dg/argument_checking_7.f90 index 17f043a5a85..0bf76cbb451 100644 --- a/gcc/testsuite/gfortran.dg/argument_checking_7.f90 +++ b/gcc/testsuite/gfortran.dg/argument_checking_7.f90 @@ -5,14 +5,14 @@ module cyclic implicit none contains function ouch(x,y) ! { dg-error "has no IMPLICIT type" } - implicit character(len(ouch)) (x) ! { dg-error "Conflict in attributes" } - implicit character(len(x)+1) (y) - implicit character(len(y)-1) (o) + implicit character(len(ouch)) (x) ! { dg-error "used before it is typed" } + implicit character(len(x)+1) (y) ! { dg-error "used before it is typed" } + implicit character(len(y)-1) (o) ! { dg-error "used before it is typed" } intent(in) x,y - character(len(y)-1) ouch + character(len(y)-1) ouch ! { dg-error "used before it is typed" } integer i do i = 1, len(ouch) - ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i)))) ! { dg-error " PROCEDURE attribute conflicts" } + ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i)))) ! { dg-error "Unclassifiable statement" } end do end function ouch end module cyclic diff --git a/gcc/testsuite/gfortran.dg/array_constructor_26.f03 b/gcc/testsuite/gfortran.dg/array_constructor_26.f03 index a226f6ae00c..622bb515e03 100644 --- a/gcc/testsuite/gfortran.dg/array_constructor_26.f03 +++ b/gcc/testsuite/gfortran.dg/array_constructor_26.f03 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=gnu" } ! PR fortran/36492 ! Check for incorrect error message with -std=f2003. @@ -10,8 +11,8 @@ MODULE WinData integer :: i TYPE TWindowData CHARACTER (MAX_FLD_HED, 1) :: DWFdHd(MAXFLD) = [(" ", i = 1, MAXFLD)] - ! { dg-error "no IMPLICIT type" "" { target *-*-* } 12 } - ! { dg-error "specification expression" "" { target *-*-* } 12 } + ! { dg-error "no IMPLICIT type" "" { target *-*-* } 13 } + ! { dg-error "specification expression" "" { target *-*-* } 13 } END TYPE TWindowData END MODULE WinData diff --git a/gcc/testsuite/gfortran.dg/array_constructor_27.f03 b/gcc/testsuite/gfortran.dg/array_constructor_27.f03 index 6cd4d62dac7..8068364ce4a 100644 --- a/gcc/testsuite/gfortran.dg/array_constructor_27.f03 +++ b/gcc/testsuite/gfortran.dg/array_constructor_27.f03 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=gnu" } ! PR fortran/36492 ! Check for incorrect error message with -std=f2003. @@ -8,8 +9,8 @@ implicit none type t character (a) :: arr (1) = [ "a" ] - ! { dg-error "no IMPLICIT type" "" { target *-*-* } 10 } - ! { dg-error "specification expression" "" { target *-*-* } 10 } + ! { dg-error "no IMPLICIT type" "" { target *-*-* } 11 } + ! { dg-error "specification expression" "" { target *-*-* } 11 } end type t end diff --git a/gcc/testsuite/gfortran.dg/bind_c_18.f90 b/gcc/testsuite/gfortran.dg/bind_c_18.f90 new file mode 100644 index 00000000000..6360f01aacc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bind_c_18.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! PR fortran/37201 +! +! Before character arrays were allowed as bind(C) return value. +! +implicit none + INTERFACE + FUNCTION my() BIND(C,name="my") RESULT(r) ! { dg-error "cannot be an array" } + USE iso_c_binding + CHARACTER(kind=C_CHAR) :: r(10) + END FUNCTION + END INTERFACE + INTERFACE + FUNCTION two() BIND(C,name="two") RESULT(r) ! { dg-error "cannot be a character string" } + USE iso_c_binding + CHARACTER(kind=C_CHAR,len=2) :: r + END FUNCTION + END INTERFACE +END diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_17.f90 b/gcc/testsuite/gfortran.dg/bind_c_usage_17.f90 new file mode 100644 index 00000000000..ba342755c38 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bind_c_usage_17.f90 @@ -0,0 +1,38 @@ +! { dg-do run } +! { dg-additional-sources bind_c_usage_17_c.c } +! +! PR fortran/37201 +! +! +! +MODULE mod + INTERFACE + FUNCTION cdir() BIND(C,name="cdir") RESULT(r) + USE iso_c_binding + CHARACTER(kind=C_CHAR) :: r + END FUNCTION + END INTERFACE +END MODULE + +PROGRAM test + USE mod + integer :: i = -43 + character(len=1) :: str1 + character(len=4) :: str4 + str1 = 'x' + str4 = 'xyzz' + str1 = cdir() + if(str1 /= '/') call abort() + str4 = cdir() + if(str4 /= '/' .or. ichar(str4(2:2)) /= 32) call abort() + i = ICHAR(cdir()) + if (i /= 47) call abort() + str4 = 'xyzz' + WRITE(str4,'(a)') cdir() + if(str4 /= '/' .or. ichar(str4(2:2)) /= 32) call abort() + str4 = 'xyzz' + WRITE(str4,'(i0)') ICHAR(cdir()) + if(str4 /= '47' .or. ichar(str4(3:3)) /= 32) call abort() +END PROGRAM + +! { dg-final { cleanup-modules "mod" } } diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_17_c.c b/gcc/testsuite/gfortran.dg/bind_c_usage_17_c.c new file mode 100644 index 00000000000..456d542af8d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/bind_c_usage_17_c.c @@ -0,0 +1,4 @@ +/* PR fortran/37201. + Linked with bind_c_usage_17.f90. */ + +char cdir(void){return '/';} diff --git a/gcc/testsuite/gfortran.dg/blockdata_4.f90 b/gcc/testsuite/gfortran.dg/blockdata_4.f90 index 18836bcacd0..5cf3d1f42fb 100644 --- a/gcc/testsuite/gfortran.dg/blockdata_4.f90 +++ b/gcc/testsuite/gfortran.dg/blockdata_4.f90 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=gnu" } ! PR33152 Initialization/declaration problems in block data ! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org> blockdata bab diff --git a/gcc/testsuite/gfortran.dg/bound_2.f90 b/gcc/testsuite/gfortran.dg/bound_2.f90 index 5c4026b54e2..3b99a1f5471 100644 --- a/gcc/testsuite/gfortran.dg/bound_2.f90 +++ b/gcc/testsuite/gfortran.dg/bound_2.f90 @@ -1,4 +1,5 @@ ! { dg-do run } +! { dg-options "-std=gnu" } ! PR fortran/29391 ! This file is here to check that LBOUND and UBOUND return correct values ! @@ -165,7 +166,7 @@ contains subroutine sub1(a,n) - integer :: a(2:n+1,4:*), n + integer :: n, a(2:n+1,4:*) if (any([lbound(a,1), lbound(a,2)] /= [2, 4])) call abort if (any(lbound(a) /= [2, 4])) call abort diff --git a/gcc/testsuite/gfortran.dg/char_cshift_3.f90 b/gcc/testsuite/gfortran.dg/char_cshift_3.f90 new file mode 100644 index 00000000000..80c0ede3a27 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/char_cshift_3.f90 @@ -0,0 +1,13 @@ +! { dg-do run } +! PR 36886 - misalignment of characters for cshift could cause +! problems on some architectures. +program main + character(len=2) :: c2 + character(len=4), dimension(2,2) :: a, b, c, d + ! Force misalignment of a or b + common /foo/ a, c, c2, b, d + a = 'aa' + b = 'bb' + d = cshift(b,1) + c = cshift(a,1) +end program main diff --git a/gcc/testsuite/gfortran.dg/char_eoshift_5.f90 b/gcc/testsuite/gfortran.dg/char_eoshift_5.f90 index 93c701a4f1b..a3bbd40d52b 100644 --- a/gcc/testsuite/gfortran.dg/char_eoshift_5.f90 +++ b/gcc/testsuite/gfortran.dg/char_eoshift_5.f90 @@ -22,3 +22,4 @@ END ! Check that _gfortran_eoshift* is called with 8 arguments: ! { dg-final { scan-tree-dump "_gfortran_eoshift\[0-9_\]+char \\(\[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*, \[&a-zA-Z0-9._\]*\\)" "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/conflicts.f90 b/gcc/testsuite/gfortran.dg/conflicts.f90 index b1b59f4ac4c..1f10a65ceed 100644 --- a/gcc/testsuite/gfortran.dg/conflicts.f90 +++ b/gcc/testsuite/gfortran.dg/conflicts.f90 @@ -2,16 +2,16 @@ ! Check for conflicts ! PR fortran/29657 -function f1() ! { dg-error "has no IMPLICIT type" } +function f1() ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" } implicit none - real, save :: f1 ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" } + real, save :: f1 f1 = 1.0 end function f1 -function f2() +function f2() ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" } implicit none real :: f2 - save f2 ! { dg-error "PROCEDURE attribute conflicts with SAVE attribute" } + save f2 f2 = 1.0 end function f2 diff --git a/gcc/testsuite/gfortran.dg/cshift_nan_1.f90 b/gcc/testsuite/gfortran.dg/cshift_nan_1.f90 new file mode 100644 index 00000000000..896ecb3a4e1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/cshift_nan_1.f90 @@ -0,0 +1,24 @@ +! { dg-do run } +! Test cshift where the values are eight bytes, +! but are aligned on a four-byte boundary. The +! integers correspond to NaN values. +program main + implicit none + integer :: i + type t + sequence + integer :: a,b + end type t + type(t), dimension(4) :: u,v + common /foo/ u, i, v + + u(1)%a = 2142240768 + u(2)%a = 2144337920 + u(3)%a = -5242880 + u(4)%a = -3145728 + u%b = (/(i,i=-1,-4,-1)/) + v(1:3:2) = cshift(u(1:3:2),1) + v(2:4:2) = cshift(u(2:4:2),-1) + if (any(v%a /= (/-5242880, -3145728, 2142240768, 2144337920 /))) call abort + if (any(v%b /= (/-3, -4, -1, -2/))) call abort +end program main diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f index 0203d134a62..d5003a3fc36 100644 --- a/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f +++ b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f @@ -27,11 +27,11 @@ C { dg-options "-dA" } C { dg-final { scan-assembler "(DIE.*DW_TAG_common_block)" } } C { dg-final { scan-assembler "DW_AT_name: \"__BLNK__\"" } } -C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } } +C { dg-final { scan-assembler "(DIE.*DW_TAG_variable)" } } C { dg-final { scan-assembler "\"i.*\".*DW_AT_name" } } C { dg-final { scan-assembler "\"j.*\".*DW_AT_name" } } C { dg-final { scan-assembler "(DIE.*DW_TAG_common_block)" } } C { dg-final { scan-assembler "DW_AT_name: \"label\"" } } -C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } } +C { dg-final { scan-assembler "(DIE.*DW_TAG_variable)" } } C { dg-final { scan-assembler "\"l.*\".*DW_AT_name" } } C { dg-final { scan-assembler "\"m.*\".*DW_AT_name" } } diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_1.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_1.f90 new file mode 100644 index 00000000000..c76c45d18e0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/duplicate_type_1.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! { dg-options "-std=f95" } + +! PR fortran/30239 +! Check for errors when a symbol gets declared a type twice, even if it +! is the same. + +INTEGER FUNCTION foo () + IMPLICIT NONE + INTEGER :: foo ! { dg-error "basic type of" } + INTEGER :: foo ! { dg-error "basic type of" } + foo = 42 +END FUNCTION foo + +INTEGER FUNCTION bar () RESULT (x) + IMPLICIT NONE + INTEGER :: x ! { dg-error "basic type of" } + + INTEGER :: y + INTEGER :: y ! { dg-error "basic type of" } + + x = 42 +END FUNCTION bar diff --git a/gcc/testsuite/gfortran.dg/duplicate_type_2.f90 b/gcc/testsuite/gfortran.dg/duplicate_type_2.f90 new file mode 100644 index 00000000000..5b86dc6e775 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/duplicate_type_2.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! { dg-options "-std=gnu -Wsurprising" } + +! PR fortran/30239 +! Check for errors when a symbol gets declared a type twice, even if it +! is the same. + +INTEGER FUNCTION foo () + IMPLICIT NONE + INTEGER :: foo ! { dg-warning "basic type of" } + INTEGER :: foo ! { dg-warning "basic type of" } + foo = 42 +END FUNCTION foo + +INTEGER FUNCTION bar () RESULT (x) + IMPLICIT NONE + INTEGER :: x ! { dg-warning "basic type of" } + + INTEGER :: y + INTEGER :: y ! { dg-error "basic type of" } + + x = 42 +END FUNCTION bar diff --git a/gcc/testsuite/gfortran.dg/extends_7.f03 b/gcc/testsuite/gfortran.dg/extends_7.f03 new file mode 100644 index 00000000000..ebb2fcc3efb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/extends_7.f03 @@ -0,0 +1,25 @@ +! { dg-do compile } +! Check for re-definition of inherited components in the sub-type. + +MODULE m1 + IMPLICIT NONE + + TYPE supert + INTEGER :: c1 + INTEGER, PRIVATE :: c2 + END TYPE supert + +END MODULE m1 + +MODULE m2 + USE m1 ! { dg-error "already in the parent type" } + IMPLICIT NONE + + TYPE, EXTENDS(supert) :: subt + INTEGER :: c1 ! { dg-error "already in the parent type" } + INTEGER :: c2 ! { dg-error "already in the parent type" } + END TYPE subt + +END MODULE m2 + +! { dg-final { cleanup-modules "m1 m2" } } diff --git a/gcc/testsuite/gfortran.dg/finalize_5.f03 b/gcc/testsuite/gfortran.dg/finalize_5.f03 index 9f5dc1784d0..1df2d8cf285 100644 --- a/gcc/testsuite/gfortran.dg/finalize_5.f03 +++ b/gcc/testsuite/gfortran.dg/finalize_5.f03 @@ -9,7 +9,7 @@ MODULE final_type TYPE :: mytype INTEGER, ALLOCATABLE :: fooarr(:) REAL :: foobar - FINAL :: finalize_matrix ! { dg-error "must be inside CONTAINS" } + FINAL :: finalize_matrix ! { dg-error "must be inside a derived type" } CONTAINS FINAL :: ! { dg-error "Empty FINAL" } FINAL ! { dg-error "Empty FINAL" } diff --git a/gcc/testsuite/gfortran.dg/index_2.f90 b/gcc/testsuite/gfortran.dg/index_2.f90 index 9b92f0acee7..74845b96656 100644 --- a/gcc/testsuite/gfortran.dg/index_2.f90 +++ b/gcc/testsuite/gfortran.dg/index_2.f90 @@ -53,3 +53,4 @@ ! { dg-final { scan-tree-dump-times "if ..integer.kind=1.. _gfortran_string_index" 6 "original" } } ! { dg-final { scan-tree-dump-times "if ..integer.kind=1.. _gfortran_string_scan" 6 "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 index efb1dce5456..8f406fecaa8 100644 --- a/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 +++ b/gcc/testsuite/gfortran.dg/intrinsic_std_1.f90 @@ -46,3 +46,4 @@ END SUBROUTINE intrinsic_decl ! { dg-final { scan-tree-dump " abort " "original" } } ! { dg-final { scan-tree-dump " asinh " "original" } } ! { dg-final { scan-tree-dump " acosh " "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc/testsuite/gfortran.dg/ldist-1.f90 b/gcc/testsuite/gfortran.dg/ldist-1.f90 index a4771e9b5cf..dd1f02a176b 100644 --- a/gcc/testsuite/gfortran.dg/ldist-1.f90 +++ b/gcc/testsuite/gfortran.dg/ldist-1.f90 @@ -29,6 +29,5 @@ Subroutine PADEC(DKS,DKDS,HVAR,WM,WG,FN,NS,AN,BN,CN,IT) return end Subroutine PADEC -! { dg-final { scan-tree-dump-times "distributed: split to 4 loops" 1 "ldist" { target ilp32 } } } -! { dg-final { scan-tree-dump-times "distributed: split to 5 loops" 1 "ldist" { target lp64 } } } +! { dg-final { scan-tree-dump-times "distributed: split to 4 loops" 1 "ldist" } } ! { dg-final { cleanup-tree-dump "ldist" } } diff --git a/gcc/testsuite/gfortran.dg/namelist_53.f90 b/gcc/testsuite/gfortran.dg/namelist_53.f90 new file mode 100644 index 00000000000..d4fdf574e0e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_53.f90 @@ -0,0 +1,9 @@ +! { dg-do run } +! PR36895 Namelist writing to internal files + character(30) :: line + namelist /stuff/ n + n = 123 + line = "" + write(line,nml=stuff) + if (line.ne."&STUFF N= 123, /") call abort + end diff --git a/gcc/testsuite/gfortran.dg/proc_decl_1.f90 b/gcc/testsuite/gfortran.dg/proc_decl_1.f90 index 3e7a3d18fb7..219722f7a2d 100644 --- a/gcc/testsuite/gfortran.dg/proc_decl_1.f90 +++ b/gcc/testsuite/gfortran.dg/proc_decl_1.f90 @@ -53,13 +53,13 @@ program prog contains - subroutine foo(a,c) + subroutine foo(a,c) ! { dg-error "PROCEDURE attribute conflicts with INTENT attribute" } abstract interface subroutine b() bind(C) end subroutine b end interface procedure(b), bind(c,name="hjj") :: a ! { dg-error "may not have BIND.C. attribute with NAME" } - procedure(c),intent(in):: c ! { dg-error "PROCEDURE attribute conflicts with INTENT attribute" } + procedure(b),intent(in):: c end subroutine foo end program diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_10.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_10.f90 new file mode 100644 index 00000000000..0ceedaa2dff --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_10.f90 @@ -0,0 +1,30 @@ +! { dg-do run } +! +! PR fortran/37253 +! +! Contributed by Dominique d'Humieres <dominiq@lps.ens.fr> + +module myMod + + CONTAINS + + real function proc3( arg1 ) + integer :: arg1 + proc3 = arg1+7 + end function proc3 + + subroutine proc4( arg1 ) + procedure(real), pointer :: arg1 + if (arg1(0)/=7) call abort() + end subroutine proc4 + +end module myMod + +program myProg + use myMod + PROCEDURE (real), POINTER :: p => NULL() + p => proc3 + call proc4( p ) +end program myProg + +! { dg-final { cleanup-modules "myMod" } } diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_9.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_9.f90 new file mode 100644 index 00000000000..22708b8f1a8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/proc_ptr_9.f90 @@ -0,0 +1,18 @@ +! { dg-do compile } +! +! PR fortran/36705 +! +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> + +save :: p +procedure() :: p +pointer :: p + +contains + +subroutine bar(x) + procedure(), intent(in) :: x + pointer :: x +end subroutine bar + +end diff --git a/gcc/testsuite/gfortran.dg/rank_1.f90 b/gcc/testsuite/gfortran.dg/rank_1.f90 index 3467faded2b..6a81e410bd5 100644 --- a/gcc/testsuite/gfortran.dg/rank_1.f90 +++ b/gcc/testsuite/gfortran.dg/rank_1.f90 @@ -4,6 +4,7 @@ ! Fortran < 2008 allows 7 dimensions ! Fortran 2008 allows 15 dimensions (including co-array ranks) ! -integer :: a(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) -integer :: b(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ! { dg-error "has more than 15 dimensions" } +! FIXME: Rank patch was reverted because of PR 36825. +integer :: a(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) ! { dg-error "has more than 7 dimensions" } +integer :: b(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ! { dg-error "has more than 7 dimensions" } end diff --git a/gcc/testsuite/gfortran.dg/result_in_spec_1.f90 b/gcc/testsuite/gfortran.dg/result_in_spec_1.f90 index 292bc3c93be..cbeb60f2d82 100644 --- a/gcc/testsuite/gfortran.dg/result_in_spec_1.f90 +++ b/gcc/testsuite/gfortran.dg/result_in_spec_1.f90 @@ -35,8 +35,8 @@ program test if (any (myfunc (test2(1)) .ne. "ABC")) call abort () contains function myfunc (ch) result (chr) - character(len(ch)) :: chr(4) character (*) :: ch(:) + character(len(ch)) :: chr(4) if (len (ch) .ne. 3) call abort () if (any (ch .ne. "ABC")) call abort () chr = test2 (1) diff --git a/gcc/testsuite/gfortran.dg/typebound_call_1.f03 b/gcc/testsuite/gfortran.dg/typebound_call_1.f03 new file mode 100644 index 00000000000..d0da0ecd994 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_1.f03 @@ -0,0 +1,98 @@ +! { dg-do run } + +! Type-bound procedures +! Check basic calls to NOPASS type-bound procedures. + +MODULE m + IMPLICIT NONE + + TYPE add + CONTAINS + PROCEDURE, NOPASS :: func => func_add + PROCEDURE, NOPASS :: sub => sub_add + PROCEDURE, NOPASS :: echo => echo_add + END TYPE add + + TYPE mul + CONTAINS + PROCEDURE, NOPASS :: func => func_mul + PROCEDURE, NOPASS :: sub => sub_mul + PROCEDURE, NOPASS :: echo => echo_mul + END TYPE mul + +CONTAINS + + INTEGER FUNCTION func_add (a, b) + IMPLICIT NONE + INTEGER :: a, b + func_add = a + b + END FUNCTION func_add + + INTEGER FUNCTION func_mul (a, b) + IMPLICIT NONE + INTEGER :: a, b + func_mul = a * b + END FUNCTION func_mul + + SUBROUTINE sub_add (a, b, c) + IMPLICIT NONE + INTEGER, INTENT(IN) :: a, b + INTEGER, INTENT(OUT) :: c + c = a + b + END SUBROUTINE sub_add + + SUBROUTINE sub_mul (a, b, c) + IMPLICIT NONE + INTEGER, INTENT(IN) :: a, b + INTEGER, INTENT(OUT) :: c + c = a * b + END SUBROUTINE sub_mul + + SUBROUTINE echo_add () + IMPLICIT NONE + WRITE (*,*) "Hi from adder!" + END SUBROUTINE echo_add + + INTEGER FUNCTION echo_mul () + IMPLICIT NONE + echo_mul = 5 + WRITE (*,*) "Hi from muler!" + END FUNCTION echo_mul + + ! Do the testing here, in the same module as the type is. + SUBROUTINE test () + IMPLICIT NONE + + TYPE(add) :: adder + TYPE(mul) :: muler + + INTEGER :: x + + IF (adder%func (2, 3) /= 5 .OR. muler%func (2, 3) /= 6) THEN + CALL abort () + END IF + + CALL adder%sub (2, 3, x) + IF (x /= 5) THEN + CALL abort () + END IF + + CALL muler%sub (2, 3, x) + IF (x /= 6) THEN + CALL abort () + END IF + + ! Check procedures without arguments. + CALL adder%echo () + x = muler%echo () + CALL adder%echo + END SUBROUTINE test + +END MODULE m + +PROGRAM main + USE m, ONLY: test + CALL test () +END PROGRAM main + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_2.f03 b/gcc/testsuite/gfortran.dg/typebound_call_2.f03 new file mode 100644 index 00000000000..d3149d56d39 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_2.f03 @@ -0,0 +1,93 @@ +! { dg-do run } + +! FIXME: Remove -w after polymorphic entities are supported. +! { dg-options "-w" } + +! Type-bound procedures +! Check calls with passed-objects. + +MODULE m + IMPLICIT NONE + + TYPE add + INTEGER :: wrong + INTEGER :: val + CONTAINS + PROCEDURE, PASS :: func => func_add + PROCEDURE, PASS(me) :: sub => sub_add + END TYPE add + + TYPE trueOrFalse + LOGICAL :: val + CONTAINS + PROCEDURE, PASS :: swap + END TYPE trueOrFalse + +CONTAINS + + INTEGER FUNCTION func_add (me, x) + IMPLICIT NONE + TYPE(add) :: me + INTEGER :: x + func_add = me%val + x + END FUNCTION func_add + + SUBROUTINE sub_add (res, me, x) + IMPLICIT NONE + INTEGER, INTENT(OUT) :: res + TYPE(add), INTENT(IN) :: me + INTEGER, INTENT(IN) :: x + res = me%val + x + END SUBROUTINE sub_add + + SUBROUTINE swap (me1, me2) + IMPLICIT NONE + TYPE(trueOrFalse), INTENT(INOUT) :: me1, me2 + + IF (.NOT. me1%val .OR. me2%val) THEN + CALL abort () + END IF + + me1%val = .FALSE. + me2%val = .TRUE. + END SUBROUTINE swap + + ! Do the testing here, in the same module as the type is. + SUBROUTINE test () + IMPLICIT NONE + + TYPE(add) :: adder + TYPE(trueOrFalse) :: t, f + + INTEGER :: x + + adder%wrong = 0 + adder%val = 42 + IF (adder%func (8) /= 50) THEN + CALL abort () + END IF + + CALL adder%sub (x, 8) + IF (x /= 50) THEN + CALL abort () + END IF + + t%val = .TRUE. + f%val = .FALSE. + + CALL t%swap (f) + CALL f%swap (t) + + IF (.NOT. t%val .OR. f%val) THEN + CALL abort () + END IF + END SUBROUTINE test + +END MODULE m + +PROGRAM main + USE m, ONLY: test + CALL test () +END PROGRAM main + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_3.f03 b/gcc/testsuite/gfortran.dg/typebound_call_3.f03 new file mode 100644 index 00000000000..f06e1cb70f4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_3.f03 @@ -0,0 +1,51 @@ +! { dg-do run } + +! FIXME: Remove -w after polymorphic entities are supported. +! { dg-options "-w" } + +! Type-bound procedures +! Check that calls work across module-boundaries. + +MODULE m + IMPLICIT NONE + + TYPE trueOrFalse + LOGICAL :: val + CONTAINS + PROCEDURE, PASS :: swap + END TYPE trueOrFalse + +CONTAINS + + SUBROUTINE swap (me1, me2) + IMPLICIT NONE + TYPE(trueOrFalse), INTENT(INOUT) :: me1, me2 + + IF (.NOT. me1%val .OR. me2%val) THEN + CALL abort () + END IF + + me1%val = .FALSE. + me2%val = .TRUE. + END SUBROUTINE swap + +END MODULE m + +PROGRAM main + USE m, ONLY: trueOrFalse + IMPLICIT NONE + + TYPE(trueOrFalse) :: t, f + + t%val = .TRUE. + f%val = .FALSE. + + CALL t%swap (f) + CALL f%swap (t) + + IF (.NOT. t%val .OR. f%val) THEN + CALL abort () + END IF +END PROGRAM main + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_4.f03 b/gcc/testsuite/gfortran.dg/typebound_call_4.f03 new file mode 100644 index 00000000000..d05838bfb27 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_4.f03 @@ -0,0 +1,58 @@ +! { dg-do compile } + +! FIXME: Remove -w after polymorphic entities are supported. +! { dg-options "-w" } + +! Type-bound procedures +! Check for recognition/errors with more complicated references and some +! error-handling in general. + +MODULE m + IMPLICIT NONE + + TYPE t + CONTAINS + PROCEDURE, PASS :: proc + PROCEDURE, NOPASS :: func + END TYPE t + + TYPE compt + TYPE(t) :: myobj + END TYPE compt + +CONTAINS + + SUBROUTINE proc (me) + IMPLICIT NONE + TYPE(t), INTENT(INOUT) :: me + END SUBROUTINE proc + + INTEGER FUNCTION func () + IMPLICIT NONE + func = 1812 + END FUNCTION func + + SUBROUTINE test () + IMPLICIT NONE + TYPE(compt) :: arr(2) + + ! These two are OK. + CALL arr(1)%myobj%proc () + WRITE (*,*) arr(2)%myobj%func () + + ! Base-object must be scalar. + CALL arr(:)%myobj%proc () ! { dg-error "scalar" } + WRITE (*,*) arr(:)%myobj%func () ! { dg-error "scalar" } + + ! Can't CALL a function or take the result of a SUBROUTINE. + CALL arr(1)%myobj%func () ! { dg-error "SUBROUTINE" } + WRITE (*,*) arr(2)%myobj%proc () ! { dg-error "FUNCTION" } + + ! Error. + CALL arr(2)%myobj%proc () x ! { dg-error "Junk after" } + WRITE (*,*) arr(1)%myobj%func ! { dg-error "Expected argument list" } + END SUBROUTINE test + +END MODULE m + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_5.f03 b/gcc/testsuite/gfortran.dg/typebound_call_5.f03 new file mode 100644 index 00000000000..d9a845b073b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_5.f03 @@ -0,0 +1,41 @@ +! { dg-do compile } + +! Type-bound procedures +! Check for correct access-checking on type-bound procedures. + +MODULE m + IMPLICIT NONE + + TYPE t + CONTAINS + PROCEDURE, NOPASS, PRIVATE :: priv => proc + PROCEDURE, NOPASS, PUBLIC :: publ => proc + END TYPE t + +CONTAINS + + SUBROUTINE proc () + END SUBROUTINE proc + + ! This is inside the module. + SUBROUTINE test1 () + IMPLICIT NONE + TYPE(t) :: obj + + CALL obj%priv () ! { dg-bogus "PRIVATE" } + CALL obj%publ () + END SUBROUTINE test1 + +END MODULE m + +! This is outside the module. +SUBROUTINE test2 () + USE m + IMPLICIT NONE + TYPE(t) :: obj + + CALL obj%priv () ! { dg-error "PRIVATE" } + CALL obj%publ () +END SUBROUTINE test2 + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_call_6.f03 b/gcc/testsuite/gfortran.dg/typebound_call_6.f03 new file mode 100644 index 00000000000..0ad510edaed --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_call_6.f03 @@ -0,0 +1,45 @@ +! { dg-do run } +! { dg-output "Super(\n|\r\n|\r).*Sub" } + +! Type-bound procedures +! Check for calling right overloaded procedure. + +MODULE m + IMPLICIT NONE + + TYPE supert + CONTAINS + PROCEDURE, NOPASS :: proc => proc_super + END TYPE supert + + TYPE, EXTENDS(supert) :: subt + CONTAINS + PROCEDURE, NOPASS :: proc => proc_sub + END TYPE subt + +CONTAINS + + SUBROUTINE proc_super () + IMPLICIT NONE + WRITE (*,*) "Super" + END SUBROUTINE proc_super + + SUBROUTINE proc_sub () + IMPLICIT NONE + WRITE (*,*) "Sub" + END SUBROUTINE proc_sub + +END MODULE m + +PROGRAM main + USE m + IMPLICIT NONE + + TYPE(supert) :: super + TYPE(subt) :: sub + + CALL super%proc + CALL sub%proc +END PROGRAM main + +! { dg-final { cleanup-modules "m" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_1.f08 b/gcc/testsuite/gfortran.dg/typebound_proc_1.f08 new file mode 100644 index 00000000000..dafd684718b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_1.f08 @@ -0,0 +1,72 @@ +! { dg-do compile } + +! FIXME: Remove -w after polymorphic entities are supported. +! { dg-options "-w" } + +! Type-bound procedures +! Test that the basic syntax for specific bindings is parsed and resolved. + +MODULE othermod + IMPLICIT NONE + +CONTAINS + + SUBROUTINE othersub () + IMPLICIT NONE + END SUBROUTINE othersub + +END MODULE othermod + +MODULE testmod + USE othermod + IMPLICIT NONE + + TYPE t1 + ! Might be empty + CONTAINS + PROCEDURE proc1 + PROCEDURE, PASS(me) :: p2 => proc2 + END TYPE t1 + + TYPE t2 + INTEGER :: x + CONTAINS + PRIVATE + PROCEDURE, NOPASS, PRIVATE :: othersub + PROCEDURE,NON_OVERRIDABLE,PUBLIC,PASS :: proc3 + END TYPE t2 + + TYPE t3 + CONTAINS + ! This might be empty for Fortran 2008 + END TYPE t3 + + TYPE t4 + CONTAINS + PRIVATE + ! Empty, too + END TYPE t4 + +CONTAINS + + SUBROUTINE proc1 (me) + IMPLICIT NONE + TYPE(t1) :: me + END SUBROUTINE proc1 + + REAL FUNCTION proc2 (x, me) + IMPLICIT NONE + REAL :: x + TYPE(t1) :: me + proc2 = x / 2 + END FUNCTION proc2 + + INTEGER FUNCTION proc3 (me) + IMPLICIT NONE + TYPE(t2) :: me + proc3 = 42 + END FUNCTION proc3 + +END MODULE testmod + +! { dg-final { cleanup-modules "testmod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_2.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_2.f90 new file mode 100644 index 00000000000..70ae2ca7323 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_2.f90 @@ -0,0 +1,34 @@ +! { dg-do compile } +! { dg-options "-std=f95" } + +! Type-bound procedures +! Test that F95 does not allow type-bound procedures + +MODULE testmod + IMPLICIT NONE + + TYPE t + INTEGER :: x + CONTAINS ! { dg-error "Fortran 2003" } + PROCEDURE proc1 ! { dg-error "Fortran 2003" } + PROCEDURE :: proc2 => p2 ! { dg-error "Fortran 2003" } + END TYPE t + +CONTAINS + + SUBROUTINE proc1 (me) + IMPLICIT NONE + TYPE(t1) :: me + END SUBROUTINE proc1 + + REAL FUNCTION proc2 (me, x) + IMPLICIT NONE + TYPE(t1) :: me + REAL :: x + proc2 = x / 2 + END FUNCTION proc2 + +END MODULE testmod + +! { dg-final { cleanup-modules "testmod" } } +! { dg-excess-errors "no IMPLICIT type" } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_3.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_3.f03 new file mode 100644 index 00000000000..13b90c14f29 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_3.f03 @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } + +! Type-bound procedures +! Test that F2003 does not allow empty CONTAINS sections. + +MODULE testmod + IMPLICIT NONE + + TYPE t + INTEGER :: x + CONTAINS + END TYPE t ! { dg-error "Fortran 2008" } + +END MODULE testmod + +! { dg-final { cleanup-modules "testmod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_4.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_4.f03 new file mode 100644 index 00000000000..bf5be562776 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_4.f03 @@ -0,0 +1,43 @@ +! { dg-do compile } + +! Type-bound procedures +! Test for errors in specific bindings, during parsing (not resolution). + +MODULE testmod + IMPLICIT NONE + + TYPE t + REAL :: a + CONTAINS + PROCEDURE p0 ! { dg-error "no IMPLICIT|module procedure" } + PRIVATE ! { dg-error "must precede" } + PROCEDURE p1 => proc1 ! { dg-error "::" } + PROCEDURE :: ! { dg-error "Expected binding name" } + PROCEDURE ! { dg-error "Expected binding name" } + PROCEDURE ? ! { dg-error "Expected binding name" } + PROCEDURE :: p2 => ! { dg-error "Expected binding target" } + PROCEDURE :: p3 =>, ! { dg-error "Expected binding target" } + PROCEDURE p4, ! { dg-error "Junk after" } + PROCEDURE :: p5 => proc2, ! { dg-error "Junk after" } + PROCEDURE :: p0 => proc3 ! { dg-error "already a procedure" } + PROCEDURE, PASS p6 ! { dg-error "::" } + PROCEDURE, PASS NON_OVERRIDABLE ! { dg-error "Expected" } + PROCEDURE PASS :: ! { dg-error "Junk after" } + PROCEDURE, PASS (x ! { dg-error "Expected" } + PROCEDURE, PASS () ! { dg-error "Expected" } + PROCEDURE, NOPASS, PASS ! { dg-error "illegal PASS" } + PROCEDURE, PASS, NON_OVERRIDABLE, PASS(x) ! { dg-error "illegal PASS" } + PROCEDURE, PUBLIC, PRIVATE ! { dg-error "Duplicate" } + PROCEDURE, NON_OVERRIDABLE, NON_OVERRIDABLE ! { dg-error "Duplicate" } + PROCEDURE, NOPASS, NOPASS ! { dg-error "illegal NOPASS" } + + ! TODO: Correct these when things get implemented. + PROCEDURE, DEFERRED :: x ! { dg-error "not yet implemented" } + PROCEDURE(abc) ! { dg-error "abstract type" } + END TYPE t + +CONTAINS + +END MODULE testmod + +! { dg-final { cleanup-modules "testmod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_5.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_5.f03 new file mode 100644 index 00000000000..edc55a17d30 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_5.f03 @@ -0,0 +1,122 @@ +! { dg-do compile } + +! FIXME: Remove -w after polymorphic entities are supported. +! { dg-options "-w" } + +! Type-bound procedures +! Test for errors in specific bindings, during resolution. + +MODULE othermod + IMPLICIT NONE +CONTAINS + + REAL FUNCTION proc_noarg () + IMPLICIT NONE + END FUNCTION proc_noarg + +END MODULE othermod + +MODULE testmod + USE othermod + IMPLICIT NONE + + INTEGER :: noproc + + PROCEDURE() :: proc_nointf + + INTERFACE + SUBROUTINE proc_intf () + END SUBROUTINE proc_intf + END INTERFACE + + ABSTRACT INTERFACE + SUBROUTINE proc_abstract_intf () + END SUBROUTINE proc_abstract_intf + END INTERFACE + + TYPE supert + CONTAINS + PROCEDURE, NOPASS :: super_overrid => proc_sub_noarg + PROCEDURE, NOPASS, NON_OVERRIDABLE :: super_nonoverrid => proc_sub_noarg + END TYPE supert + + TYPE, EXTENDS(supert) :: t + CONTAINS + + ! Bindings that should succeed + PROCEDURE, NOPASS :: p0 => proc_noarg + PROCEDURE, PASS :: p1 => proc_arg_first + PROCEDURE proc_arg_first + PROCEDURE, PASS(me) :: p2 => proc_arg_middle + PROCEDURE, PASS(me), NON_OVERRIDABLE :: p3 => proc_arg_last + PROCEDURE, NOPASS :: p4 => proc_nome + PROCEDURE, NOPASS :: p5 => proc_intf + PROCEDURE, NOPASS :: super_overrid => proc_sub_noarg + + ! Bindings that should not succeed + PROCEDURE :: e0 => undefined ! { dg-error "has no IMPLICIT|module procedure" } + PROCEDURE, PASS :: e1 => proc_noarg ! { dg-error "at least one argument" } + PROCEDURE :: e2 => proc_noarg ! { dg-error "at least one argument" } + PROCEDURE, PASS(me) :: e3 => proc_nome ! { dg-error "no argument 'me'" } + PROCEDURE, PASS(me) :: e4 => proc_mewrong ! { dg-error "of the derived" } + PROCEDURE, PASS :: e5 => proc_mewrong ! { dg-error "of the derived" } + PROCEDURE :: e6 => noproc ! { dg-error "module procedure" } + PROCEDURE :: e7 => proc_nointf ! { dg-error "explicit interface" } + PROCEDURE, NOPASS :: e8 => proc_abstract_intf ! { dg-error "explicit interface" } + PROCEDURE :: super_nonoverrid => proc_arg_first ! { dg-error "NON_OVERRIDABLE" } + + END TYPE t + +CONTAINS + + SUBROUTINE proc_arg_first (me, x) + IMPLICIT NONE + TYPE(t) :: me + REAL :: x + END SUBROUTINE proc_arg_first + + INTEGER FUNCTION proc_arg_middle (x, me, y) + IMPLICIT NONE + REAL :: x, y + TYPE(t) :: me + END FUNCTION proc_arg_middle + + SUBROUTINE proc_arg_last (x, me) + IMPLICIT NONE + TYPE(t) :: me + REAL :: x + END SUBROUTINE proc_arg_last + + SUBROUTINE proc_nome (arg, x, y) + IMPLICIT NONE + TYPE(t) :: arg + REAL :: x, y + END SUBROUTINE proc_nome + + SUBROUTINE proc_mewrong (me, x) + IMPLICIT NONE + REAL :: x + INTEGER :: me + END SUBROUTINE proc_mewrong + + SUBROUTINE proc_sub_noarg () + END SUBROUTINE proc_sub_noarg + +END MODULE testmod + +PROGRAM main + IMPLICIT NONE + + TYPE t + CONTAINS + PROCEDURE, NOPASS :: proc_no_module ! { dg-error "module procedure" } + END TYPE t + +CONTAINS + + SUBROUTINE proc_no_module () + END SUBROUTINE proc_no_module + +END PROGRAM main + +! { dg-final { cleanup-modules "othermod testmod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_6.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_6.f03 new file mode 100644 index 00000000000..e7d09a055f4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_6.f03 @@ -0,0 +1,183 @@ +! { dg-do compile } + +! FIXME: Remove -w after polymorphic entities are supported. +! { dg-options "-w" } + +! Type-bound procedures +! Test for the check if overriding methods "match" the overridden ones by their +! characteristics. + +MODULE testmod + IMPLICIT NONE + + TYPE supert + CONTAINS + + ! For checking the PURE/ELEMENTAL matching. + PROCEDURE, NOPASS :: pure1 => proc_pure + PROCEDURE, NOPASS :: pure2 => proc_pure + PROCEDURE, NOPASS :: nonpure => proc_sub + PROCEDURE, NOPASS :: elemental1 => proc_elemental + PROCEDURE, NOPASS :: elemental2 => proc_elemental + PROCEDURE, NOPASS :: nonelem1 => proc_nonelem + PROCEDURE, NOPASS :: nonelem2 => proc_nonelem + + ! Same number of arguments! + PROCEDURE, NOPASS :: three_args_1 => proc_threearg + PROCEDURE, NOPASS :: three_args_2 => proc_threearg + + ! For SUBROUTINE/FUNCTION/result checking. + PROCEDURE, NOPASS :: subroutine1 => proc_sub + PROCEDURE, NOPASS :: subroutine2 => proc_sub + PROCEDURE, NOPASS :: intfunction1 => proc_intfunc + PROCEDURE, NOPASS :: intfunction2 => proc_intfunc + PROCEDURE, NOPASS :: intfunction3 => proc_intfunc + + ! For access-based checks. + PROCEDURE, NOPASS, PRIVATE :: priv => proc_sub + PROCEDURE, NOPASS, PUBLIC :: publ1 => proc_sub + PROCEDURE, NOPASS, PUBLIC :: publ2 => proc_sub + + ! For passed-object dummy argument checks. + PROCEDURE, NOPASS :: nopass1 => proc_stme1 + PROCEDURE, NOPASS :: nopass2 => proc_stme1 + PROCEDURE, PASS :: pass1 => proc_stme1 + PROCEDURE, PASS(me) :: pass2 => proc_stme1 + PROCEDURE, PASS(me1) :: pass3 => proc_stmeme + + ! For corresponding dummy arguments. + PROCEDURE, PASS :: corresp1 => proc_stmeint + PROCEDURE, PASS :: corresp2 => proc_stmeint + PROCEDURE, PASS :: corresp3 => proc_stmeint + + END TYPE supert + + ! Checking for NON_OVERRIDABLE is in typebound_proc_5.f03. + + TYPE, EXTENDS(supert) :: t + CONTAINS + + ! For checking the PURE/ELEMENTAL matching. + PROCEDURE, NOPASS :: pure1 => proc_pure ! Ok, both pure. + PROCEDURE, NOPASS :: pure2 => proc_sub ! { dg-error "must also be PURE" } + PROCEDURE, NOPASS :: nonpure => proc_pure ! Ok, overridden not pure. + PROCEDURE, NOPASS :: elemental1 => proc_elemental ! Ok, both elemental. + PROCEDURE, NOPASS :: elemental2 => proc_nonelem ! { dg-error "must also be ELEMENTAL" } + PROCEDURE, NOPASS :: nonelem1 => proc_nonelem ! Ok, non elemental. + PROCEDURE, NOPASS :: nonelem2 => proc_elemental ! { dg-error "must not be ELEMENTAL" } + + ! Same number of arguments! + PROCEDURE, NOPASS :: three_args_1 => proc_threearg ! Ok. + PROCEDURE, NOPASS :: three_args_2 => proc_twoarg ! { dg-error "same number of formal arguments" } + + ! For SUBROUTINE/FUNCTION/result checking. + PROCEDURE, NOPASS :: subroutine1 => proc_sub ! Ok, both subroutines. + PROCEDURE, NOPASS :: subroutine2 => proc_intfunc ! { dg-error "must also be a SUBROUTINE" } + PROCEDURE, NOPASS :: intfunction1 => proc_intfunc ! Ok, matching functions. + PROCEDURE, NOPASS :: intfunction2 => proc_sub ! { dg-error "must also be a FUNCTION" } + PROCEDURE, NOPASS :: intfunction3 => proc_realfunc ! { dg-error "matching result types" } + + ! For access-based checks. + PROCEDURE, NOPASS, PUBLIC :: priv => proc_sub ! Ok, increases visibility. + PROCEDURE, NOPASS, PUBLIC :: publ1 => proc_sub ! Ok, both PUBLIC. + PROCEDURE, NOPASS, PRIVATE :: publ2 => proc_sub ! { dg-error "must not be PRIVATE" } + + ! For passed-object dummy argument checks. + PROCEDURE, NOPASS :: nopass1 => proc_stme1 ! Ok, both NOPASS. + PROCEDURE, PASS :: nopass2 => proc_tme1 ! { dg-error "must also be NOPASS" } + PROCEDURE, PASS :: pass1 => proc_tme1 ! Ok. + PROCEDURE, NOPASS :: pass2 => proc_stme1 ! { dg-error "must also be PASS" } + PROCEDURE, PASS(me2) :: pass3 => proc_tmeme ! { dg-error "same position" } + + ! For corresponding dummy arguments. + PROCEDURE, PASS :: corresp1 => proc_tmeint ! Ok. + PROCEDURE, PASS :: corresp2 => proc_tmeintx ! { dg-error "should be named 'a'" } + PROCEDURE, PASS :: corresp3 => proc_tmereal ! { dg-error "Types mismatch for dummy argument 'a'" } + + END TYPE t + +CONTAINS + + PURE SUBROUTINE proc_pure () + END SUBROUTINE proc_pure + + ELEMENTAL SUBROUTINE proc_elemental (arg) + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: arg + END SUBROUTINE proc_elemental + + SUBROUTINE proc_nonelem (arg) + IMPLICIT NONE + INTEGER, INTENT(INOUT) :: arg + END SUBROUTINE proc_nonelem + + SUBROUTINE proc_threearg (a, b, c) + IMPLICIT NONE + INTEGER :: a, b, c + END SUBROUTINE proc_threearg + + SUBROUTINE proc_twoarg (a, b) + IMPLICIT NONE + INTEGER :: a, b + END SUBROUTINE proc_twoarg + + SUBROUTINE proc_sub () + END SUBROUTINE proc_sub + + INTEGER FUNCTION proc_intfunc () + proc_intfunc = 42 + END FUNCTION proc_intfunc + + REAL FUNCTION proc_realfunc () + proc_realfunc = 42.0 + END FUNCTION proc_realfunc + + SUBROUTINE proc_stme1 (me, a) + IMPLICIT NONE + TYPE(supert) :: me + INTEGER :: a + END SUBROUTINE proc_stme1 + + SUBROUTINE proc_tme1 (me, a) + IMPLICIT NONE + TYPE(t) :: me + INTEGER :: a + END SUBROUTINE proc_tme1 + + SUBROUTINE proc_stmeme (me1, me2) + IMPLICIT NONE + TYPE(supert) :: me1, me2 + END SUBROUTINE proc_stmeme + + SUBROUTINE proc_tmeme (me1, me2) + IMPLICIT NONE + TYPE(t) :: me1, me2 + END SUBROUTINE proc_tmeme + + SUBROUTINE proc_stmeint (me, a) + IMPLICIT NONE + TYPE(supert) :: me + INTEGER :: a + END SUBROUTINE proc_stmeint + + SUBROUTINE proc_tmeint (me, a) + IMPLICIT NONE + TYPE(t) :: me + INTEGER :: a + END SUBROUTINE proc_tmeint + + SUBROUTINE proc_tmeintx (me, x) + IMPLICIT NONE + TYPE(t) :: me + INTEGER :: x + END SUBROUTINE proc_tmeintx + + SUBROUTINE proc_tmereal (me, a) + IMPLICIT NONE + TYPE(t) :: me + REAL :: a + END SUBROUTINE proc_tmereal + +END MODULE testmod + +! { dg-final { cleanup-modules "testmod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_7.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_7.f03 new file mode 100644 index 00000000000..ebf611e67e2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_7.f03 @@ -0,0 +1,32 @@ +! { dg-do compile } + +! Type-bound procedures +! Tests that SEQUENCE and BIND(C) types do not allow a type-bound procedure +! section. + +MODULE testmod + USE ISO_C_BINDING + IMPLICIT NONE + + TYPE sequencet + SEQUENCE + INTEGER :: a, b + CONTAINS ! { dg-error "SEQUENCE" } + PROCEDURE, NOPASS :: proc_noarg + END TYPE sequencet + + TYPE, BIND(C) :: bindct + INTEGER(c_int) :: a + REAL(c_float) :: b + CONTAINS ! { dg-error "BIND" } + PROCEDURE, NOPASS :: proc_noarg + END TYPE bindct + +CONTAINS + + SUBROUTINE proc_noarg () + END SUBROUTINE proc_noarg + +END MODULE testmod + +! { dg-final { cleanup-modules "testmod" } } diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_8.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_8.f03 new file mode 100644 index 00000000000..df7764d3474 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_proc_8.f03 @@ -0,0 +1,37 @@ +! { dg-do compile } + +! Type-bound procedures +! Test for name collision between type-bound procedures and components. + +MODULE testmod + IMPLICIT NONE + + TYPE t + REAL :: comp + CONTAINS + PROCEDURE, NOPASS :: comp => proc ! { dg-error "same name as a component" } + END TYPE t + + TYPE supert + INTEGER :: comp1 + CONTAINS + PROCEDURE, NOPASS :: comp2 => proc + END TYPE supert + + TYPE, EXTENDS(supert) :: subt1 + INTEGER :: comp2 ! { dg-error "same name" } + END TYPE subt1 + + TYPE, EXTENDS(supert) :: subt2 + CONTAINS + PROCEDURE, NOPASS :: comp1 => proc ! { dg-error "same name as an inherited component" } + END TYPE subt2 + +CONTAINS + + SUBROUTINE proc () + END SUBROUTINE proc + +END MODULE testmod + +! { dg-final { cleanup-modules "testmod" } } diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_1.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_1.f90 new file mode 100644 index 00000000000..972a1674298 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_before_typed_1.f90 @@ -0,0 +1,40 @@ +! { dg-do compile } +! { dg-options "-std=f95" } + +! PR fortran/32095 +! PR fortran/34228 +! Check that standards-conforming mode rejects uses of variables that +! are used before they are typed. + +SUBROUTINE test1 (n, arr, m, arr2, k, arr3, a) ! { dg-error "has no IMPLICIT" } + IMPLICIT NONE + + INTEGER :: arr(n) ! { dg-error "used before it is typed" } + INTEGER :: n + INTEGER :: m, arr2(m) ! { dg-bogus "used before it is typed" } + INTEGER, DIMENSION(k) :: arr3 ! { dg-error "used before it is typed" } + INTEGER :: k + CHARACTER(len=LEN(a)) :: a ! { dg-error "'a' is used before it is typed" } + + REAL(KIND=l) :: x ! { dg-error "has no IMPLICIT type" } + REAL(KIND=KIND(y)) :: y ! { dg-error "has no IMPLICIT type" } + + DATA str/'abc'/ ! { dg-error "used before it is typed" } + CHARACTER(len=3) :: str, str2 + DATA str2/'abc'/ ! { dg-bogus "used before it is typed" } +END SUBROUTINE test1 + +SUBROUTINE test2 (n, arr, m, arr2) + IMPLICIT INTEGER(a-z) + + INTEGER :: arr(n) + REAL :: n ! { dg-error "already has basic type" } + INTEGER :: m, arr2(m) ! { dg-bogus "already has an IMPLICIT type" } +END SUBROUTINE test2 + +SUBROUTINE test3 (n, arr, m, arr2) + IMPLICIT REAL(a-z) + + INTEGER :: arr(n) ! { dg-error "must be of INTEGER type" } + INTEGER :: m, arr2(m) ! { dg-bogus "must be of INTEGER type" } +END SUBROUTINE test3 diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_2.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_2.f90 new file mode 100644 index 00000000000..6f3031fcd7d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_before_typed_2.f90 @@ -0,0 +1,22 @@ +! { dg-do compile } +! { dg-options "-std=gnu" } + +! PR fortran/32095 +! PR fortran/34228 +! This program used to segfault, check this is fixed. +! Also check that -std=gnu behaves as expected. + +SUBROUTINE test1 (n, arr) + IMPLICIT NONE + + INTEGER :: arr(n) ! { dg-bogus "used before it is typed" } + INTEGER :: n + CHARACTER(len=LEN(a)) :: a ! { dg-error "used before it is typed" } +END SUBROUTINE test1 + +SUBROUTINE test2 () + IMPLICIT NONE + + DATA str/'abc'/ ! { dg-bogus "used before it is typed" } + CHARACTER(len=3) :: str +END SUBROUTINE test2 diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_3.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_3.f90 new file mode 100644 index 00000000000..ab1b2a91f0a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_before_typed_3.f90 @@ -0,0 +1,41 @@ +! { dg-do compile } +! { dg-options "-std=f95" } + +! PR fortran/32095 +! PR fortran/34228 +! Check for a special case when the return-type of a function is given outside +! its "body" and contains symbols defined inside. + +MODULE testmod + IMPLICIT REAL(a-z) + +CONTAINS + + CHARACTER(len=x) FUNCTION test1 (x) ! { dg-error "of INTEGER" } + IMPLICIT REAL(a-z) + INTEGER :: x ! { dg-error "already has basic type" } + test1 = "foobar" + END FUNCTION test1 + + CHARACTER(len=x) FUNCTION test2 (x) ! { dg-bogus "used before|of INTEGER" } + IMPLICIT INTEGER(a-z) + test2 = "foobar" + END FUNCTION test2 + +END MODULE testmod + +CHARACTER(len=i) FUNCTION test3 (i) ! { dg-bogus "used before|of INTEGER" } + ! i is IMPLICIT INTEGER by default + test3 = "foobar" +END FUNCTION test3 + +CHARACTER(len=g) FUNCTION test4 (g) ! { dg-error "of INTEGER" } + ! g is REAL, unless declared INTEGER. + test4 = "foobar" +END FUNCTION test4 + +! Test an empty function works, too. +INTEGER FUNCTION test5 () +END FUNCTION test5 + +! { dg-final { cleanup-modules "testmod" } } diff --git a/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 new file mode 100644 index 00000000000..9d7ccc10add --- /dev/null +++ b/gcc/testsuite/gfortran.dg/used_before_typed_4.f90 @@ -0,0 +1,26 @@ +! { dg-do compile } +! { dg-options "-std=f95" } + +! Test for a special case of the used-before-typed errors, when the symbols +! not-yet-typed are indices. + +SUBROUTINE test (n, arr1, m, arr2) ! { dg-error "has no IMPLICIT type" } + IMPLICIT NONE + + INTEGER :: myarr(42) + + INTEGER :: arr1(SIZE (myarr(1:n))) ! { dg-error "'n' is used before" } + INTEGER :: n + + INTEGER :: arr2(LEN ("hello"(1:m))) ! { dg-error "'m' is used before" } + INTEGER :: m + + WRITE (*,*) SIZE (arr1) + WRITE (*,*) SIZE (arr2) +END SUBROUTINE test + +PROGRAM main + IMPLICIT NONE + INTEGER :: arr1(42), arr2(42) + CALL test (3, arr1, 2, arr2) +END PROGRAM main diff --git a/gcc/testsuite/gfortran.dg/utf8_1.f03 b/gcc/testsuite/gfortran.dg/utf8_1.f03 new file mode 100644 index 00000000000..6c30885cce5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/utf8_1.f03 @@ -0,0 +1,31 @@ +! { dg-do run } +! { dg-options "-fbackslash" } +! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org> +program test1 + implicit none + integer, parameter :: k4 = 4 + character(kind=4, len=30) :: string1, string2 + character(kind=1, len=30) :: string3 + string1 = k4_"This is Greek: \u039f\u03cd\u03c7\u03af" + string2 = k4_"Jerry in Japanese is: \u30b8\u30a8\u30ea\u30fc" + open(10, encoding="utf-8", status="scratch") + write(10,'(a)') trim(string1) + write(10,*) string2 + rewind(10) + string1 = k4_"" + string2 = k4_"" + string3 = "abcdefghijklmnopqrstuvwxyz" + read(10,'(a)') string1 + read(10,'(a)') string2 + if (string1 /= k4_"This is Greek: \u039f\u03cd\u03c7\u03af") call abort + if (len(trim(string1)) /= 20) call abort + if (string2 /= k4_" Jerry in Japanese is: \u30b8\u30a8\u30ea\u30fc")& + & call abort + if (len(string2) /= 30) call abort + rewind(10) + read(10,'(a)') string3 + if (string3 /= "This is Greek: ????") call abort +end program test1 +! The following examples require UTF-8 enabled editor to see correctly. +! ジエリー Sample of Japanese characters. +! Οὐχὶ Sample of Greek characters.
\ No newline at end of file diff --git a/gcc/testsuite/gfortran.dg/utf8_2.f03 b/gcc/testsuite/gfortran.dg/utf8_2.f03 new file mode 100644 index 00000000000..0146a2e281b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/utf8_2.f03 @@ -0,0 +1,16 @@ +! { dg-do run } +! { dg-options "-fbackslash" } +! Contributed by Tobias Burnus +program test2 + integer,parameter :: ucs4 = selected_char_kind("iso_10646") + character(1,ucs4),parameter :: nen=char(int(z'5e74'),ucs4), & !year + gatsu=char(int(z'6708'),kind=ucs4), & !month + nichi=char(int(z'65e5'),kind=ucs4) !day + character(25,ucs4) :: string + open(10, encoding="utf-8", status="scratch") + write(10,1) 2008,nen,8,gatsu,10,nichi +1 format(i0,a,i0,a,i0,a) + rewind(10) + read(10,'(a)') string + if (string /= ucs4_"2008\u5e748\u670810\u65e5") call abort +end program test2 diff --git a/gcc/testsuite/gfortran.dg/widechar_8.f90 b/gcc/testsuite/gfortran.dg/widechar_8.f90 new file mode 100644 index 00000000000..e61129416cf --- /dev/null +++ b/gcc/testsuite/gfortran.dg/widechar_8.f90 @@ -0,0 +1,28 @@ +! { dg-do run } +! { dg-options "-fbackslash" } +! +! PR fortran/37025 +! +! Check whether transferring to character(kind=4) and transferring back works +! +implicit none +character(len=4,kind=4) :: str +integer(4) :: buffer(4) = [int(z'039f'),int(z'03cd'),int(z'03c7'), & + int(z'30b8') ], & + buffer2(4) + +open(6,encoding="UTF-8") +str = transfer(buffer, str) +!print *, str +!print *, 4_'\u039f\u03cd\u03c7\u30b8' +if (str /= 4_'\u039f\u03cd\u03c7\u30b8') call abort() +str = transfer([int(z'039f'),int(z'03cd'),int(z'03c7'), & + int(z'30b8') ], str) +if (str /= 4_'\u039f\u03cd\u03c7\u30b8') call abort() + +buffer2 = transfer(4_'\u039f\u03cd\u03c7\u30b8', buffer2, 4) +!print *, buffer +!print *, buffer2 +buffer2 = transfer(str, buffer2, 4) +if (any(buffer2 /= buffer)) call abort() +end diff --git a/gcc/testsuite/gfortran.dg/widechar_9.f90 b/gcc/testsuite/gfortran.dg/widechar_9.f90 new file mode 100644 index 00000000000..c78a1eb52fd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/widechar_9.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } +! +! PR fortran/37076 +! +! Before the result of concatenations was always a kind=1 string +! +program test3 + integer,parameter :: u = 4 + character(1,u),parameter :: nen=char(int(z'5e74'),u) !year + character(25,u) :: string + string = u_"2008"//nen + print *, u_"2008"//nen ! Compiles OK + print *, u_"2008"//nen//u_"8" ! Rejects this. +end program test3 diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 new file mode 100644 index 00000000000..3abc80ab168 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/compile/20080806-1.f90 @@ -0,0 +1,24 @@ +MODULE M1 + IMPLICIT NONE + TYPE mmm + COMPLEX(KIND=8), DIMENSION(:,:), POINTER :: data + END TYPE mmm + +CONTAINS + + SUBROUTINE S(ma,mb,mc) + TYPE(mmm), POINTER :: ma,mb,mc + COMPLEX(KIND=8), DIMENSION(:, :), & + POINTER :: a, b, c + INTEGER :: i,j + a=>ma%data + b=>mb%data + c=>mc%data + DO i=1,size(a,1) + DO j=1,size(a,2) + c(i,j)=a(i,j)*b(i,j) + ENDDO + ENDDO + END SUBROUTINE + +END MODULE M1 diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr37236.f b/gcc/testsuite/gfortran.fortran-torture/compile/pr37236.f new file mode 100644 index 00000000000..8f7cc369568 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr37236.f @@ -0,0 +1,82 @@ +C + SUBROUTINE FFTRC (A,N,X,IWK,WK) +C SPECIFICATIONS FOR ARGUMENTS + INTEGER N,IWK(1) + REAL*8 A(N),WK(1) + COMPLEX*16 X(1) +C SPECIFICATIONS FOR LOCAL VARIABLES + INTEGER ND2P1,ND2,I,MTWO,M,IMAX,ND4,NP2,K,NMK,J + REAL*8 RPI,ZERO,ONE,HALF,THETA,TP,G(2),B(2),Z(2),AI, + 1 AR + COMPLEX*16 XIMAG,ALPH,BETA,GAM,S1,ZD + EQUIVALENCE (GAM,G(1)),(ALPH,B(1)),(Z(1),AR),(Z(2),AI), + 1 (ZD,Z(1)) + DATA ZERO/0.0D0/,HALF/0.5D0/,ONE/1.0D0/,IMAX/24/ + DATA RPI/3.141592653589793D0/ +C FIRST EXECUTABLE STATEMENT + IF (N .NE. 2) GO TO 5 +C N EQUAL TO 2 + ZD = DCMPLX(A(1),A(2)) + THETA = AR + TP = AI + X(2) = DCMPLX(THETA-TP,ZERO) + X(1) = DCMPLX(THETA+TP,ZERO) + GO TO 9005 + 5 CONTINUE +C N GREATER THAN 2 + ND2 = N/2 + ND2P1 = ND2+1 +C MOVE A TO X + J = 1 + DO 6 I=1,ND2 + X(I) = DCMPLX(A(J),A(J+1)) + J = J+2 + 6 CONTINUE +C COMPUTE THE CENTER COEFFICIENT + GAM = DCMPLX(ZERO,ZERO) + DO 10 I=1,ND2 + GAM = GAM + X(I) + 10 CONTINUE + TP = G(1)-G(2) + GAM = DCMPLX(TP,ZERO) +C DETERMINE THE SMALLEST M SUCH THAT +C N IS LESS THAN OR EQUAL TO 2**M + MTWO = 2 + M = 1 + DO 15 I=1,IMAX + IF (ND2 .LE. MTWO) GO TO 20 + MTWO = MTWO+MTWO + M = M+1 + 15 CONTINUE + 20 IF (ND2 .EQ. MTWO) GO TO 25 +C N IS NOT A POWER OF TWO, CALL FFTCC + CALL FFTCC (X,ND2,IWK,WK) + GO TO 30 +C N IS A POWER OF TWO, CALL FFT2C + 25 CALL FFT2C (X,M,IWK) + 30 ALPH = X(1) + X(1) = B(1) + B(2) + ND4 = (ND2+1)/2 + IF (ND4 .LT. 2) GO TO 40 + NP2 = ND2 + 2 + THETA = RPI/ND2 + TP = THETA + XIMAG = DCMPLX(ZERO,ONE) +C DECOMPOSE THE COMPLEX VECTOR X +C INTO THE COMPONENTS OF THE TRANSFORM +C OF THE INPUT DATA. + DO 35 K = 2,ND4 + NMK = NP2 - K + S1 = DCONJG(X(NMK)) + ALPH = X(K) + S1 + BETA = XIMAG*(S1-X(K)) + S1 = DCMPLX(DCOS(THETA),DSIN(THETA)) + X(K) = (ALPH+BETA*S1)*HALF + X(NMK) = DCONJG(ALPH-BETA*S1)*HALF + THETA = THETA + TP + 35 CONTINUE + 40 CONTINUE + X(ND2P1) = GAM + 9005 RETURN + END + diff --git a/gcc/testsuite/gnat.dg/div_no_warning.adb b/gcc/testsuite/gnat.dg/div_no_warning.adb new file mode 100644 index 00000000000..5b652638ca4 --- /dev/null +++ b/gcc/testsuite/gnat.dg/div_no_warning.adb @@ -0,0 +1,15 @@ +-- { dg-do compile } + +procedure div_no_warning is + Flag : constant Boolean := False; + Var : Boolean := True; + function F return Boolean is + begin + return Var; + end F; + Int : Integer := 0; +begin + if Flag and then F then + Int := Int / 0; + end if; +end div_no_warning; diff --git a/gcc/testsuite/gnat.dg/specs/abstract_private.ads b/gcc/testsuite/gnat.dg/specs/abstract_private.ads new file mode 100644 index 00000000000..7420a984220 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/abstract_private.ads @@ -0,0 +1,17 @@ +generic +package Abstract_Private is + + type T1 is abstract tagged private; + procedure P1 (X : T1) is abstract; + + type T2 is abstract tagged private; + +private + + type T1 is abstract tagged null record; + procedure P2 (X : T1) is abstract; -- { dg-error "must be visible" } + + type T2 is abstract new T1 with null record; + procedure P1 (X : T2) is abstract; + +end Abstract_Private; diff --git a/gcc/testsuite/gnat.dg/test_version.adb b/gcc/testsuite/gnat.dg/test_version.adb new file mode 100644 index 00000000000..d7fa2976c56 --- /dev/null +++ b/gcc/testsuite/gnat.dg/test_version.adb @@ -0,0 +1,13 @@ +-- { dg-do run } +with GNAT.Compiler_Version; +procedure Test_Version is + package Vsn is new GNAT.Compiler_Version; + use Vsn; + X : constant String := Version; +begin + if X'Length = 46 then + -- 46 = Ver_Len_Max + Ver_Prefix + -- actual version should be shorter than this + raise Program_Error; + end if; +end Test_Version; diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 8d308d42461..1497ce38ed9 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -636,7 +636,18 @@ proc process-message { msgproc msgprefix dgargs } { # it match a single line. set newentry [lindex ${dg-messages} end] set expmsg [lindex $newentry 2] - set expmsg "$msgprefix\[^\n]*$expmsg" + + # If we have a column... + if [regexp "^(\[0-9\]+):" $expmsg "" column] { + # Remove "COLUMN:" + regsub "^\[0-9\]+:" $expmsg "" expmsg + + # Include the column in the search expression. + set expmsg "$column: $msgprefix\[^\n]*$expmsg" + } else { + set expmsg "$msgprefix\[^\n]*$expmsg" + } + set newentry [lreplace $newentry 2 2 $expmsg] set dg-messages [lreplace ${dg-messages} end end $newentry] verbose "process-message:\n${dg-messages}" 2 diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp index 286e1259f56..5985ce061d7 100644 --- a/gcc/testsuite/lib/gcc.exp +++ b/gcc/testsuite/lib/gcc.exp @@ -150,7 +150,6 @@ proc gcc_target_compile { source dest type options } { if [target_info exists gcc,timeout] { lappend options "timeout=[target_info gcc,timeout]" } - lappend options "additional_flags=-fno-show-column" lappend options "compiler=$GCC_UNDER_TEST" set options [dg-additional-files-options $options $source] return [target_compile $source $dest $type $options] diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2c9165c3c04..c9512b257b6 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1526,6 +1526,28 @@ proc check_effective_target_vect_double { } { return $et_vect_double_saved } +# Return 1 if the target supports hardware vectors of long long, 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_vect_long_long { } { + global et_vect_long_long_saved + + if [info exists et_vect_long_long_saved] { + verbose "check_effective_target_vect_long_long: using cached result" 2 + } else { + set et_vect_long_long_saved 0 + if { [istarget i?86-*-*] + || [istarget x86_64-*-*] } { + set et_vect_long_long_saved 1 + } + } + + verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2 + return $et_vect_long_long_saved +} + + # Return 1 if the target plus current options does not support a vector # max instruction on "int", 0 otherwise. # @@ -1586,6 +1608,28 @@ proc check_effective_target_vect_no_bitwise { } { return $et_vect_no_bitwise_saved } +# Return 1 if the target plus current options supports vector permutation, +# 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_vect_perm { } { + global et_vect_perm + + if [info exists et_vect_perm_saved] { + verbose "check_effective_target_vect_perm: using cached result" 2 + } else { + set et_vect_perm_saved 0 + if { [istarget powerpc*-*-*] + || [istarget spu-*-*] } { + set et_vect_perm_saved 1 + } + } + verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2 + return $et_vect_perm_saved +} + + # Return 1 if the target plus current options supports a vector # widening summation of *short* args into *int* result, 0 otherwise. # A target can also support this widening summation if it can support @@ -1808,7 +1852,8 @@ proc check_effective_target_vect_pack_trunc { } { set et_vect_pack_trunc_saved 0 if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) || [istarget i?86-*-*] - || [istarget x86_64-*-*] } { + || [istarget x86_64-*-*] + || [istarget spu-*-*] } { set et_vect_pack_trunc_saved 1 } } @@ -2079,7 +2124,8 @@ proc check_effective_target_vect_extract_even_odd { } { verbose "check_effective_target_vect_extract_even_odd: using cached result" 2 } else { set et_vect_extract_even_odd_saved 0 - if { [istarget powerpc*-*-*] } { + if { [istarget powerpc*-*-*] + || [istarget spu-*-*] } { set et_vect_extract_even_odd_saved 1 } } @@ -2100,7 +2146,8 @@ proc check_effective_target_vect_extract_even_odd_wide { } { set et_vect_extract_even_odd_wide_saved 0 if { [istarget powerpc*-*-*] || [istarget i?86-*-*] - || [istarget x86_64-*-*] } { + || [istarget x86_64-*-*] + || [istarget spu-*-*] } { set et_vect_extract_even_odd_wide_saved 1 } } @@ -2120,7 +2167,8 @@ proc check_effective_target_vect_interleave { } { set et_vect_interleave_saved 0 if { [istarget powerpc*-*-*] || [istarget i?86-*-*] - || [istarget x86_64-*-*] } { + || [istarget x86_64-*-*] + || [istarget spu-*-*] } { set et_vect_interleave_saved 1 } } @@ -2523,3 +2571,14 @@ proc check_effective_target_automatic_stack_alignment { } { return 0 } } + +# Return 1 if avx instructions can be compiled. + +proc check_effective_target_avx { } { + return [check_no_compiler_messages avx object { + void _mm256_zeroall (void) + { + __builtin_ia32_vzeroall (); + } + } "-O2 -mavx" ] +} |