From 34caeae39f67d8a2423e8b2086c433b44d504afb Mon Sep 17 00:00:00 2001 From: Haochen Jiang Date: Mon, 24 Mar 2025 17:02:44 +0800 Subject: i386: Refactor AVX10.2 runtime test Since everything is under avx10.2, we could use a header file plus a file actually run all the tests for runtime test. gcc/testsuite/ChangeLog: * gcc.target/i386/avx10-check.h: Remove AVX10_512BIT. * gcc.target/i386/avx10-minmax-helper.h: Ditto. * gcc.target/i386/avx10_2-vaddbf16-2.c: Add 512 test. * gcc.target/i386/avx10_2-vcmpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ps2phx-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvthf82ph-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2uqqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttph2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2uqqs-2.c: Ditto. * gcc.target/i386/avx10_2-vdivbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vdpphps-2.c: Ditto. * gcc.target/i386/avx10_2-vfmaddXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfmsubXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfpclassbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vgetexpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vgetmantbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vmaxbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vminbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxpd-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxph-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxps-2.c: Ditto. * gcc.target/i386/avx10_2-vmpsadbw-2.c: Ditto. * gcc.target/i386/avx10_2-vmulbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbssd-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbssds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbsud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbsuds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbuud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbuuds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwsud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwsuds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwusd-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwusds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwuud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwuuds-2.c: Ditto. * gcc.target/i386/avx10_2-vrcpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vreducebf16-2.c: Ditto. * gcc.target/i386/avx10_2-vrndscalebf16-2.c: Ditto. * gcc.target/i386/avx10_2-vrsqrtbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vscalefbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vsqrtbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vsubbf16-2.c: Ditto. * gcc.target/i386/avx512f-helper.h: Remove AVX10_512BIT. * gcc.target/i386/sm4-check.h: Use AVX10_2. * gcc.target/i386/avx10_2-512-vaddbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vaddbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vcmpbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcmpbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvt2ph2bf8-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvt2ph2bf8-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvt2ph2hf8-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvt2ph2hf8-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvt2ps2phx-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvt2ps2phx-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtbf162ibs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtbf162iubs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtbiasph2bf8-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtbiasph2bf8s-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtbiasph2hf8-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtbiasph2hf8s-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvthf82ph-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvthf82ph-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtph2bf8-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtph2bf8-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtph2bf8s-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtph2hf8-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtph2hf8-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtph2hf8s-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtph2ibs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtph2iubs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtps2ibs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvtps2iubs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttbf162ibs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttbf162iubs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttpd2dqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttpd2qqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttpd2udqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttpd2uqqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttph2ibs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttph2iubs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttps2dqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttps2ibs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttps2iubs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttps2qqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttps2udqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vcvttps2uqqs-2.h: ...here. * gcc.target/i386/avx10_2-512-vdivbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vdivbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vdpphps-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vdpphps-2.h: ...here. * gcc.target/i386/avx10_2-512-vfmaddXXXbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vfmaddXXXbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vfmsubXXXbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vfmsubXXXbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vfnmaddXXXbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vfnmsubXXXbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vfpclassbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vfpclassbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vgetexpbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vgetexpbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vgetmantbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vgetmantbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vmaxbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vmaxbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vminbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vminbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vminmaxbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vminmaxbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vminmaxpd-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vminmaxpd-2.h: ...here. * gcc.target/i386/avx10_2-512-vminmaxph-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vminmaxph-2.h: ...here. * gcc.target/i386/avx10_2-512-vminmaxps-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vminmaxps-2.h: ...here. * gcc.target/i386/avx10_2-512-vmpsadbw-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vmpsadbw-2.h: ...here. * gcc.target/i386/avx10_2-512-vmulbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vmulbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpbssd-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpbssd-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpbssds-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpbssds-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpbsud-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpbsud-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpbsuds-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpbsuds-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpbuud-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpbuud-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpbuuds-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpbuuds-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpwsud-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpwsud-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpwsuds-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpwsuds-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpwusd-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpwusd-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpwusds-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpwusds-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpwuud-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpwuud-2.h: ...here. * gcc.target/i386/avx10_2-512-vpdpwuuds-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vpdpwuuds-2.h: ...here. * gcc.target/i386/avx10_2-512-vrcpbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vrcpbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vreducebf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vreducebf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vrndscalebf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vrndscalebf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vrsqrtbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vrsqrtbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vscalefbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vscalefbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vsqrtbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vsqrtbf16-2.h: ...here. * gcc.target/i386/avx10_2-512-vsubbf16-2.c: Remove 512 test. Move to... * gcc.target/i386/avx10_2-vsubbf16-2.h: ...here. * gcc.target/i386/sm4key4-avx10_2-512-2.c: Remove 512 test. Move to... * gcc.target/i386/sm4key4-avx10_2-2.c: ...here. * gcc.target/i386/sm4rnds4-avx10_2-512-2.c: Remove 512 test. Move to... * gcc.target/i386/sm4rnds4-avx10_2-2.c: ...here. * gcc.target/i386/vnniint16-auto-vectorize-4.c: Use AVX10_SCALAR for 512 bit test. * gcc.target/i386/vnniint8-auto-vectorize-4.c: Ditto. --- gcc/testsuite/gcc.target/i386/avx10-check.h | 6 +- .../gcc.target/i386/avx10-minmax-helper.h | 2 - .../gcc.target/i386/avx10_2-512-vaddbf16-2.c | 50 ------------ .../gcc.target/i386/avx10_2-512-vcmpbf16-2.c | 37 --------- .../gcc.target/i386/avx10_2-512-vcvt2ph2bf8-2.c | 80 ------------------- .../gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c | 80 ------------------- .../gcc.target/i386/avx10_2-512-vcvt2ph2hf8-2.c | 80 ------------------- .../gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c | 80 ------------------- .../gcc.target/i386/avx10_2-512-vcvt2ps2phx-2.c | 62 --------------- .../gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c | 69 ---------------- .../gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c | 69 ---------------- .../gcc.target/i386/avx10_2-512-vcvtbiasph2bf8-2.c | 76 ------------------ .../i386/avx10_2-512-vcvtbiasph2bf8s-2.c | 77 ------------------ .../gcc.target/i386/avx10_2-512-vcvtbiasph2hf8-2.c | 76 ------------------ .../i386/avx10_2-512-vcvtbiasph2hf8s-2.c | 76 ------------------ .../gcc.target/i386/avx10_2-512-vcvthf82ph-2.c | 60 -------------- .../gcc.target/i386/avx10_2-512-vcvtph2bf8-2.c | 76 ------------------ .../gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c | 76 ------------------ .../gcc.target/i386/avx10_2-512-vcvtph2hf8-2.c | 76 ------------------ .../gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c | 76 ------------------ .../gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c | 90 --------------------- .../gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c | 90 --------------------- .../gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c | 91 --------------------- .../gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c | 89 --------------------- .../gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c | 69 ---------------- .../gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c | 69 ---------------- .../gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c | 89 --------------------- .../gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c | 88 -------------------- .../gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c | 89 --------------------- .../gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c | 88 -------------------- .../gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c | 90 --------------------- .../gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c | 90 --------------------- .../gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c | 88 -------------------- .../gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c | 91 --------------------- .../gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c | 89 --------------------- .../gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c | 89 --------------------- .../gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c | 88 -------------------- .../gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c | 89 --------------------- .../gcc.target/i386/avx10_2-512-vdivbf16-2.c | 50 ------------ .../gcc.target/i386/avx10_2-512-vdpphps-2.c | 72 ----------------- .../gcc.target/i386/avx10_2-512-vfmaddXXXbf16-2.c | 53 ------------ .../gcc.target/i386/avx10_2-512-vfmsubXXXbf16-2.c | 54 ------------- .../gcc.target/i386/avx10_2-512-vfnmaddXXXbf16-2.c | 54 ------------- .../gcc.target/i386/avx10_2-512-vfnmsubXXXbf16-2.c | 54 ------------- .../gcc.target/i386/avx10_2-512-vfpclassbf16-2.c | 45 ----------- .../gcc.target/i386/avx10_2-512-vgetexpbf16-2.c | 48 ----------- .../gcc.target/i386/avx10_2-512-vgetmantbf16-2.c | 51 ------------ .../gcc.target/i386/avx10_2-512-vmaxbf16-2.c | 52 ------------ .../gcc.target/i386/avx10_2-512-vminbf16-2.c | 52 ------------ .../gcc.target/i386/avx10_2-512-vminmaxbf16-2.c | 36 --------- .../gcc.target/i386/avx10_2-512-vminmaxpd-2.c | 36 --------- .../gcc.target/i386/avx10_2-512-vminmaxph-2.c | 36 --------- .../gcc.target/i386/avx10_2-512-vminmaxps-2.c | 36 --------- .../gcc.target/i386/avx10_2-512-vmpsadbw-2.c | 93 ---------------------- .../gcc.target/i386/avx10_2-512-vmulbf16-2.c | 50 ------------ .../gcc.target/i386/avx10_2-512-vpdpbssd-2.c | 73 ----------------- .../gcc.target/i386/avx10_2-512-vpdpbssds-2.c | 75 ----------------- .../gcc.target/i386/avx10_2-512-vpdpbsud-2.c | 72 ----------------- .../gcc.target/i386/avx10_2-512-vpdpbsuds-2.c | 75 ----------------- .../gcc.target/i386/avx10_2-512-vpdpbuud-2.c | 71 ----------------- .../gcc.target/i386/avx10_2-512-vpdpbuuds-2.c | 74 ----------------- .../gcc.target/i386/avx10_2-512-vpdpwsud-2.c | 71 ----------------- .../gcc.target/i386/avx10_2-512-vpdpwsuds-2.c | 74 ----------------- .../gcc.target/i386/avx10_2-512-vpdpwusd-2.c | 71 ----------------- .../gcc.target/i386/avx10_2-512-vpdpwusds-2.c | 74 ----------------- .../gcc.target/i386/avx10_2-512-vpdpwuud-2.c | 70 ---------------- .../gcc.target/i386/avx10_2-512-vpdpwuuds-2.c | 73 ----------------- .../gcc.target/i386/avx10_2-512-vrcpbf16-2.c | 46 ----------- .../gcc.target/i386/avx10_2-512-vreducebf16-2.c | 51 ------------ .../gcc.target/i386/avx10_2-512-vrndscalebf16-2.c | 47 ----------- .../gcc.target/i386/avx10_2-512-vrsqrtbf16-2.c | 48 ----------- .../gcc.target/i386/avx10_2-512-vscalefbf16-2.c | 52 ------------ .../gcc.target/i386/avx10_2-512-vsqrtbf16-2.c | 48 ----------- .../gcc.target/i386/avx10_2-512-vsubbf16-2.c | 50 ------------ gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.h | 41 ++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.h | 28 +++++++ .../gcc.target/i386/avx10_2-vcvt2ph2bf8-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvt2ph2bf8-2.h | 70 ++++++++++++++++ .../gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.h | 70 ++++++++++++++++ .../gcc.target/i386/avx10_2-vcvt2ph2hf8-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvt2ph2hf8-2.h | 70 ++++++++++++++++ .../gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.h | 70 ++++++++++++++++ .../gcc.target/i386/avx10_2-vcvt2ps2phx-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvt2ps2phx-2.h | 53 ++++++++++++ .../gcc.target/i386/avx10_2-vcvtbf162ibs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtbf162ibs-2.h | 60 ++++++++++++++ .../gcc.target/i386/avx10_2-vcvtbf162iubs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtbf162iubs-2.h | 60 ++++++++++++++ .../gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.h | 66 +++++++++++++++ .../gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.h | 67 ++++++++++++++++ .../gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.h | 66 +++++++++++++++ .../gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.h | 66 +++++++++++++++ .../gcc.target/i386/avx10_2-vcvthf82ph-2.c | 11 ++- .../gcc.target/i386/avx10_2-vcvthf82ph-2.h | 50 ++++++++++++ .../gcc.target/i386/avx10_2-vcvtph2bf8-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtph2bf8-2.h | 66 +++++++++++++++ .../gcc.target/i386/avx10_2-vcvtph2bf8s-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtph2bf8s-2.h | 66 +++++++++++++++ .../gcc.target/i386/avx10_2-vcvtph2hf8-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtph2hf8-2.h | 66 +++++++++++++++ .../gcc.target/i386/avx10_2-vcvtph2hf8s-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtph2hf8s-2.h | 66 +++++++++++++++ .../gcc.target/i386/avx10_2-vcvtph2ibs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtph2ibs-2.h | 81 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvtph2iubs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtph2iubs-2.h | 81 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvtps2ibs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtps2ibs-2.h | 82 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvtps2iubs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvtps2iubs-2.h | 80 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttbf162ibs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttbf162ibs-2.h | 60 ++++++++++++++ .../gcc.target/i386/avx10_2-vcvttbf162iubs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttbf162iubs-2.h | 60 ++++++++++++++ .../gcc.target/i386/avx10_2-vcvttpd2dqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttpd2dqs-2.h | 80 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttpd2qqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttpd2qqs-2.h | 79 ++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttpd2udqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttpd2udqs-2.h | 80 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttpd2uqqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttpd2uqqs-2.h | 79 ++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttph2ibs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttph2ibs-2.h | 81 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttph2iubs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttph2iubs-2.h | 81 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttps2dqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttps2dqs-2.h | 79 ++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttps2ibs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttps2ibs-2.h | 82 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttps2iubs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttps2iubs-2.h | 80 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttps2qqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttps2qqs-2.h | 80 +++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttps2udqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttps2udqs-2.h | 79 ++++++++++++++++++ .../gcc.target/i386/avx10_2-vcvttps2uqqs-2.c | 9 ++- .../gcc.target/i386/avx10_2-vcvttps2uqqs-2.h | 80 +++++++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.h | 41 ++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.c | 23 +++--- gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.h | 62 +++++++++++++++ .../gcc.target/i386/avx10_2-vfmaddXXXbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vfmaddXXXbf16-2.h | 44 ++++++++++ .../gcc.target/i386/avx10_2-vfmsubXXXbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vfmsubXXXbf16-2.h | 45 +++++++++++ .../gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.h | 45 +++++++++++ .../gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.h | 45 +++++++++++ .../gcc.target/i386/avx10_2-vfpclassbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vfpclassbf16-2.h | 36 +++++++++ .../gcc.target/i386/avx10_2-vgetexpbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vgetexpbf16-2.h | 39 +++++++++ .../gcc.target/i386/avx10_2-vgetmantbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vgetmantbf16-2.h | 42 ++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.h | 43 ++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.h | 43 ++++++++++ .../gcc.target/i386/avx10_2-vminmaxbf16-2.c | 8 +- .../gcc.target/i386/avx10_2-vminmaxbf16-2.h | 28 +++++++ .../gcc.target/i386/avx10_2-vminmaxpd-2.c | 8 +- .../gcc.target/i386/avx10_2-vminmaxpd-2.h | 28 +++++++ .../gcc.target/i386/avx10_2-vminmaxph-2.c | 10 ++- .../gcc.target/i386/avx10_2-vminmaxph-2.h | 28 +++++++ .../gcc.target/i386/avx10_2-vminmaxps-2.c | 8 +- .../gcc.target/i386/avx10_2-vminmaxps-2.h | 28 +++++++ gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.h | 84 +++++++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.h | 41 ++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.h | 63 +++++++++++++++ .../gcc.target/i386/avx10_2-vpdpbssds-2.c | 9 ++- .../gcc.target/i386/avx10_2-vpdpbssds-2.h | 65 +++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.h | 62 +++++++++++++++ .../gcc.target/i386/avx10_2-vpdpbsuds-2.c | 9 ++- .../gcc.target/i386/avx10_2-vpdpbsuds-2.h | 65 +++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.h | 61 ++++++++++++++ .../gcc.target/i386/avx10_2-vpdpbuuds-2.c | 9 ++- .../gcc.target/i386/avx10_2-vpdpbuuds-2.h | 64 +++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.h | 61 ++++++++++++++ .../gcc.target/i386/avx10_2-vpdpwsuds-2.c | 9 ++- .../gcc.target/i386/avx10_2-vpdpwsuds-2.h | 64 +++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.h | 61 ++++++++++++++ .../gcc.target/i386/avx10_2-vpdpwusds-2.c | 9 ++- .../gcc.target/i386/avx10_2-vpdpwusds-2.h | 64 +++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.h | 60 ++++++++++++++ .../gcc.target/i386/avx10_2-vpdpwuuds-2.c | 9 ++- .../gcc.target/i386/avx10_2-vpdpwuuds-2.h | 63 +++++++++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.h | 37 +++++++++ .../gcc.target/i386/avx10_2-vreducebf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vreducebf16-2.h | 42 ++++++++++ .../gcc.target/i386/avx10_2-vrndscalebf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vrndscalebf16-2.h | 38 +++++++++ .../gcc.target/i386/avx10_2-vrsqrtbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vrsqrtbf16-2.h | 39 +++++++++ .../gcc.target/i386/avx10_2-vscalefbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vscalefbf16-2.h | 43 ++++++++++ .../gcc.target/i386/avx10_2-vsqrtbf16-2.c | 9 ++- .../gcc.target/i386/avx10_2-vsqrtbf16-2.h | 39 +++++++++ gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.c | 9 ++- gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.h | 41 ++++++++++ gcc/testsuite/gcc.target/i386/avx512f-helper.h | 2 +- gcc/testsuite/gcc.target/i386/sm4-check.h | 10 +-- gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-2.c | 16 ++++ .../gcc.target/i386/sm4key4-avx10_2-512-2.c | 18 ----- gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-2.c | 16 ++++ .../gcc.target/i386/sm4rnds4-avx10_2-512-2.c | 18 ----- .../gcc.target/i386/vnniint16-auto-vectorize-4.c | 3 +- .../gcc.target/i386/vnniint8-auto-vectorize-4.c | 3 +- 226 files changed, 4809 insertions(+), 5135 deletions(-) delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vaddbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcmpbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ps2phx-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8s-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8s-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvthf82ph-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vdivbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vdpphps-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vfmaddXXXbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vfmsubXXXbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmaddXXXbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmsubXXXbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vfpclassbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vgetexpbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vgetmantbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vmaxbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vminbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxpd-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxph-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxps-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vmpsadbw-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vmulbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssd-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssds-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsud-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsuds-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuud-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuuds-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsud-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsuds-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusd-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusds-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuud-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuuds-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vrcpbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vreducebf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vrndscalebf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vrsqrtbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vscalefbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vsqrtbf16-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-512-vsubbf16-2.c create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.h create mode 100644 gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-512-2.c create mode 100644 gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-2.c delete mode 100644 gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-512-2.c diff --git a/gcc/testsuite/gcc.target/i386/avx10-check.h b/gcc/testsuite/gcc.target/i386/avx10-check.h index 7d4326d..6a1a151 100644 --- a/gcc/testsuite/gcc.target/i386/avx10-check.h +++ b/gcc/testsuite/gcc.target/i386/avx10-check.h @@ -5,9 +5,8 @@ #ifndef DO_TEST #define DO_TEST do_test -#if defined(AVX10_512BIT) || defined(AVX10_SCALAR) static void test_512 (void); -#else +#ifndef AVX10_SCALAR static void test_256 (void); static void test_128 (void); #endif @@ -16,9 +15,8 @@ __attribute__ ((noinline)) static void do_test (void) { -#if defined(AVX10_512BIT) || defined(AVX10_SCALAR) test_512 (); -#else +#ifndef AVX10_SCALAR test_256 (); test_128 (); #endif diff --git a/gcc/testsuite/gcc.target/i386/avx10-minmax-helper.h b/gcc/testsuite/gcc.target/i386/avx10-minmax-helper.h index e799975..6c9bffc 100644 --- a/gcc/testsuite/gcc.target/i386/avx10-minmax-helper.h +++ b/gcc/testsuite/gcc.target/i386/avx10-minmax-helper.h @@ -66,12 +66,10 @@ check_minmax_##UNION_TYPE (UNION_TYPE u, const VALUE_TYPE *v) \ return err; \ } -#if defined (AVX10_512BIT) CHECK_EXP_MINMAX (union512, float, int) CHECK_EXP_MINMAX (union512d, double, long int) CHECK_EXP_MINMAX (union512bf16_bf, __bf16, short int) CHECK_EXP_MINMAX (union512h, _Float16, short int) -#endif CHECK_EXP_MINMAX (union256, float, int) CHECK_EXP_MINMAX (union256d, double, long int) CHECK_EXP_MINMAX (union128, float, int) diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vaddbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vaddbf16-2.c deleted file mode 100644 index 4aca46d..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vaddbf16-2.c +++ /dev/null @@ -1,50 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float x = (float) (2 * (i % 7) + 7); - float y = (float) (3 * (i % 7) - 5); - float res; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - res = x + y; - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); - } - - res1.x = INTRINSIC (_add_pbh) (src1.x, src2.x); - res2.x = INTRINSIC (_mask_add_pbh) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_add_pbh) (mask, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcmpbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcmpbf16-2.c deleted file mode 100644 index 885cec7..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcmpbf16-2.c +++ /dev/null @@ -1,37 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - __mmask32 res1, res2, exp = 0; - UNION_TYPE (AVX512F_LEN, bf16_uw) src1, src2; - MASK_TYPE mask = MASK_VALUE; - - for (i = 0; i < SIZE; i++) - { - float x = 0.5; - float y = 0.25; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - if (src1.a[i] == src2.a[i]) - exp |= 1 << i; - } - - res1 = INTRINSIC (_cmp_pbh_mask) (src1.x, src2.x, 0); - res2 = INTRINSIC (_mask_cmp_pbh_mask) (mask, src1.x, src2.x, 0); - - if (exp != res1 || exp != res2) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8-2.c deleted file mode 100644 index 5bd2b7f..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8-2.c +++ /dev/null @@ -1,80 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE_SRC (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) -{ - _Float16 temp; - Float16Union ut = {.f16 = temp}; - int i, hf8_bf8, saturate; - - hf8_bf8 = 1; - saturate = 0; - - for (i = 0; i < SIZE; i++) - { - r[i] = 0; - if (i < SIZE_SRC) - { - Float16Union usrc2 = {.f16 = s2[i]}; - ut.u16 = usrc2.u16; - } - else - { - Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; - ut.u16 = usrc1.u16; - } - r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE]; - - sign = 1; - for (i = 0; i < SIZE_SRC; i++) - { - src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); - src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC(res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvt2ph_bf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvt2ph_bf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvt2ph_bf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c deleted file mode 100644 index 33d9c0c..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c +++ /dev/null @@ -1,80 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE_SRC (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) -{ - _Float16 temp; - Float16Union ut = {.f16 = temp}; - int i, hf8_bf8, saturate; - - hf8_bf8 = 1; - saturate = 1; - - for (i = 0; i < SIZE; i++) - { - r[i] = 0; - if (i < SIZE_SRC) - { - Float16Union usrc2 = {.f16 = s2[i]}; - ut.u16 = usrc2.u16; - } - else - { - Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; - ut.u16 = usrc1.u16; - } - r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE]; - - sign = 1; - for (i = 0; i < SIZE_SRC; i++) - { - src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); - src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC(res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvts_2ph_bf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvts_2ph_bf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvts_2ph_bf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8-2.c deleted file mode 100644 index b9fdbd4..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8-2.c +++ /dev/null @@ -1,80 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE_SRC (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) -{ - _Float16 temp; - Float16Union ut = {.f16 = temp}; - int i, hf8_bf8, saturate; - - hf8_bf8 = 0; - saturate = 0; - - for (i = 0; i < SIZE; i++) - { - r[i] = 0; - if (i < SIZE_SRC) - { - Float16Union usrc2 = {.f16 = s2[i]}; - ut.u16 = usrc2.u16; - } - else - { - Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; - ut.u16 = usrc1.u16; - } - r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE]; - - sign = 1; - for (i = 0; i < SIZE_SRC; i++) - { - src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); - src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC(res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvt2ph_hf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvt2ph_hf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvt2ph_hf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c deleted file mode 100644 index b9fdfac..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c +++ /dev/null @@ -1,80 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE_SRC (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) -{ - _Float16 temp; - Float16Union ut = {.f16 = temp}; - int i, hf8_bf8, saturate; - - hf8_bf8 = 0; - saturate = 1; - - for (i = 0; i < SIZE; i++) - { - r[i] = 0; - if (i < SIZE_SRC) - { - Float16Union usrc2 = {.f16 = s2[i]}; - ut.u16 = usrc2.u16; - } - else - { - Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; - ut.u16 = usrc1.u16; - } - r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE]; - - sign = 1; - for (i = 0; i < SIZE_SRC; i++) - { - src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); - src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); - sign *= -1; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC(res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvts_2ph_hf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvts_2ph_hf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvts_2ph_hf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ps2phx-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ps2phx-2.c deleted file mode 100644 index f9f799a..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvt2ps2phx-2.c +++ /dev/null @@ -1,62 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (_Float16 *res_ref, float *src1, float *src2) -{ - float fp32; - int i; - for (i = 0; i < SIZE / 2; i++) - { - fp32 = (float) 2 * i + 7 + i * 0.5; - res_ref[i] = fp32; - src2[i] = fp32; - } - for (i = SIZE / 2; i < SIZE; i++) - { - fp32 = (float)2 * i + 7 + i * 0.5; - res_ref[i] = fp32; - src1[i - (SIZE / 2)] = fp32; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, h) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, ) src1, src2; - MASK_TYPE mask = MASK_VALUE; - _Float16 res_ref[SIZE]; - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC (res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvtx2ps_ph) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN, h) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvtx2ps_ph) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (h) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, h) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvtx2ps_ph) (mask, src1.x, src2.x); - MASK_ZERO (h) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, h) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c deleted file mode 100644 index 4976892..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c +++ /dev/null @@ -1,69 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (__bf16 *s, short *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > SCHAR_MAX) - tmp = SCHAR_MAX; - else if (s[i] < SCHAR_MIN) - tmp = SCHAR_MIN; - else - tmp = nearbyint(_mm_cvtsbh_ss(s[i])); - r[i] = (unsigned short)tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, bf16_bf) s; - UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_bf16_epi8) (s.x); - res2.x = INTRINSIC (_mask_ipcvts_bf16_epi8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvts_bf16_epi8) (mask, s.x); - - CALC (s.a, res_ref); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) - abort (); - - MASK_MERGE (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) - abort (); - - MASK_ZERO (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c deleted file mode 100644 index 03bd36a..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c +++ /dev/null @@ -1,69 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (__bf16 *s, unsigned short *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > UCHAR_MAX) - tmp = UCHAR_MAX; - else if (s[i] < 0) - tmp = 0; - else - tmp = nearbyint(_mm_cvtsbh_ss(s[i])); - r[i] = (unsigned short)tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, bf16_bf) s; - UNION_TYPE (AVX512F_LEN, i_uw) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_bf16_epu8) (s.x); - res2.x = INTRINSIC (_mask_ipcvts_bf16_epu8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvts_bf16_epu8) (mask, s.x); - - CALC (s.a, res_ref); - - if (UNION_CHECK (AVX512F_LEN, i_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (i_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uw) (res2, res_ref)) - abort (); - - MASK_ZERO (i_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uw) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8-2.c deleted file mode 100644 index 4d90dcf8..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8-2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SRC_F8_I8 (AVX512F_LEN / 8) -#define SRC_F16 (AVX512F_LEN / 16) -#define DST_F8_I8 (AVX512F_LEN_HALF / 8) -#define DST_F16 (AVX512F_LEN_HALF / 16) -#define SIZE SRC_F16 - -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, char *src1, _Float16 *src2) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 1; - saturate = 0; - - for (i = 0; i < DST_F8_I8; i++) - { - Float16Union usrc = {.f16 = src2[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); - } - - if (AVX512F_LEN == 128) - for (i = DST_F16; i < DST_F8_I8; i++) - r[i] = 0; -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, h) src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[DST_F8_I8]; - - sign = 1; - for (i = 0; i < SRC_F16; i++) - { - src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC (res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvtbiasph_bf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvtbiasph_bf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvtbiasph_bf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8s-2.c deleted file mode 100644 index 93de7ea..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2bf8s-2.c +++ /dev/null @@ -1,77 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SRC_F8_I8 (AVX512F_LEN / 8) -#define SRC_F16 (AVX512F_LEN / 16) -#define DST_F8_I8 (AVX512F_LEN_HALF / 8) -#define DST_F16 (AVX512F_LEN_HALF / 16) -#define SIZE SRC_F16 - -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, char *src1, _Float16 *src2) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 1; - saturate = 1; - - for (i = 0; i < DST_F8_I8; i++) - { - Float16Union usrc = {.f16 = src2[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); - } - - if (AVX512F_LEN == 128) - for (i = DST_F16; i < DST_F8_I8; i++) - r[i] = 0; -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, h) src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[DST_F8_I8]; - - sign = 1; - for (i = 0; i < SRC_F16; i++) - { - src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC (res_ref, src1.a, src2.a); - - - res1.x = INTRINSIC (_cvts_biasph_bf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvts_biasph_bf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvts_biasph_bf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8-2.c deleted file mode 100644 index 14a2251..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8-2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SRC_F8_I8 (AVX512F_LEN / 8) -#define SRC_F16 (AVX512F_LEN / 16) -#define DST_F8_I8 (AVX512F_LEN_HALF / 8) -#define DST_F16 (AVX512F_LEN_HALF / 16) -#define SIZE SRC_F16 - -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, char *src1, _Float16 *src2) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 0; - saturate = 0; - - for (i = 0; i < DST_F8_I8; i++) - { - Float16Union usrc = {.f16 = src2[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); - } - - if (AVX512F_LEN == 128) - for (i = DST_F16; i < DST_F8_I8; i++) - r[i] = 0; -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, h) src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[DST_F8_I8]; - - sign = 1; - for (i = 0; i < SRC_F16; i++) - { - src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC (res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvtbiasph_hf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvtbiasph_hf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvtbiasph_hf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8s-2.c deleted file mode 100644 index 0333f08..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtbiasph2hf8s-2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SRC_F8_I8 (AVX512F_LEN / 8) -#define SRC_F16 (AVX512F_LEN / 16) -#define DST_F8_I8 (AVX512F_LEN_HALF / 8) -#define DST_F16 (AVX512F_LEN_HALF / 16) -#define SIZE SRC_F16 - -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, char *src1, _Float16 *src2) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 0; - saturate = 1; - - for (i = 0; i < DST_F8_I8; i++) - { - Float16Union usrc = {.f16 = src2[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); - } - - if (AVX512F_LEN == 128) - for (i = DST_F16; i < DST_F8_I8; i++) - r[i] = 0; -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, h) src2; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[DST_F8_I8]; - - sign = 1; - for (i = 0; i < SRC_F16; i++) - { - src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC (res_ref, src1.a, src2.a); - - res1.x = INTRINSIC (_cvts_biasph_hf8) (src1.x, src2.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvts_biasph_hf8) (res2.x, mask, src1.x, src2.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvts_biasph_hf8) (mask, src1.x, src2.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvthf82ph-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvthf82ph-2.c deleted file mode 100644 index 9301ee3..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvthf82ph-2.c +++ /dev/null @@ -1,60 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE_SRC (AVX512F_LEN_HALF / 8) -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -CALC (_Float16 *r, unsigned char *s) -{ - int i; - for (i = 0; i < SIZE; i++) - r[i] = convert_hf8_to_fp16(s[i]); -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN, h) res1, res2, res3; - UNION_TYPE (AVX512F_LEN_HALF, i_b) src; - MASK_TYPE mask = MASK_VALUE; - _Float16 res_ref[SIZE]; - - sign = 1; - for (i = 0; i < SIZE_SRC; i++) - { - src.a[i] = sign * (2.5 * (1 << (i % 3))); - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - CALC(res_ref, src.a); - - res1.x = INTRINSIC (_cvthf8_ph) (src.x); - if (UNION_ROUGH_CHECK (AVX512F_LEN, h) (res1, res_ref, 0.0009765625)) - abort (); - - res2.x = INTRINSIC (_mask_cvthf8_ph) (res2.x, mask, src.x); - MASK_MERGE (h) (res_ref, mask, SIZE); - if (UNION_ROUGH_CHECK (AVX512F_LEN, h) (res2, res_ref, 0.0009765625)) - abort (); - - res3.x = INTRINSIC (_maskz_cvthf8_ph) (mask, src.x); - MASK_ZERO (h) (res_ref, mask, SIZE); - if (UNION_ROUGH_CHECK (AVX512F_LEN, h) (res3, res_ref, 0.0009765625)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8-2.c deleted file mode 100644 index f42f856..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8-2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE (AVX512F_LEN / 16) -#define SIZE_DST (AVX512F_LEN_HALF / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 1; - saturate = 0; - - for (i = 0; i < SIZE_DST; i++) - { - r[i] = 0; - if (i < SIZE) - { - Float16Union usrc = {.f16 = s[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); - } - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE_DST]; - - sign = 1; - for (i = 0; i < SIZE; i++) - { - src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - -#if AVX512F_LEN > 128 - for (i = 0; i < SIZE_DST; i++) - res2.a[i] = DEFAULT_VALUE; -#else - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; -#endif - - CALC(res_ref, src.a); - - res1.x = INTRINSIC (_cvtph_bf8) (src.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvtph_bf8) (res2.x, mask, src.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvtph_bf8) (mask, src.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c deleted file mode 100644 index c22e1aa..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE (AVX512F_LEN / 16) -#define SIZE_DST (AVX512F_LEN_HALF / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 1; - saturate = 1; - - for (i = 0; i < SIZE_DST; i++) - { - r[i] = 0; - if (i < SIZE) - { - Float16Union usrc = {.f16 = s[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); - } - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE_DST]; - - sign = 1; - for (i = 0; i < SIZE; i++) - { - src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - -#if AVX512F_LEN > 128 - for (i = 0; i < SIZE_DST; i++) - res2.a[i] = DEFAULT_VALUE; -#else - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; -#endif - - CALC(res_ref, src.a); - - res1.x = INTRINSIC (_cvts_ph_bf8) (src.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvts_ph_bf8) (res2.x, mask, src.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvts_ph_bf8) (mask, src.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8-2.c deleted file mode 100644 index e328e9d..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8-2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE (AVX512F_LEN / 16) -#define SIZE_DST (AVX512F_LEN_HALF / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 0; - saturate = 0; - - for (i = 0; i < SIZE_DST; i++) - { - r[i] = 0; - if (i < SIZE) - { - Float16Union usrc = {.f16 = s[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); - } - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE]; - - sign = 1; - for (i = 0; i < SIZE; i++) - { - src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - -#if AVX512F_LEN > 128 - for (i = 0; i < SIZE_DST; i++) - res2.a[i] = DEFAULT_VALUE; -#else - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; -#endif - - CALC(res_ref, src.a); - - res1.x = INTRINSIC (_cvtph_hf8) (src.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvtph_hf8) (res2.x, mask, src.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvtph_hf8) (mask, src.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c deleted file mode 100644 index e6872e8..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c +++ /dev/null @@ -1,76 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" -#include "fp8-helper.h" - -#define SIZE (AVX512F_LEN / 16) -#define SIZE_DST (AVX512F_LEN_HALF / 8) -#include "avx512f-mask-type.h" - -void -CALC (unsigned char *r, _Float16 *s) -{ - int i, hf8_bf8, saturate; - - hf8_bf8 = 0; - saturate = 1; - - for (i = 0; i < SIZE_DST; i++) - { - r[i] = 0; - if (i < SIZE) - { - Float16Union usrc = {.f16 = s[i]}; - r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); - } - } -} - -void -TEST (void) -{ - int i,sign; - UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, h) src; - MASK_TYPE mask = MASK_VALUE; - unsigned char res_ref[SIZE]; - - sign = 1; - for (i = 0; i < SIZE; i++) - { - src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); - sign = -sign; - } - -#if AVX512F_LEN > 128 - for (i = 0; i < SIZE_DST; i++) - res2.a[i] = DEFAULT_VALUE; -#else - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; -#endif - - CALC(res_ref, src.a); - - res1.x = INTRINSIC (_cvts_ph_hf8) (src.x); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) - abort (); - - res2.x = INTRINSIC (_mask_cvts_ph_hf8) (res2.x, mask, src.x); - MASK_MERGE (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) - abort (); - - res3.x = INTRINSIC (_maskz_cvts_ph_hf8) (mask, src.x); - MASK_ZERO (i_b) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c deleted file mode 100644 index 2bddbb1..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c +++ /dev/null @@ -1,90 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (_Float16 *s, short *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > SCHAR_MAX) - tmp = SCHAR_MAX; - else if (s[i] < SCHAR_MIN) - tmp = SCHAR_MIN; - else - tmp = __builtin_nearbyintf16(s[i]); - r[i] = (unsigned short) tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, h) s; - UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_ph_epi8) (s.x); - res2.x = INTRINSIC (_mask_ipcvts_ph_epi8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvts_ph_epi8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) - abort (); - - MASK_MERGE (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) - abort (); - - MASK_ZERO (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_roundph_epi8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvts_roundph_epi8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvts_roundph_epi8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c deleted file mode 100644 index df73fcd..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c +++ /dev/null @@ -1,90 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (_Float16 *s, short *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > UCHAR_MAX) - tmp = UCHAR_MAX; - else if (s[i] < 0) - tmp = 0; - else - tmp = __builtin_nearbyintf16(s[i]); - r[i] = (unsigned short) tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, h) s; - UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_ph_epu8) (s.x); - res2.x = INTRINSIC (_mask_ipcvts_ph_epu8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvts_ph_epu8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) - abort (); - - MASK_MERGE (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) - abort (); - - MASK_ZERO (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_roundph_epu8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvts_roundph_epu8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvts_roundph_epu8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c deleted file mode 100644 index 2ab24b9..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c +++ /dev/null @@ -1,91 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include -#include - -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, int *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > SCHAR_MAX) - tmp = SCHAR_MAX; - else if (s[i] < SCHAR_MIN) - tmp = SCHAR_MIN; - else - tmp = nearbyint(s[i]); - r[i] = (unsigned int) tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, ) s; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_ps_epi8) (s.x); - res2.x = INTRINSIC (_mask_ipcvts_ps_epi8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvts_ps_epi8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) - abort (); - - MASK_ZERO (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_roundps_epi8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvts_roundps_epi8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvts_roundps_epi8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c deleted file mode 100644 index 2b02ee3..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include -#include - -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, int *r) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > UCHAR_MAX) - r[i] = UCHAR_MAX; - else if (s[i] < 0) - r[i] = 0; - else - r[i] = nearbyint(s[i]); - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, ) s; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_ps_epu8) (s.x); - res2.x = INTRINSIC (_mask_ipcvts_ps_epu8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvts_ps_epu8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) - abort (); - - MASK_ZERO (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvts_roundps_epu8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvts_roundps_epu8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvts_roundps_epu8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c deleted file mode 100644 index 38154c8..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c +++ /dev/null @@ -1,69 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (__bf16 *s, short *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > SCHAR_MAX) - tmp = SCHAR_MAX; - else if (s[i] < SCHAR_MIN) - tmp = SCHAR_MIN; - else - tmp = s[i]; - r[i] = (unsigned short)tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, bf16_bf) s; - UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_bf16_epi8) (s.x); - res2.x = INTRINSIC (_mask_ipcvtts_bf16_epi8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtts_bf16_epi8) (mask, s.x); - - CALC (s.a, res_ref); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) - abort (); - - MASK_MERGE (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) - abort (); - - MASK_ZERO (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c deleted file mode 100644 index 9ca0912..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c +++ /dev/null @@ -1,69 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (__bf16 *s, short *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > UCHAR_MAX) - tmp = UCHAR_MAX; - else if (s[i] < 0) - tmp = 0; - else - tmp = s[i]; - r[i] = (unsigned short) tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, bf16_bf) s; - UNION_TYPE (AVX512F_LEN, i_uw) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_bf16_epu8) (s.x); - res2.x = INTRINSIC (_mask_ipcvtts_bf16_epu8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtts_bf16_epu8) (mask, s.x); - - CALC (s.a, res_ref); - - if (UNION_CHECK (AVX512F_LEN, i_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (i_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uw) (res2, res_ref)) - abort (); - - MASK_ZERO (i_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uw) (res3, res_ref)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c deleted file mode 100644 index f56e568..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SRC_SIZE (AVX512F_LEN / 64) -#define SIZE (AVX512F_LEN_HALF / 32) -#include "avx512f-mask-type.h" - -static void -CALC (double *s, int *r) -{ - int i; - - for (i = 0; i < SRC_SIZE; i++) - { - if (s[i] > INT_MAX) - r[i] = INT_MAX; - else if (s[i] < INT_MIN) - r[i] = INT_MIN; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, d) s; - UNION_TYPE (AVX512F_LEN_HALF, i_d) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SRC_SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_pd_epi32) (s.x); - res2.x = INTRINSIC (_mask_cvtts_pd_epi32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_pd_epi32) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref)) - abort (); - - MASK_ZERO (i_d) (res_ref, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundpd_epi32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epi32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi32) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c deleted file mode 100644 index 4400c7c..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c +++ /dev/null @@ -1,88 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 64) -#include "avx512f-mask-type.h" - -static void -CALC (double *s, long long *r) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > LLONG_MAX) - r[i] = LLONG_MAX; - else if (s[i] < LLONG_MIN) - r[i] = LLONG_MIN; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, d) s; - UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_pd_epi64) (s.x); - res2.x = INTRINSIC (_mask_cvtts_pd_epi64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_pd_epi64) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) - abort (); - - MASK_MERGE (i_q) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) - abort (); - - MASK_ZERO (i_q) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundpd_epi64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epi64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi64) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_q) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_q) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c deleted file mode 100644 index f687d0e..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SRC_SIZE (AVX512F_LEN / 64) -#define SIZE (AVX512F_LEN_HALF / 32) -#include "avx512f-mask-type.h" - -static void -CALC (double *s, unsigned int *r) -{ - int i; - - for (i = 0; i < SRC_SIZE; i++) - { - if (s[i] > UINT_MAX) - r[i] = UINT_MAX; - else if (s[i] < 0) - r[i] = 0; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, d) s; - UNION_TYPE (AVX512F_LEN_HALF, i_ud) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SRC_SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_pd_epu32) (s.x); - res2.x = INTRINSIC (_mask_cvtts_pd_epu32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_pd_epu32) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref)) - abort (); - - MASK_MERGE (i_ud) (res_ref, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref)) - abort (); - - MASK_ZERO (i_ud) (res_ref, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundpd_epu32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epu32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu32) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_ud) (res_ref2, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_ud) (res_ref2, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c deleted file mode 100644 index 7b44cdd..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c +++ /dev/null @@ -1,88 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 64) -#include "avx512f-mask-type.h" - -static void -CALC (double *s, unsigned long long *r) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > ULONG_MAX) - r[i] = ULONG_MAX; - else if (s[i] < 0) - r[i] = 0; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, d) s; - UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_pd_epu64) (s.x); - res2.x = INTRINSIC (_mask_cvtts_pd_epu64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_pd_epu64) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) - abort (); - - MASK_MERGE (i_uq) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref)) - abort (); - - MASK_ZERO (i_uq) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundpd_epu64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundpd_epu64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu64) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_uq) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_uq) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c deleted file mode 100644 index 13eb9f0..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c +++ /dev/null @@ -1,90 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (_Float16 *s, short *r) -{ - int i; - char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > SCHAR_MAX) - tmp = SCHAR_MAX; - else if (s[i] < SCHAR_MIN) - tmp = SCHAR_MIN; - else - tmp = s[i]; - r[i] = (unsigned char) tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, h) s; - UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_ph_epi8) (s.x); - res2.x = INTRINSIC (_mask_ipcvtts_ph_epi8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtts_ph_epi8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) - abort (); - - MASK_MERGE (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) - abort (); - - MASK_ZERO (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_roundph_epi8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtts_roundph_epi8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epi8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c deleted file mode 100644 index 1db5a89..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c +++ /dev/null @@ -1,90 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (_Float16 *s, short *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > UCHAR_MAX) - tmp = UCHAR_MAX; - else if (s[i] < 0) - tmp = 0; - else - tmp = s[i]; - r[i] = (unsigned short) tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, h) s; - UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_ph_epu8) (s.x); - res2.x = INTRINSIC (_mask_ipcvtts_ph_epu8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtts_ph_epu8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) - abort (); - - MASK_MERGE (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) - abort (); - - MASK_ZERO (i_w) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_roundph_epu8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtts_roundph_epu8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epu8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c deleted file mode 100644 index 0e9ee27..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c +++ /dev/null @@ -1,88 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, int *r) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > INT_MAX) - r[i] = INT_MAX; - else if (s[i] < INT_MIN) - r[i] = INT_MIN; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, ) s; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }, res_ref2[SIZE]; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_ps_epi32) (s.x); - res2.x = INTRINSIC (_mask_cvtts_ps_epi32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_ps_epi32) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) - abort (); - - MASK_ZERO (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundps_epi32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epi32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epi32) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c deleted file mode 100644 index c2dc7fe..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c +++ /dev/null @@ -1,91 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include -#include - -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, int *r) -{ - int i; - unsigned char tmp; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > SCHAR_MAX) - tmp = SCHAR_MAX; - else if (s[i] < SCHAR_MIN) - tmp = SCHAR_MIN; - else - tmp = s[i]; - r[i] = (unsigned int)tmp; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, ) s; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_ps_epi8) (s.x); - res2.x = INTRINSIC (_mask_ipcvtts_ps_epi8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtts_ps_epi8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) - abort (); - - MASK_ZERO (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_roundps_epi8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtts_roundps_epi8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epi8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c deleted file mode 100644 index 5f5ee8a..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include -#include - -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, int *r) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > UCHAR_MAX) - r[i] = UCHAR_MAX; - else if (s[i] < 0) - r[i] = 0; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, ) s; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_ps_epu8) (s.x); - res2.x = INTRINSIC (_mask_ipcvtts_ps_epu8) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_ipcvtts_ps_epu8) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) - abort (); - - MASK_ZERO (i_d) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_ipcvtts_roundps_epu8) (s.x, 8); - res2.x = INTRINSIC (_mask_ipcvtts_roundps_epu8) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epu8) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c deleted file mode 100644 index 473fffa..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SRC_SIZE (AVX512F_LEN_HALF / 32) -#define SIZE (AVX512F_LEN / 64) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, long long *r) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > LLONG_MAX) - r[i] = LLONG_MAX; - else if (s[i] < LLONG_MIN) - r[i] = LLONG_MIN; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN_HALF, ) s; - UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SRC_SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_ps_epi64) (s.x); - res2.x = INTRINSIC (_mask_cvtts_ps_epi64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_ps_epi64) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) - abort (); - - MASK_MERGE (i_q) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) - abort (); - - MASK_ZERO (i_q) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundps_epi64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epi64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epi64) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_q) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_q) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c deleted file mode 100644 index 5d7ee3c..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c +++ /dev/null @@ -1,88 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, unsigned int *r) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - if (s[i] > UINT_MAX) - r[i] = UINT_MAX; - else if (s[i] < 0) - r[i] = 0; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN, ) s; - UNION_TYPE (AVX512F_LEN, i_ud) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_ps_epu32) (s.x); - res2.x = INTRINSIC (_mask_cvtts_ps_epu32) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_ps_epu32) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref)) - abort (); - - MASK_MERGE (i_ud) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_ud) (res2, res_ref)) - abort (); - - MASK_ZERO (i_ud) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundps_epu32) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epu32) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epu32) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_ud) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_ud) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_ud) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c deleted file mode 100644 index 99ab0ce..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#include - -#define SRC_SIZE (AVX512F_LEN_HALF / 32) -#define SIZE (AVX512F_LEN / 64) -#include "avx512f-mask-type.h" - -static void -CALC (float *s, unsigned long long *r) -{ - int i; - - for (i = 0; i < SRC_SIZE; i++) - { - if (s[i] > ULONG_MAX) - r[i] = ULONG_MAX; - else if (s[i] < 0) - r[i] = 0; - else - r[i] = s[i]; - } -} - -void -TEST (void) -{ - UNION_TYPE (AVX512F_LEN_HALF, ) s; - UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; - int i, sign = 1; - - for (i = 0; i < SRC_SIZE; i++) - { - s.a[i] = 1.23 * (i + 2) * sign; - sign = -sign; - } - - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_ps_epu64) (s.x); - res2.x = INTRINSIC (_mask_cvtts_ps_epu64) (res2.x, mask, s.x); - res3.x = INTRINSIC (_maskz_cvtts_ps_epu64) (mask, s.x); - - CALC (s.a, res_ref); - memcpy(res_ref2, res_ref, sizeof(res_ref)); - - if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) - abort (); - - MASK_MERGE (i_uq) (res_ref, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref)) - abort (); - - MASK_ZERO (i_uq) (res_ref, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) - abort (); - -#if AVX512F_LEN == 512 - for (i = 0; i < SIZE; i++) - res2.a[i] = DEFAULT_VALUE; - - res1.x = INTRINSIC (_cvtts_roundps_epu64) (s.x, 8); - res2.x = INTRINSIC (_mask_cvtts_roundps_epu64) (res2.x, mask, s.x, 8); - res3.x = INTRINSIC (_maskz_cvtts_roundps_epu64) (mask, s.x, 8); - - if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) - abort (); - - MASK_MERGE (i_uq) (res_ref2, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_uq) (res_ref2, mask, SRC_SIZE); - if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) - abort (); -#endif -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vdivbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vdivbf16-2.c deleted file mode 100644 index ff68470..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vdivbf16-2.c +++ /dev/null @@ -1,50 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float x = (float) (2 * (i % 7) + 7); - float y = (float) (3 * (i % 7) - 5); - float res; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - res = x / y; - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); - } - - res1.x = INTRINSIC (_div_pbh) (src1.x, src2.x); - res2.x = INTRINSIC (_mask_div_pbh) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_div_pbh) (mask, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vdpphps-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vdpphps-2.c deleted file mode 100644 index 8f815ce..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vdpphps-2.c +++ /dev/null @@ -1,72 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (float *dest, _Float16 *src1, _Float16 *src2) -{ - int i; - - for (i = 0; i < SIZE; i++) - { - dest[i] += (float) src1[2 * i + 1] * (float) src2[2 * i + 1]; - dest[i] += (float) src1[2 * i] * (float) src2[2 * i]; - } -} - -void -TEST(void) -{ - UNION_TYPE (AVX512F_LEN, h) src1, src2; - UNION_TYPE (AVX512F_LEN,) res1, res2, res3; - MASK_TYPE mask = MASK_VALUE; - float res_ref[SIZE], res_ref2[SIZE], res_ref3[SIZE]; - - for (int i = 0; i < SRC_SIZE; i++) - { - src1.a[i] = (_Float16) (i * 4) + 1.25f16; - src2.a[i] = (_Float16) (i * 2) + 2.5f16; - } - - for (int i = 0; i < SIZE; i++) - { - res1.a[i] = 3.125f + 2 * i; - res_ref[i] = 3.125f + 2 * i; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - res_ref2[i] = DEFAULT_VALUE; - res_ref3[i] = DEFAULT_VALUE; - } - - res1.x = INTRINSIC (_dpph_ps) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpph_ps) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpph_ps) (mask, res3.x, src1.x, src2.x); - - CALC(res_ref, src1.a, src2.a); - CALC(res_ref2, src1.a, src2.a); - CALC(res_ref3, src1.a, src2.a); - - if (UNION_CHECK(AVX512F_LEN,) (res1, res_ref)) - abort (); - - MASK_MERGE () (res_ref2, mask, SIZE); - if (UNION_CHECK(AVX512F_LEN,) (res2, res_ref2)) - abort (); - - MASK_ZERO () (res_ref3, mask, SIZE); - if (UNION_CHECK(AVX512F_LEN,) (res3, res_ref3)) - abort (); -} - diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfmaddXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vfmaddXXXbf16-2.c deleted file mode 100644 index 6a50ede..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfmaddXXXbf16-2.c +++ /dev/null @@ -1,53 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - float x = 0.5; - float y = 2; - float z = 0.25; - src1.a[i] = convert_fp32_to_bf16 (x); - src2.a[i] = convert_fp32_to_bf16 (y); - res1.a[i] = convert_fp32_to_bf16 (z); - res2.a[i] = res1.a[i]; - float x16, y16, z16, m1, m2; - x16 = convert_bf16_to_fp32 (src1.a[i]); - y16 = convert_bf16_to_fp32 (src2.a[i]); - z16 = convert_bf16_to_fp32 (res1.a[i]); - m1 = y16 + x16 * z16; - m2 = z16 + x16 * y16; - res_ref[i] = convert_fp32_to_bf16 (m1); - res_ref2[i] = convert_fp32_to_bf16 (m2); - } - - MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); - MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); - res1.x = INTRINSIC (_mask_fmadd_pbh) (res1.x, mask, src1.x, src2.x); - res2.x = INTRINSIC (_mask3_fmadd_pbh) (src1.x, src2.x, res2.x, mask); - - MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfmsubXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vfmsubXXXbf16-2.c deleted file mode 100644 index 5869c5c..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfmsubXXXbf16-2.c +++ /dev/null @@ -1,54 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - float x = 0.5; - float y = 2; - float z = 0.25; - src1.a[i] = convert_fp32_to_bf16 (x); - src2.a[i] = convert_fp32_to_bf16 (y); - res1.a[i] = convert_fp32_to_bf16 (z); - res2.a[i] = res1.a[i]; - float x16, y16, z16, m1, m2; - x16 = convert_bf16_to_fp32 (src1.a[i]); - y16 = convert_bf16_to_fp32 (src2.a[i]); - z16 = convert_bf16_to_fp32 (res1.a[i]); - m1 = -y16 + x16 * z16; - m2 = -z16 + x16 * y16; - res_ref[i] = convert_fp32_to_bf16 (m1); - res_ref2[i] = convert_fp32_to_bf16 (m2); - } - - MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); - MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); - res1.x = INTRINSIC (_mask_fmsub_pbh) (res1.x, mask, src1.x, src2.x); - res2.x = INTRINSIC (_mask3_fmsub_pbh) (src1.x, src2.x, res2.x, mask); - - MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmaddXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmaddXXXbf16-2.c deleted file mode 100644 index 2173cd3..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmaddXXXbf16-2.c +++ /dev/null @@ -1,54 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - float x = 0.5; - float y = 2; - float z = 0.25; - src1.a[i] = convert_fp32_to_bf16 (x); - src2.a[i] = convert_fp32_to_bf16 (y); - res1.a[i] = convert_fp32_to_bf16 (z); - res2.a[i] = res1.a[i]; - float x16, y16, z16, m1, m2; - x16 = convert_bf16_to_fp32 (src1.a[i]); - y16 = convert_bf16_to_fp32 (src2.a[i]); - z16 = convert_bf16_to_fp32 (res1.a[i]); - m1 = y16 - x16 * z16; - m2 = z16 - x16 * y16; - res_ref[i] = convert_fp32_to_bf16 (m1); - res_ref2[i] = convert_fp32_to_bf16 (m2); - } - - MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); - MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); - res1.x = INTRINSIC (_mask_fnmadd_pbh) (res1.x, mask, src1.x, src2.x); - res2.x = INTRINSIC (_mask3_fnmadd_pbh) (src1.x, src2.x, res2.x, mask); - - MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmsubXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmsubXXXbf16-2.c deleted file mode 100644 index dc323fa..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfnmsubXXXbf16-2.c +++ /dev/null @@ -1,54 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" - -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - float x = 0.5; - float y = 2; - float z = 0.25; - src1.a[i] = convert_fp32_to_bf16 (x); - src2.a[i] = convert_fp32_to_bf16 (y); - res1.a[i] = convert_fp32_to_bf16 (z); - res2.a[i] = res1.a[i]; - float x16, y16, z16, m1, m2; - x16 = convert_bf16_to_fp32 (src1.a[i]); - y16 = convert_bf16_to_fp32 (src2.a[i]); - z16 = convert_bf16_to_fp32 (res1.a[i]); - m1 = -y16 - x16 * z16; - m2 = -z16 - x16 * y16; - res_ref[i] = convert_fp32_to_bf16 (m1); - res_ref2[i] = convert_fp32_to_bf16 (m2); - } - - MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); - MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); - res1.x = INTRINSIC (_mask_fnmsub_pbh) (res1.x, mask, src1.x, src2.x); - res2.x = INTRINSIC (_mask3_fnmsub_pbh) (src1.x, src2.x, res2.x, mask); - - MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfpclassbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vfpclassbf16-2.c deleted file mode 100644 index 1e8609d..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vfpclassbf16-2.c +++ /dev/null @@ -1,45 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - MASK_TYPE res1 = 0, res2 = 0; - __mmask16 exp = 0; - UNION_TYPE (AVX512F_LEN, bf16_uw) src1; - UNION_TYPE (AVX512F_LEN, ) src2; - MASK_TYPE mask = MASK_VALUE; - - for (i = 0; i < SIZE / 2; i++) - { - src1.a[i] = 0; - src2.a[i] = (uint32_t) (src1.a[i]) << 16; - } - - for (i = SIZE / 2; i < SIZE; i++) - src1.a[i] = 0; - - src1.a[0] = 0x7FC0; - src2.a[0] = convert_bf16_to_fp32 (src1.a[0]); - - _mm_setcsr (0x9FC0); - exp = INTRINSIC (_fpclass_ps_mask) (src2.x, 0x01); - - _mm_setcsr (0x1f80); - res1 = INTRINSIC (_fpclass_pbh_mask) (src1.x, 0x01); - res2 = INTRINSIC (_mask_fpclass_pbh_mask) (mask, src1.x, 1); - - if (exp != res1 || (mask & exp) != res2) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vgetexpbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vgetexpbf16-2.c deleted file mode 100644 index a920db5..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vgetexpbf16-2.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float f, s; - f = 28 * i + 1; - src1.a[i] = convert_fp32_to_bf16 (f); - s = convert_bf16_to_fp32 (src1.a[i]); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (getexp (s)); - } - - res1.x = INTRINSIC (_getexp_pbh) (src1.x); - res2.x = INTRINSIC (_mask_getexp_pbh) (res2.x, mask, src1.x); - res3.x = INTRINSIC (_maskz_getexp_pbh) (mask, src1.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vgetmantbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vgetmantbf16-2.c deleted file mode 100644 index 82e3663..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vgetmantbf16-2.c +++ /dev/null @@ -1,51 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 5.0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - src1.a[i] = 0.5; - float x = convert_bf16_to_fp32 (src1.a[i]); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (getmant (x)); - } - - res1.x = INTRINSIC (_getmant_pbh) (src1.x, _MM_MANT_NORM_1_2, - _MM_MANT_SIGN_src); - res2.x = INTRINSIC (_mask_getmant_pbh) (res2.x, mask, src1.x, - _MM_MANT_NORM_1_2, - _MM_MANT_SIGN_src); - res3.x = INTRINSIC (_maskz_getmant_pbh) (mask, src1.x, - _MM_MANT_NORM_1_2, - _MM_MANT_SIGN_src); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vmaxbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vmaxbf16-2.c deleted file mode 100644 index 75236c6..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vmaxbf16-2.c +++ /dev/null @@ -1,52 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float x = 0.5; - float y = 0.25; - float res; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - if (x > y) - res_ref[i] = res_ref2[i] = src1.a[i]; - else - res_ref[i] = res_ref2[i] = src2.a[i]; - } - - res1.x = INTRINSIC (_max_pbh) (src1.x, src2.x); - res2.x = INTRINSIC (_mask_max_pbh) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_max_pbh) (mask, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vminbf16-2.c deleted file mode 100644 index 3ca03cf..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminbf16-2.c +++ /dev/null @@ -1,52 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float x = 0.5; - float y = 0.25; - float res; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - if (x < y) - res_ref[i] = res_ref2[i] = src1.a[i]; - else - res_ref[i] = res_ref2[i] = src2.a[i]; - } - - res1.x = INTRINSIC (_min_pbh) (src1.x, src2.x); - res2.x = INTRINSIC (_mask_min_pbh) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_min_pbh) (mask, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxbf16-2.c deleted file mode 100644 index b1a7bed..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxbf16-2.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-fsignaling-nans -mfpmath=sse -O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include -#include "avx10-minmax-helper.h" -#include "avx512f-mask-type.h" - -void static -CALC (__bf16 *r, __bf16 *s1, __bf16 *s2, int R) -{ - for(int i = 0; i < SIZE; i++) - r[i] = minmax___bf16(&s1[i], &s2[i], R); -} - -void -TEST (void) -{ - int i, sign; - UNION_TYPE (AVX512F_LEN, bf16_bf) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - __bf16 res_ref[SIZE]; - - UNIT_TEST(0, pbh, bf16_bf, __bf16); - UNIT_TEST(1, pbh, bf16_bf, __bf16); - UNIT_TEST(4, pbh, bf16_bf, __bf16); - UNIT_TEST(5, pbh, bf16_bf, __bf16); - UNIT_TEST(16, pbh, bf16_bf, __bf16); - UNIT_TEST(17, pbh, bf16_bf, __bf16); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxpd-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxpd-2.c deleted file mode 100644 index 7bb531f..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxpd-2.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-fsignaling-nans -mfpmath=sse -O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 64) -#include -#include "avx10-minmax-helper.h" -#include "avx512f-mask-type.h" - -void static -CALC (double *r, double *s1, double *s2, int R) -{ - for(int i = 0; i < SIZE; i++) - r[i] = minmax_double(&s1[i], &s2[i], R); -} - -void -TEST (void) -{ - int i, sign; - UNION_TYPE (AVX512F_LEN, d) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - double res_ref[SIZE]; - - UNIT_TEST(0, pd, d, double); - UNIT_TEST(1, pd, d, double); - UNIT_TEST(4, pd, d, double); - UNIT_TEST(5, pd, d, double); - UNIT_TEST(16, pd, d, double); - UNIT_TEST(17, pd, d, double); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxph-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxph-2.c deleted file mode 100644 index 7647f8e..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxph-2.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-fsignaling-nans -mfpmath=sse -O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include -#include "avx10-minmax-helper.h" -#include "avx512f-mask-type.h" - -void static -CALC (_Float16 *r, _Float16 *s1, _Float16 *s2, int R) -{ - for(int i = 0; i < SIZE; i++) - r[i] = minmax__Float16(&s1[i], &s2[i], R); -} - -void -TEST (void) -{ - int i, sign; - UNION_TYPE (AVX512F_LEN, h) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - _Float16 res_ref[SIZE]; - - UNIT_TEST(0, ph, h, _Float16); - UNIT_TEST(1, ph, h, _Float16); - UNIT_TEST(4, ph, h, _Float16); - UNIT_TEST(5, ph, h, _Float16); - UNIT_TEST(16, ph, h, _Float16); - UNIT_TEST(17, ph, h, _Float16); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxps-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxps-2.c deleted file mode 100644 index 1eaa0b2..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vminmaxps-2.c +++ /dev/null @@ -1,36 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-fsignaling-nans -mfpmath=sse -O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 32) -#include -#include "avx10-minmax-helper.h" -#include "avx512f-mask-type.h" - -void static -CALC (float *r, float *s1, float *s2, int R) -{ - for(int i = 0; i < SIZE; i++) - r[i] = minmax_float(&s1[i], &s2[i], R); -} - -void -TEST (void) -{ - int i, sign; - UNION_TYPE (AVX512F_LEN, ) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - float res_ref[SIZE]; - - UNIT_TEST(0, ps, , float); - UNIT_TEST(1, ps, , float); - UNIT_TEST(4, ps, , float); - UNIT_TEST(5, ps, , float); - UNIT_TEST(16, ps, , float); - UNIT_TEST(17, ps, , float); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vmpsadbw-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vmpsadbw-2.c deleted file mode 100644 index a0a90f7..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vmpsadbw-2.c +++ /dev/null @@ -1,93 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 8) -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -static void -CALC (short* dst, char* src1, char* src2, int cont) -{ - int blk2_pos, blk1_pos, i, j, k, c; - char blk1[12], blk2[4], x; - short tmp[4], s; - - for (k = 0; k < AVX512F_LEN / 128; k++) - { - c = cont & 0xff; - if (k % 2 == 1) - c >>= 3; - blk2_pos = (c & 3) * 4; - blk1_pos = ((c >> 2) & 1) * 4; - - for (i = 0; i < 11; i++) - blk1[i] = src1[16 * k + i + blk1_pos]; - - for (i = 0; i < 4; i++) - blk2[i] = src2[16 * k + i + blk2_pos]; - - for (i = 0; i < 8; i++) - { - for (j = 0; j < 4; j++) - { - x = blk1[j + i] - blk2[j]; - tmp[j] = x > 0 ? x : -x; - } - - s = 0; - for (j = 0; j < 4; j++) - s += tmp[j]; - dst[8 * k + i] = s; - } - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, i_b) src2; - MASK_TYPE mask = MASK_VALUE; - short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - src1.a[i] = 10 + 2 * i; - src2.a[i] = 3 * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, src1.a, src2.a, 0x21); - CALC (res_ref2, src1.a, src2.a, 0x21); - - res1.x = INTRINSIC (_mpsadbw_epu8) (src1.x, src2.x, 0x21); - res2.x = INTRINSIC (_mask_mpsadbw_epu8) (res2.x, mask, src1.x, src2.x, 0x21); - res3.x = INTRINSIC (_maskz_mpsadbw_epu8) (mask, src1.x, src2.x, 0x21); - - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) - abort (); - - MASK_MERGE (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_w) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vmulbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vmulbf16-2.c deleted file mode 100644 index fe65d95..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vmulbf16-2.c +++ /dev/null @@ -1,50 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float x = (float) (2 * (i % 7) + 7); - float y = (float) (3 * (i % 7) - 5); - float res; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - res = x * y; - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); - } - - res1.x = INTRINSIC (_mul_pbh) (src1.x, src2.x); - res2.x = INTRINSIC (_mask_mul_pbh) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_mul_pbh) (mask, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssd-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssd-2.c deleted file mode 100644 index 493cd2b..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssd-2.c +++ /dev/null @@ -1,73 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 8) -#define SIZE (AVX512F_LEN / 32) - -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, char *s1, char *s2) -{ - short tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (short) s1[i] * (short) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] - + tempres[i * 4 + 2] + tempres[i * 4 + 3]; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, i_b) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign * (10 + 3 * i * i); - src2.a[i] = sign * 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpbssd_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpbssd_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpbssd_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssds-2.c deleted file mode 100644 index 479b893..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbssds-2.c +++ /dev/null @@ -1,75 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 8) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, char *s1, char *s2) -{ - short tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (short) s1[i] * (short) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] - + tempres[i * 4 + 2] + tempres[i * 4 + 3]; - long long max_int = 0x7FFFFFFF; - if (test > max_int) - test = max_int; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, i_b) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign * (10 + 3 * i * i); - src2.a[i] = sign * 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpbssds_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpbssds_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpbssds_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsud-2.c deleted file mode 100644 index d0c090d..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsud-2.c +++ /dev/null @@ -1,72 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 8) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, char *s1, unsigned char *s2) -{ - short tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (short) s1[i] * (unsigned short) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] - + tempres[i * 4 + 2] + tempres[i * 4 + 3]; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, i_ub) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign*10*i*i; - src2.a[i] = 10 + 3*i*i + sign; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpbsud_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpbsud_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpbsud_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsuds-2.c deleted file mode 100644 index 8d89c33..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbsuds-2.c +++ /dev/null @@ -1,75 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 8) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, char *s1, unsigned char *s2) -{ - short tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (short) s1[i] * (unsigned short) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] - + tempres[i * 4 + 2] + tempres[i * 4 + 3]; - long long max_int = 0x7FFFFFFF; - if (test > max_int) - test = max_int; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_b) src1; - UNION_TYPE (AVX512F_LEN, i_ub) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign * 10 * i * i; - src2.a[i] = 10 + 3 * i * i + sign; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpbsuds_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpbsuds_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpbsuds_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuud-2.c deleted file mode 100644 index 37a4a54..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuud-2.c +++ /dev/null @@ -1,71 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 8) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, unsigned char *s1, unsigned char *s2) -{ - unsigned short tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (unsigned short) s1[i] * (unsigned short) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] - + tempres[i * 4 + 2] + tempres[i * 4 + 3]; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_ub) src1; - UNION_TYPE (AVX512F_LEN, i_ub) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - src1.a[i] = 10 + 3 * i * i; - src2.a[i] = 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpbuud_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpbuud_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpbuud_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuuds-2.c deleted file mode 100644 index 8b18d6f..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpbuuds-2.c +++ /dev/null @@ -1,74 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 8) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, unsigned char *s1, unsigned char *s2) -{ - unsigned short tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (unsigned short) s1[i] * (unsigned short) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] - + tempres[i * 4 + 2] + tempres[i * 4 + 3]; - long long max_uint = 0xFFFFFFFF; - if (test > max_uint) - test = max_uint; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_ub) src1; - UNION_TYPE (AVX512F_LEN, i_ub) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - src1.a[i] = 10 + 3 * i * i; - src2.a[i] = 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpbuuds_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpbuuds_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpbuuds_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsud-2.c deleted file mode 100644 index 824f814..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsud-2.c +++ /dev/null @@ -1,71 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, short *s1, unsigned short *s2) -{ - int tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (int) s1[i] * (unsigned int) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_w) src1; - UNION_TYPE (AVX512F_LEN, i_uw) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign * (10 + 3 * i * i); - src2.a[i] = sign * 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpwsud_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpwsud_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpwsud_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsuds-2.c deleted file mode 100644 index 7e51349..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwsuds-2.c +++ /dev/null @@ -1,74 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, short *s1, unsigned short *s2) -{ - int tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (int) s1[i] * (unsigned int) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; - long long max_int = 0x7FFFFFFF; - if (test > max_int) - test = max_int; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_w) src1; - UNION_TYPE (AVX512F_LEN, i_uw) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign * (10 + 3 * i * i); - src2.a[i] = sign * 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpwsuds_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpwsuds_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpwsuds_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusd-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusd-2.c deleted file mode 100644 index 4727d91..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusd-2.c +++ /dev/null @@ -1,71 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, unsigned short *s1, short *s2) -{ - int tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (unsigned int) s1[i] * (int) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_uw) src1; - UNION_TYPE (AVX512F_LEN, i_w) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign * 10 * i * i; - src2.a[i] = 10 + 3 * i * i + sign; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpwusd_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpwusd_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpwusd_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusds-2.c deleted file mode 100644 index 9f965df..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwusds-2.c +++ /dev/null @@ -1,74 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, unsigned short *s1, short *s2) -{ - int tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (unsigned int) s1[i] * (int) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; - long long max_int = 0x7FFFFFFF; - if (test > max_int) - test = max_int; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_uw) src1; - UNION_TYPE (AVX512F_LEN, i_w) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - int sign = i % 2 ? 1 : -1; - src1.a[i] = sign * 10 * i * i; - src2.a[i] = 10 + 3 * i * i + sign; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpwusds_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpwusds_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpwusds_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuud-2.c deleted file mode 100644 index bf0a564..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuud-2.c +++ /dev/null @@ -1,70 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, unsigned short *s1, unsigned short *s2) -{ - unsigned int tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (unsigned int) s1[i] * (unsigned int) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_uw) src1; - UNION_TYPE (AVX512F_LEN, i_uw) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - src1.a[i] = 10 + 3 * i * i; - src2.a[i] = 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpwuud_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpwuud_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpwuud_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuuds-2.c deleted file mode 100644 index c075e0e..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vpdpwuuds-2.c +++ /dev/null @@ -1,73 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif - -#include "avx10-helper.h" - -#define SRC_SIZE (AVX512F_LEN / 16) -#define SIZE (AVX512F_LEN / 32) -#include "avx512f-mask-type.h" - -static void -CALC (int *r, int *dst, unsigned short *s1, unsigned short *s2) -{ - unsigned int tempres[SRC_SIZE]; - for (int i = 0; i < SRC_SIZE; i++) - tempres[i] = (unsigned int) s1[i] * (unsigned int) s2[i]; - for (int i = 0; i < SIZE; i++) - { - long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; - long long max_uint = 0xFFFFFFFF; - if (test > max_uint) - test = max_uint; - r[i] = test; - } -} - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; - UNION_TYPE (AVX512F_LEN, i_uw) src1; - UNION_TYPE (AVX512F_LEN, i_uw) src2; - MASK_TYPE mask = MASK_VALUE; - int res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SRC_SIZE; i++) - { - src1.a[i] = 10 + 3 * i * i; - src2.a[i] = 10 * i * i; - } - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0x7FFFFFFF; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - } - - CALC (res_ref, res1.a, src1.a, src2.a); - CALC (res_ref2, res2.a, src1.a, src2.a); - - res1.x = INTRINSIC (_dpwuuds_epi32) (res1.x, src1.x, src2.x); - res2.x = INTRINSIC (_mask_dpwuuds_epi32) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_dpwuuds_epi32) (mask, res3.x, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) - abort (); - - MASK_MERGE (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) - abort (); - - MASK_ZERO (i_d) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vrcpbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vrcpbf16-2.c deleted file mode 100644 index 28c7ada..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vrcpbf16-2.c +++ /dev/null @@ -1,46 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float s1 = 2.0; - src1.a[i] = convert_fp32_to_bf16 (s1); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (1.0 / s1); - } - - res1.x = INTRINSIC (_rcp_pbh) (src1.x); - res2.x = INTRINSIC (_mask_rcp_pbh) (res2.x, mask, src1.x); - res3.x = INTRINSIC (_maskz_rcp_pbh) (mask, src1.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vreducebf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vreducebf16-2.c deleted file mode 100644 index d506389..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vreducebf16-2.c +++ /dev/null @@ -1,51 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 5.0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float s = (float) (SIZE - 1) / (float) i; - src1.a[i] = convert_fp32_to_bf16 (s); - float x = convert_bf16_to_fp32 (src1.a[i]); - __m128 px = _mm_load_ss (&x); - __m128 mx = _mm_broadcastss_ps (px); - __m128 out = _mm_reduce_ps (mx, 0x10); - float res = _mm_cvtss_f32 (out); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); - } - - res1.x = INTRINSIC (_reduce_pbh) (src1.x, 0x10); - res2.x = INTRINSIC (_mask_reduce_pbh) (res2.x, mask, src1.x, 0x10); - res3.x = INTRINSIC (_maskz_reduce_pbh) (mask, src1.x, 0x10); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vrndscalebf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vrndscalebf16-2.c deleted file mode 100644 index 1b29fc6..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vrndscalebf16-2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 5.0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float s = (float) (SIZE - 1) / (float) i; - src1.a[i] = convert_fp32_to_bf16 (s); - float x = convert_bf16_to_fp32 (src1.a[i]); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (rndscale (x)); - } - - res1.x = INTRINSIC (_roundscale_pbh) (src1.x, 0x10); - res2.x = INTRINSIC (_mask_roundscale_pbh) (res2.x, mask, src1.x, 0x10); - res3.x = INTRINSIC (_maskz_roundscale_pbh) (mask, src1.x, 0x10); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vrsqrtbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vrsqrtbf16-2.c deleted file mode 100644 index 444b332..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vrsqrtbf16-2.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float s1 = 2.0; - float rs = 1.0 / sqrtf (s1); - src1.a[i] = convert_fp32_to_bf16 (s1); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (rs); - } - - res1.x = INTRINSIC (_rsqrt_pbh) (src1.x); - res2.x = INTRINSIC (_mask_rsqrt_pbh) (res2.x, mask, src1.x); - res3.x = INTRINSIC (_maskz_rsqrt_pbh) (mask, src1.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vscalefbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vscalefbf16-2.c deleted file mode 100644 index b1c5f4b..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vscalefbf16-2.c +++ /dev/null @@ -1,52 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float x = (float) (2 * (i % 7) + 7); - float y = 1.0 + (float) (4 * i) / (float) SIZE; - float xx, yy, res; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - xx = convert_bf16_to_fp32 (src1.a[i]); - yy = convert_bf16_to_fp32 (src2.a[i]); - res = scalef (xx, yy); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (res); - } - - res1.x = INTRINSIC (_scalef_pbh) (src1.x, src2.x); - res2.x = INTRINSIC (_mask_scalef_pbh) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_scalef_pbh) (mask, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vsqrtbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vsqrtbf16-2.c deleted file mode 100644 index 12f87b3..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vsqrtbf16-2.c +++ /dev/null @@ -1,48 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#include -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float s1 = i + 1.0; - float rs = sqrtf (s1); - src1.a[i] = convert_fp32_to_bf16_ne (s1); - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (rs); - } - - res1.x = INTRINSIC (_sqrt_pbh) (src1.x); - res2.x = INTRINSIC (_mask_sqrt_pbh) (res2.x, mask, src1.x); - res3.x = INTRINSIC (_maskz_sqrt_pbh) (mask, src1.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vsubbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vsubbf16-2.c deleted file mode 100644 index 16a5ace..0000000 --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vsubbf16-2.c +++ /dev/null @@ -1,50 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ - -#ifndef AVX10_2 -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#endif -#include "avx10-helper.h" -#define SIZE (AVX512F_LEN / 16) -#include "avx512f-mask-type.h" - -void -TEST (void) -{ - int i; - UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; - MASK_TYPE mask = MASK_VALUE; - unsigned short res_ref[SIZE], res_ref2[SIZE]; - - for (i = 0; i < SIZE; i++) - { - res1.a[i] = 0; - res2.a[i] = DEFAULT_VALUE; - res3.a[i] = DEFAULT_VALUE; - float x = (float) (2 * (i % 7) + 7); - float y = (float) (3 * (i % 7) - 5); - float res; - src2.a[i] = convert_fp32_to_bf16 (y); - src1.a[i] = convert_fp32_to_bf16 (x); - res = x - y; - res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); - } - - res1.x = INTRINSIC (_sub_pbh) (src1.x, src2.x); - res2.x = INTRINSIC (_mask_sub_pbh) (res2.x, mask, src1.x, src2.x); - res3.x = INTRINSIC (_maskz_sub_pbh) (mask, src1.x, src2.x); - - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) - abort (); - - MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) - abort (); - - MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) - abort (); -} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.c index d880454..36f5bd7 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vaddbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vaddbf16-2.c" +#include "avx10_2-vaddbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vaddbf16-2.c" +#include "avx10_2-vaddbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.h new file mode 100644 index 0000000..a65c647 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vaddbf16-2.h @@ -0,0 +1,41 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float x = (float) (2 * (i % 7) + 7); + float y = (float) (3 * (i % 7) - 5); + float res; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + res = x + y; + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); + } + + res1.x = INTRINSIC (_add_pbh) (src1.x, src2.x); + res2.x = INTRINSIC (_mask_add_pbh) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_add_pbh) (mask, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.c index cb6506a..643fb26 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcmpbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcmpbf16-2.c" +#include "avx10_2-vcmpbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcmpbf16-2.c" +#include "avx10_2-vcmpbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.h new file mode 100644 index 0000000..2c0fde0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcmpbf16-2.h @@ -0,0 +1,28 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + __mmask32 res1, res2, exp = 0; + UNION_TYPE (AVX512F_LEN, bf16_uw) src1, src2; + MASK_TYPE mask = MASK_VALUE; + + for (i = 0; i < SIZE; i++) + { + float x = 0.5; + float y = 0.25; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + if (src1.a[i] == src2.a[i]) + exp |= 1 << i; + } + + res1 = INTRINSIC (_cmp_pbh_mask) (src1.x, src2.x, 0); + res2 = INTRINSIC (_mask_cmp_pbh_mask) (mask, src1.x, src2.x, 0); + + if (exp != res1 || exp != res2) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.c index 9dd940c..dae2f44 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvt2ph2bf8-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2bf8-2.c" +#include "avx10_2-vcvt2ph2bf8-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2bf8-2.c" +#include "avx10_2-vcvt2ph2bf8-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.h new file mode 100644 index 0000000..b46540b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8-2.h @@ -0,0 +1,70 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE_SRC (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) +{ + _Float16 temp; + Float16Union ut = {.f16 = temp}; + int i, hf8_bf8, saturate; + + hf8_bf8 = 1; + saturate = 0; + + for (i = 0; i < SIZE; i++) + { + r[i] = 0; + if (i < SIZE_SRC) + { + Float16Union usrc2 = {.f16 = s2[i]}; + ut.u16 = usrc2.u16; + } + else + { + Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; + ut.u16 = usrc1.u16; + } + r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE]; + + sign = 1; + for (i = 0; i < SIZE_SRC; i++) + { + src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); + src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC(res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvt2ph_bf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvt2ph_bf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvt2ph_bf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.c index 2a9caca..badd865 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvt2ph2bf8s-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2bf8s-2.c" +#include "avx10_2-vcvt2ph2bf8s-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2bf8s-2.c" +#include "avx10_2-vcvt2ph2bf8s-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.h new file mode 100644 index 0000000..398c67b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.h @@ -0,0 +1,70 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE_SRC (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) +{ + _Float16 temp; + Float16Union ut = {.f16 = temp}; + int i, hf8_bf8, saturate; + + hf8_bf8 = 1; + saturate = 1; + + for (i = 0; i < SIZE; i++) + { + r[i] = 0; + if (i < SIZE_SRC) + { + Float16Union usrc2 = {.f16 = s2[i]}; + ut.u16 = usrc2.u16; + } + else + { + Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; + ut.u16 = usrc1.u16; + } + r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE]; + + sign = 1; + for (i = 0; i < SIZE_SRC; i++) + { + src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); + src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC(res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvts_2ph_bf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvts_2ph_bf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvts_2ph_bf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.c index 80dc248..4555b3d 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvt2ph2hf8-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2hf8-2.c" +#include "avx10_2-vcvt2ph2hf8-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2hf8-2.c" +#include "avx10_2-vcvt2ph2hf8-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.h new file mode 100644 index 0000000..89a2c7e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8-2.h @@ -0,0 +1,70 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE_SRC (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) +{ + _Float16 temp; + Float16Union ut = {.f16 = temp}; + int i, hf8_bf8, saturate; + + hf8_bf8 = 0; + saturate = 0; + + for (i = 0; i < SIZE; i++) + { + r[i] = 0; + if (i < SIZE_SRC) + { + Float16Union usrc2 = {.f16 = s2[i]}; + ut.u16 = usrc2.u16; + } + else + { + Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; + ut.u16 = usrc1.u16; + } + r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE]; + + sign = 1; + for (i = 0; i < SIZE_SRC; i++) + { + src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); + src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC(res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvt2ph_hf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvt2ph_hf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvt2ph_hf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.c index 30f6a60..ba62e547 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvt2ph2hf8s-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2hf8s-2.c" +#include "avx10_2-vcvt2ph2hf8s-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ph2hf8s-2.c" +#include "avx10_2-vcvt2ph2hf8s-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.h new file mode 100644 index 0000000..2556c3f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.h @@ -0,0 +1,70 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE_SRC (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s1, _Float16 *s2) +{ + _Float16 temp; + Float16Union ut = {.f16 = temp}; + int i, hf8_bf8, saturate; + + hf8_bf8 = 0; + saturate = 1; + + for (i = 0; i < SIZE; i++) + { + r[i] = 0; + if (i < SIZE_SRC) + { + Float16Union usrc2 = {.f16 = s2[i]}; + ut.u16 = usrc2.u16; + } + else + { + Float16Union usrc1 = {.f16 = s1[i-SIZE_SRC]}; + ut.u16 = usrc1.u16; + } + r[i] = convert_fp16_to_fp8(ut.f16, 0, hf8_bf8, saturate); + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE]; + + sign = 1; + for (i = 0; i < SIZE_SRC; i++) + { + src1.a[i] = (_Float16)(sign * (1.5 * (1 << (i % 3)))); + src2.a[i] = (_Float16)(-sign * (2.5 * (1 << (i % 3)))); + sign *= -1; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC(res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvts_2ph_hf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvts_2ph_hf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvts_2ph_hf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.c index 125713c..27735c0 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvt2ps2phx-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ps2phx-2.c" +#include "avx10_2-vcvt2ps2phx-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvt2ps2phx-2.c" +#include "avx10_2-vcvt2ps2phx-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.h new file mode 100644 index 0000000..f7d4365 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvt2ps2phx-2.h @@ -0,0 +1,53 @@ +#include "avx10-helper.h" +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (_Float16 *res_ref, float *src1, float *src2) +{ + float fp32; + int i; + for (i = 0; i < SIZE / 2; i++) + { + fp32 = (float) 2 * i + 7 + i * 0.5; + res_ref[i] = fp32; + src2[i] = fp32; + } + for (i = SIZE / 2; i < SIZE; i++) + { + fp32 = (float)2 * i + 7 + i * 0.5; + res_ref[i] = fp32; + src1[i - (SIZE / 2)] = fp32; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, h) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, ) src1, src2; + MASK_TYPE mask = MASK_VALUE; + _Float16 res_ref[SIZE]; + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC (res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvtx2ps_ph) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN, h) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvtx2ps_ph) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (h) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, h) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvtx2ps_ph) (mask, src1.x, src2.x); + MASK_ZERO (h) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, h) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.c index 824ec68..a420901 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtbf162ibs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbf162ibs-2.c" +#include "avx10_2-vcvtbf162ibs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbf162ibs-2.c" +#include "avx10_2-vcvtbf162ibs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.h new file mode 100644 index 0000000..9f984d1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162ibs-2.h @@ -0,0 +1,60 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (__bf16 *s, short *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > SCHAR_MAX) + tmp = SCHAR_MAX; + else if (s[i] < SCHAR_MIN) + tmp = SCHAR_MIN; + else + tmp = nearbyint(_mm_cvtsbh_ss(s[i])); + r[i] = (unsigned short)tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, bf16_bf) s; + UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + short res_ref[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_bf16_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_bf16_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_bf16_epi8) (mask, s.x); + + CALC (s.a, res_ref); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + abort (); + + MASK_MERGE (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) + abort (); + + MASK_ZERO (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.c index b8f9925..7fdae8f 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtbf162iubs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbf162iubs-2.c" +#include "avx10_2-vcvtbf162iubs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbf162iubs-2.c" +#include "avx10_2-vcvtbf162iubs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.h new file mode 100644 index 0000000..b5eb59f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbf162iubs-2.h @@ -0,0 +1,60 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (__bf16 *s, unsigned short *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > UCHAR_MAX) + tmp = UCHAR_MAX; + else if (s[i] < 0) + tmp = 0; + else + tmp = nearbyint(_mm_cvtsbh_ss(s[i])); + r[i] = (unsigned short)tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, bf16_bf) s; + UNION_TYPE (AVX512F_LEN, i_uw) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_bf16_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_bf16_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_bf16_epu8) (mask, s.x); + + CALC (s.a, res_ref); + + if (UNION_CHECK (AVX512F_LEN, i_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (i_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uw) (res2, res_ref)) + abort (); + + MASK_ZERO (i_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uw) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.c index e3f2a81..7c56893 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtbiasph2bf8-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2bf8-2.c" +#include "avx10_2-vcvtbiasph2bf8-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2bf8-2.c" +#include "avx10_2-vcvtbiasph2bf8-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.h new file mode 100644 index 0000000..42a81d8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.h @@ -0,0 +1,66 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SRC_F8_I8 (AVX512F_LEN / 8) +#define SRC_F16 (AVX512F_LEN / 16) +#define DST_F8_I8 (AVX512F_LEN_HALF / 8) +#define DST_F16 (AVX512F_LEN_HALF / 16) +#define SIZE SRC_F16 + +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, char *src1, _Float16 *src2) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 1; + saturate = 0; + + for (i = 0; i < DST_F8_I8; i++) + { + Float16Union usrc = {.f16 = src2[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); + } + + if (AVX512F_LEN == 128) + for (i = DST_F16; i < DST_F8_I8; i++) + r[i] = 0; +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, h) src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[DST_F8_I8]; + + sign = 1; + for (i = 0; i < SRC_F16; i++) + { + src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC (res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvtbiasph_bf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvtbiasph_bf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvtbiasph_bf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.c index 2b9f81d..3d2851b 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtbiasph2bf8s-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2bf8s-2.c" +#include "avx10_2-vcvtbiasph2bf8s-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2bf8s-2.c" +#include "avx10_2-vcvtbiasph2bf8s-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.h new file mode 100644 index 0000000..2477960 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.h @@ -0,0 +1,67 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SRC_F8_I8 (AVX512F_LEN / 8) +#define SRC_F16 (AVX512F_LEN / 16) +#define DST_F8_I8 (AVX512F_LEN_HALF / 8) +#define DST_F16 (AVX512F_LEN_HALF / 16) +#define SIZE SRC_F16 + +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, char *src1, _Float16 *src2) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 1; + saturate = 1; + + for (i = 0; i < DST_F8_I8; i++) + { + Float16Union usrc = {.f16 = src2[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); + } + + if (AVX512F_LEN == 128) + for (i = DST_F16; i < DST_F8_I8; i++) + r[i] = 0; +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, h) src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[DST_F8_I8]; + + sign = 1; + for (i = 0; i < SRC_F16; i++) + { + src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC (res_ref, src1.a, src2.a); + + + res1.x = INTRINSIC (_cvts_biasph_bf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvts_biasph_bf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvts_biasph_bf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.c index 27e5f21..ac832d2 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtbiasph2hf8-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2hf8-2.c" +#include "avx10_2-vcvtbiasph2hf8-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2hf8-2.c" +#include "avx10_2-vcvtbiasph2hf8-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.h new file mode 100644 index 0000000..629c8a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.h @@ -0,0 +1,66 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SRC_F8_I8 (AVX512F_LEN / 8) +#define SRC_F16 (AVX512F_LEN / 16) +#define DST_F8_I8 (AVX512F_LEN_HALF / 8) +#define DST_F16 (AVX512F_LEN_HALF / 16) +#define SIZE SRC_F16 + +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, char *src1, _Float16 *src2) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 0; + saturate = 0; + + for (i = 0; i < DST_F8_I8; i++) + { + Float16Union usrc = {.f16 = src2[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); + } + + if (AVX512F_LEN == 128) + for (i = DST_F16; i < DST_F8_I8; i++) + r[i] = 0; +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, h) src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[DST_F8_I8]; + + sign = 1; + for (i = 0; i < SRC_F16; i++) + { + src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC (res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvtbiasph_hf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvtbiasph_hf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvtbiasph_hf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.c index b93a1f978..bff5282 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtbiasph2hf8s-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2hf8s-2.c" +#include "avx10_2-vcvtbiasph2hf8s-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtbiasph2hf8s-2.c" +#include "avx10_2-vcvtbiasph2hf8s-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.h new file mode 100644 index 0000000..fdda376 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.h @@ -0,0 +1,66 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SRC_F8_I8 (AVX512F_LEN / 8) +#define SRC_F16 (AVX512F_LEN / 16) +#define DST_F8_I8 (AVX512F_LEN_HALF / 8) +#define DST_F16 (AVX512F_LEN_HALF / 16) +#define SIZE SRC_F16 + +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, char *src1, _Float16 *src2) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 0; + saturate = 1; + + for (i = 0; i < DST_F8_I8; i++) + { + Float16Union usrc = {.f16 = src2[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, src1[2 * i], hf8_bf8, saturate); + } + + if (AVX512F_LEN == 128) + for (i = DST_F16; i < DST_F8_I8; i++) + r[i] = 0; +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, h) src2; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[DST_F8_I8]; + + sign = 1; + for (i = 0; i < SRC_F16; i++) + { + src2.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC (res_ref, src1.a, src2.a); + + res1.x = INTRINSIC (_cvts_biasph_hf8) (src1.x, src2.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvts_biasph_hf8) (res2.x, mask, src1.x, src2.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvts_biasph_hf8) (mask, src1.x, src2.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.c index d647fde..d6f5040 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvthf82ph-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL -#define AVX512F_LEN 256 +#define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvthf82ph-2.c" +#include "avx10_2-vcvthf82ph-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvthf82ph-2.c" +#include "avx10_2-vcvthf82ph-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.h new file mode 100644 index 0000000..7e9e894 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvthf82ph-2.h @@ -0,0 +1,50 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE_SRC (AVX512F_LEN_HALF / 8) +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +CALC (_Float16 *r, unsigned char *s) +{ + int i; + for (i = 0; i < SIZE; i++) + r[i] = convert_hf8_to_fp16(s[i]); +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN, h) res1, res2, res3; + UNION_TYPE (AVX512F_LEN_HALF, i_b) src; + MASK_TYPE mask = MASK_VALUE; + _Float16 res_ref[SIZE]; + + sign = 1; + for (i = 0; i < SIZE_SRC; i++) + { + src.a[i] = sign * (2.5 * (1 << (i % 3))); + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + CALC(res_ref, src.a); + + res1.x = INTRINSIC (_cvthf8_ph) (src.x); + if (UNION_ROUGH_CHECK (AVX512F_LEN, h) (res1, res_ref, 0.0009765625)) + abort (); + + res2.x = INTRINSIC (_mask_cvthf8_ph) (res2.x, mask, src.x); + MASK_MERGE (h) (res_ref, mask, SIZE); + if (UNION_ROUGH_CHECK (AVX512F_LEN, h) (res2, res_ref, 0.0009765625)) + abort (); + + res3.x = INTRINSIC (_maskz_cvthf8_ph) (mask, src.x); + MASK_ZERO (h) (res_ref, mask, SIZE); + if (UNION_ROUGH_CHECK (AVX512F_LEN, h) (res3, res_ref, 0.0009765625)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.c index 826b5ff..aa10ebe 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtph2bf8-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2bf8-2.c" +#include "avx10_2-vcvtph2bf8-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2bf8-2.c" +#include "avx10_2-vcvtph2bf8-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.h new file mode 100644 index 0000000..2ea3710 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8-2.h @@ -0,0 +1,66 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE (AVX512F_LEN / 16) +#define SIZE_DST (AVX512F_LEN_HALF / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 1; + saturate = 0; + + for (i = 0; i < SIZE_DST; i++) + { + r[i] = 0; + if (i < SIZE) + { + Float16Union usrc = {.f16 = s[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); + } + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE_DST]; + + sign = 1; + for (i = 0; i < SIZE; i++) + { + src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + +#if AVX512F_LEN > 128 + for (i = 0; i < SIZE_DST; i++) + res2.a[i] = DEFAULT_VALUE; +#else + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; +#endif + + CALC(res_ref, src.a); + + res1.x = INTRINSIC (_cvtph_bf8) (src.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvtph_bf8) (res2.x, mask, src.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvtph_bf8) (mask, src.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.c index c5b9576..471e702 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtph2bf8s-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2bf8s-2.c" +#include "avx10_2-vcvtph2bf8s-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2bf8s-2.c" +#include "avx10_2-vcvtph2bf8s-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.h new file mode 100644 index 0000000..242975d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2bf8s-2.h @@ -0,0 +1,66 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE (AVX512F_LEN / 16) +#define SIZE_DST (AVX512F_LEN_HALF / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 1; + saturate = 1; + + for (i = 0; i < SIZE_DST; i++) + { + r[i] = 0; + if (i < SIZE) + { + Float16Union usrc = {.f16 = s[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); + } + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE_DST]; + + sign = 1; + for (i = 0; i < SIZE; i++) + { + src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + +#if AVX512F_LEN > 128 + for (i = 0; i < SIZE_DST; i++) + res2.a[i] = DEFAULT_VALUE; +#else + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; +#endif + + CALC(res_ref, src.a); + + res1.x = INTRINSIC (_cvts_ph_bf8) (src.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvts_ph_bf8) (res2.x, mask, src.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvts_ph_bf8) (mask, src.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.c index 00f2928..e260dca 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtph2hf8-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2hf8-2.c" +#include "avx10_2-vcvtph2hf8-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2hf8-2.c" +#include "avx10_2-vcvtph2hf8-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.h new file mode 100644 index 0000000..84aba75 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8-2.h @@ -0,0 +1,66 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE (AVX512F_LEN / 16) +#define SIZE_DST (AVX512F_LEN_HALF / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 0; + saturate = 0; + + for (i = 0; i < SIZE_DST; i++) + { + r[i] = 0; + if (i < SIZE) + { + Float16Union usrc = {.f16 = s[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); + } + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE]; + + sign = 1; + for (i = 0; i < SIZE; i++) + { + src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + +#if AVX512F_LEN > 128 + for (i = 0; i < SIZE_DST; i++) + res2.a[i] = DEFAULT_VALUE; +#else + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; +#endif + + CALC(res_ref, src.a); + + res1.x = INTRINSIC (_cvtph_hf8) (src.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvtph_hf8) (res2.x, mask, src.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvtph_hf8) (mask, src.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.c index a2fa0c8..06882b8 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtph2hf8s-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2hf8s-2.c" +#include "avx10_2-vcvtph2hf8s-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2hf8s-2.c" +#include "avx10_2-vcvtph2hf8s-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.h new file mode 100644 index 0000000..28604c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2hf8s-2.h @@ -0,0 +1,66 @@ +#include "avx10-helper.h" +#include "fp8-helper.h" + +#define SIZE (AVX512F_LEN / 16) +#define SIZE_DST (AVX512F_LEN_HALF / 8) +#include "avx512f-mask-type.h" + +void +CALC (unsigned char *r, _Float16 *s) +{ + int i, hf8_bf8, saturate; + + hf8_bf8 = 0; + saturate = 1; + + for (i = 0; i < SIZE_DST; i++) + { + r[i] = 0; + if (i < SIZE) + { + Float16Union usrc = {.f16 = s[i]}; + r[i] = convert_fp16_to_fp8(usrc.f16, 0, hf8_bf8, saturate); + } + } +} + +void +TEST (void) +{ + int i,sign; + UNION_TYPE (AVX512F_LEN_HALF, i_b) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, h) src; + MASK_TYPE mask = MASK_VALUE; + unsigned char res_ref[SIZE]; + + sign = 1; + for (i = 0; i < SIZE; i++) + { + src.a[i] = (_Float16)(sign * (2.5 * (1 << (i % 3)))); + sign = -sign; + } + +#if AVX512F_LEN > 128 + for (i = 0; i < SIZE_DST; i++) + res2.a[i] = DEFAULT_VALUE; +#else + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; +#endif + + CALC(res_ref, src.a); + + res1.x = INTRINSIC (_cvts_ph_hf8) (src.x); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res1, res_ref)) + abort (); + + res2.x = INTRINSIC (_mask_cvts_ph_hf8) (res2.x, mask, src.x); + MASK_MERGE (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res2, res_ref)) + abort (); + + res3.x = INTRINSIC (_maskz_cvts_ph_hf8) (mask, src.x); + MASK_ZERO (i_b) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_b) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.c index 2265f81..627829c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtph2ibs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2ibs-2.c" +#include "avx10_2-vcvtph2ibs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2ibs-2.c" +#include "avx10_2-vcvtph2ibs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.h new file mode 100644 index 0000000..62fd1c5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2ibs-2.h @@ -0,0 +1,81 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (_Float16 *s, short *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > SCHAR_MAX) + tmp = SCHAR_MAX; + else if (s[i] < SCHAR_MIN) + tmp = SCHAR_MIN; + else + tmp = __builtin_nearbyintf16(s[i]); + r[i] = (unsigned short) tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, h) s; + UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_ph_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ph_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ph_epi8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + abort (); + + MASK_MERGE (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) + abort (); + + MASK_ZERO (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundph_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundph_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundph_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.c index c4b2b575..009fcaf 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtph2iubs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2iubs-2.c" +#include "avx10_2-vcvtph2iubs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtph2iubs-2.c" +#include "avx10_2-vcvtph2iubs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.h new file mode 100644 index 0000000..aa6ed98 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtph2iubs-2.h @@ -0,0 +1,81 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (_Float16 *s, short *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > UCHAR_MAX) + tmp = UCHAR_MAX; + else if (s[i] < 0) + tmp = 0; + else + tmp = __builtin_nearbyintf16(s[i]); + r[i] = (unsigned short) tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, h) s; + UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_ph_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ph_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ph_epu8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + abort (); + + MASK_MERGE (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) + abort (); + + MASK_ZERO (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundph_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundph_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundph_epu8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.c index fdf825b..f5bd1dc 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtps2ibs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtps2ibs-2.c" +#include "avx10_2-vcvtps2ibs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtps2ibs-2.c" +#include "avx10_2-vcvtps2ibs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.h new file mode 100644 index 0000000..7b8f3aa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2ibs-2.h @@ -0,0 +1,82 @@ +#include "avx10-helper.h" +#include +#include +#include + +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, int *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > SCHAR_MAX) + tmp = SCHAR_MAX; + else if (s[i] < SCHAR_MIN) + tmp = SCHAR_MIN; + else + tmp = nearbyint(s[i]); + r[i] = (unsigned int) tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, ) s; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_ps_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ps_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ps_epi8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) + abort (); + + MASK_ZERO (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundps_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundps_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundps_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.c index a27d5c7..f84dfb8 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvtps2iubs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtps2iubs-2.c" +#include "avx10_2-vcvtps2iubs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvtps2iubs-2.c" +#include "avx10_2-vcvtps2iubs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.h new file mode 100644 index 0000000..0ffb3f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvtps2iubs-2.h @@ -0,0 +1,80 @@ +#include "avx10-helper.h" +#include +#include +#include + +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, int *r) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > UCHAR_MAX) + r[i] = UCHAR_MAX; + else if (s[i] < 0) + r[i] = 0; + else + r[i] = nearbyint(s[i]); + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, ) s; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_ps_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvts_ps_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvts_ps_epu8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) + abort (); + + MASK_ZERO (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvts_roundps_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvts_roundps_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvts_roundps_epu8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.c index 0585048..38359cb 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttbf162ibs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttbf162ibs-2.c" +#include "avx10_2-vcvttbf162ibs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttbf162ibs-2.c" +#include "avx10_2-vcvttbf162ibs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.h new file mode 100644 index 0000000..a102091 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162ibs-2.h @@ -0,0 +1,60 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (__bf16 *s, short *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > SCHAR_MAX) + tmp = SCHAR_MAX; + else if (s[i] < SCHAR_MIN) + tmp = SCHAR_MIN; + else + tmp = s[i]; + r[i] = (unsigned short)tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, bf16_bf) s; + UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + short res_ref[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_bf16_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_bf16_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_bf16_epi8) (mask, s.x); + + CALC (s.a, res_ref); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + abort (); + + MASK_MERGE (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) + abort (); + + MASK_ZERO (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.c index 3082ca0..88ad987 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttbf162iubs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttbf162iubs-2.c" +#include "avx10_2-vcvttbf162iubs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttbf162iubs-2.c" +#include "avx10_2-vcvttbf162iubs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.h new file mode 100644 index 0000000..6cfa5cb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttbf162iubs-2.h @@ -0,0 +1,60 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (__bf16 *s, short *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > UCHAR_MAX) + tmp = UCHAR_MAX; + else if (s[i] < 0) + tmp = 0; + else + tmp = s[i]; + r[i] = (unsigned short) tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, bf16_bf) s; + UNION_TYPE (AVX512F_LEN, i_uw) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_bf16_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_bf16_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_bf16_epu8) (mask, s.x); + + CALC (s.a, res_ref); + + if (UNION_CHECK (AVX512F_LEN, i_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (i_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uw) (res2, res_ref)) + abort (); + + MASK_ZERO (i_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uw) (res3, res_ref)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.c index d23024d..7ea6a63 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttpd2dqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2dqs-2.c" +#include "avx10_2-vcvttpd2dqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2dqs-2.c" +#include "avx10_2-vcvttpd2dqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.h new file mode 100644 index 0000000..002112f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2dqs-2.h @@ -0,0 +1,80 @@ +#include "avx10-helper.h" +#include +#include + +#define SRC_SIZE (AVX512F_LEN / 64) +#define SIZE (AVX512F_LEN_HALF / 32) +#include "avx512f-mask-type.h" + +static void +CALC (double *s, int *r) +{ + int i; + + for (i = 0; i < SRC_SIZE; i++) + { + if (s[i] > INT_MAX) + r[i] = INT_MAX; + else if (s[i] < INT_MIN) + r[i] = INT_MIN; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, d) s; + UNION_TYPE (AVX512F_LEN_HALF, i_d) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SRC_SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_pd_epi32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epi32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epi32) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref)) + abort (); + + MASK_ZERO (i_d) (res_ref, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epi32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epi32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.c index d7aa1e5..b4c6102 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttpd2qqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2qqs-2.c" +#include "avx10_2-vcvttpd2qqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2qqs-2.c" +#include "avx10_2-vcvttpd2qqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.h new file mode 100644 index 0000000..0652ddd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2qqs-2.h @@ -0,0 +1,79 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 64) +#include "avx512f-mask-type.h" + +static void +CALC (double *s, long long *r) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > LLONG_MAX) + r[i] = LLONG_MAX; + else if (s[i] < LLONG_MIN) + r[i] = LLONG_MIN; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, d) s; + UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_pd_epi64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epi64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epi64) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) + abort (); + + MASK_MERGE (i_q) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) + abort (); + + MASK_ZERO (i_q) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epi64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epi64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.c index 88caedf..b7463ed 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttpd2udqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2udqs-2.c" +#include "avx10_2-vcvttpd2udqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2udqs-2.c" +#include "avx10_2-vcvttpd2udqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.h new file mode 100644 index 0000000..abcf56e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2udqs-2.h @@ -0,0 +1,80 @@ +#include "avx10-helper.h" +#include +#include + +#define SRC_SIZE (AVX512F_LEN / 64) +#define SIZE (AVX512F_LEN_HALF / 32) +#include "avx512f-mask-type.h" + +static void +CALC (double *s, unsigned int *r) +{ + int i; + + for (i = 0; i < SRC_SIZE; i++) + { + if (s[i] > UINT_MAX) + r[i] = UINT_MAX; + else if (s[i] < 0) + r[i] = 0; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, d) s; + UNION_TYPE (AVX512F_LEN_HALF, i_ud) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SRC_SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_pd_epu32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epu32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epu32) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref)) + abort (); + + MASK_MERGE (i_ud) (res_ref, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref)) + abort (); + + MASK_ZERO (i_ud) (res_ref, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epu32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epu32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_ud) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_ud) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.c index 3304eeb..fbd674a 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttpd2uqqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2uqqs-2.c" +#include "avx10_2-vcvttpd2uqqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttpd2uqqs-2.c" +#include "avx10_2-vcvttpd2uqqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.h new file mode 100644 index 0000000..664e59a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttpd2uqqs-2.h @@ -0,0 +1,79 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 64) +#include "avx512f-mask-type.h" + +static void +CALC (double *s, unsigned long long *r) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > ULONG_MAX) + r[i] = ULONG_MAX; + else if (s[i] < 0) + r[i] = 0; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, d) s; + UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_pd_epu64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_pd_epu64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_pd_epu64) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) + abort (); + + MASK_MERGE (i_uq) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref)) + abort (); + + MASK_ZERO (i_uq) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundpd_epu64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundpd_epu64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_uq) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_uq) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.c index dfa110c..312de25 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttph2ibs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttph2ibs-2.c" +#include "avx10_2-vcvttph2ibs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttph2ibs-2.c" +#include "avx10_2-vcvttph2ibs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.h new file mode 100644 index 0000000..43446ed --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2ibs-2.h @@ -0,0 +1,81 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (_Float16 *s, short *r) +{ + int i; + char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > SCHAR_MAX) + tmp = SCHAR_MAX; + else if (s[i] < SCHAR_MIN) + tmp = SCHAR_MIN; + else + tmp = s[i]; + r[i] = (unsigned char) tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, h) s; + UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_ph_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ph_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ph_epi8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + abort (); + + MASK_MERGE (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) + abort (); + + MASK_ZERO (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_roundph_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundph_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.c index 500e323..19f67fb 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttph2iubs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttph2iubs-2.c" +#include "avx10_2-vcvttph2iubs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttph2iubs-2.c" +#include "avx10_2-vcvttph2iubs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.h new file mode 100644 index 0000000..f77a8a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttph2iubs-2.h @@ -0,0 +1,81 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (_Float16 *s, short *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > UCHAR_MAX) + tmp = UCHAR_MAX; + else if (s[i] < 0) + tmp = 0; + else + tmp = s[i]; + r[i] = (unsigned short) tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, h) s; + UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_ph_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ph_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ph_epu8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + abort (); + + MASK_MERGE (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) + abort (); + + MASK_ZERO (i_w) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_roundph_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundph_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epu8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.c index d2ef60b..bf34da9 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttps2dqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2dqs-2.c" +#include "avx10_2-vcvttps2dqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2dqs-2.c" +#include "avx10_2-vcvttps2dqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.h new file mode 100644 index 0000000..1209922 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2dqs-2.h @@ -0,0 +1,79 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, int *r) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > INT_MAX) + r[i] = INT_MAX; + else if (s[i] < INT_MIN) + r[i] = INT_MIN; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, ) s; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE]; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_ps_epi32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epi32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epi32) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) + abort (); + + MASK_ZERO (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epi32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epi32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epi32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.c index 7002945..1bf53e9 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttps2ibs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2ibs-2.c" +#include "avx10_2-vcvttps2ibs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2ibs-2.c" +#include "avx10_2-vcvttps2ibs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.h new file mode 100644 index 0000000..bac56b8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2ibs-2.h @@ -0,0 +1,82 @@ +#include "avx10-helper.h" +#include +#include +#include + +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, int *r) +{ + int i; + unsigned char tmp; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > SCHAR_MAX) + tmp = SCHAR_MAX; + else if (s[i] < SCHAR_MIN) + tmp = SCHAR_MIN; + else + tmp = s[i]; + r[i] = (unsigned int)tmp; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, ) s; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_ps_epi8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ps_epi8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ps_epi8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) + abort (); + + MASK_ZERO (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_roundps_epi8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundps_epi8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epi8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.c index 4c05d3c..3cc711c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttps2iubs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2iubs-2.c" +#include "avx10_2-vcvttps2iubs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2iubs-2.c" +#include "avx10_2-vcvttps2iubs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.h new file mode 100644 index 0000000..38f94bc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2iubs-2.h @@ -0,0 +1,80 @@ +#include "avx10-helper.h" +#include +#include +#include + +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, int *r) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > UCHAR_MAX) + r[i] = UCHAR_MAX; + else if (s[i] < 0) + r[i] = 0; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, ) s; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_ps_epu8) (s.x); + res2.x = INTRINSIC (_mask_ipcvtts_ps_epu8) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_ipcvtts_ps_epu8) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) + abort (); + + MASK_ZERO (i_d) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_ipcvtts_roundps_epu8) (s.x, 8); + res2.x = INTRINSIC (_mask_ipcvtts_roundps_epu8) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epu8) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.c index a7882ad..d5fcbe4 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttps2qqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2qqs-2.c" +#include "avx10_2-vcvttps2qqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2qqs-2.c" +#include "avx10_2-vcvttps2qqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.h new file mode 100644 index 0000000..7c247a0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2qqs-2.h @@ -0,0 +1,80 @@ +#include "avx10-helper.h" +#include +#include + +#define SRC_SIZE (AVX512F_LEN_HALF / 32) +#define SIZE (AVX512F_LEN / 64) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, long long *r) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > LLONG_MAX) + r[i] = LLONG_MAX; + else if (s[i] < LLONG_MIN) + r[i] = LLONG_MIN; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN_HALF, ) s; + UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SRC_SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_ps_epi64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epi64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epi64) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) + abort (); + + MASK_MERGE (i_q) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) + abort (); + + MASK_ZERO (i_q) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epi64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epi64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epi64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_q) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.c index 66b654e..01ab0cd 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttps2udqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2udqs-2.c" +#include "avx10_2-vcvttps2udqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2udqs-2.c" +#include "avx10_2-vcvttps2udqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.h new file mode 100644 index 0000000..5e7bddb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2udqs-2.h @@ -0,0 +1,79 @@ +#include "avx10-helper.h" +#include +#include + +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, unsigned int *r) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + if (s[i] > UINT_MAX) + r[i] = UINT_MAX; + else if (s[i] < 0) + r[i] = 0; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN, ) s; + UNION_TYPE (AVX512F_LEN, i_ud) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_ps_epu32) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epu32) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epu32) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref)) + abort (); + + MASK_MERGE (i_ud) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_ud) (res2, res_ref)) + abort (); + + MASK_ZERO (i_ud) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epu32) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epu32) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epu32) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_ud) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_ud) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_ud) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.c index 3f32060..8776a6c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vcvttps2uqqs-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2uqqs-2.c" +#include "avx10_2-vcvttps2uqqs-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vcvttps2uqqs-2.c" +#include "avx10_2-vcvttps2uqqs-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.h new file mode 100644 index 0000000..dd05903 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vcvttps2uqqs-2.h @@ -0,0 +1,80 @@ +#include "avx10-helper.h" +#include +#include + +#define SRC_SIZE (AVX512F_LEN_HALF / 32) +#define SIZE (AVX512F_LEN / 64) +#include "avx512f-mask-type.h" + +static void +CALC (float *s, unsigned long long *r) +{ + int i; + + for (i = 0; i < SRC_SIZE; i++) + { + if (s[i] > ULONG_MAX) + r[i] = ULONG_MAX; + else if (s[i] < 0) + r[i] = 0; + else + r[i] = s[i]; + } +} + +void +TEST (void) +{ + UNION_TYPE (AVX512F_LEN_HALF, ) s; + UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; + int i, sign = 1; + + for (i = 0; i < SRC_SIZE; i++) + { + s.a[i] = 1.23 * (i + 2) * sign; + sign = -sign; + } + + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_ps_epu64) (s.x); + res2.x = INTRINSIC (_mask_cvtts_ps_epu64) (res2.x, mask, s.x); + res3.x = INTRINSIC (_maskz_cvtts_ps_epu64) (mask, s.x); + + CALC (s.a, res_ref); + memcpy(res_ref2, res_ref, sizeof(res_ref)); + + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) + abort (); + + MASK_MERGE (i_uq) (res_ref, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref)) + abort (); + + MASK_ZERO (i_uq) (res_ref, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) + abort (); + +#if AVX512F_LEN == 512 + for (i = 0; i < SIZE; i++) + res2.a[i] = DEFAULT_VALUE; + + res1.x = INTRINSIC (_cvtts_roundps_epu64) (s.x, 8); + res2.x = INTRINSIC (_mask_cvtts_roundps_epu64) (res2.x, mask, s.x, 8); + res3.x = INTRINSIC (_maskz_cvtts_roundps_epu64) (mask, s.x, 8); + + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) + abort (); + + MASK_MERGE (i_uq) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_uq) (res_ref2, mask, SRC_SIZE); + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) + abort (); +#endif +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.c index 69d5019..cf6a22b 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vdivbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vdivbf16-2.c" +#include "avx10_2-vdivbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vdivbf16-2.c" +#include "avx10_2-vdivbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.h new file mode 100644 index 0000000..db64814 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vdivbf16-2.h @@ -0,0 +1,41 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float x = (float) (2 * (i % 7) + 7); + float y = (float) (3 * (i % 7) - 5); + float res; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + res = x / y; + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); + } + + res1.x = INTRINSIC (_div_pbh) (src1.x, src2.x); + res2.x = INTRINSIC (_mask_div_pbh) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_div_pbh) (mask, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.c index e2f422d..01c30dc 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.c @@ -1,16 +1,21 @@ -/* { dg-do run } */ +/* { dg-do run } */ /* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */ -/* { dg-require-effective-target avx10_2 } */ +/* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vdpphps-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL -#define AVX512F_LEN 256 +#define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vdpphps-2.c" +#include "avx10_2-vdpphps-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF -#undef AVX512F_LEN -#undef AVX512F_LEN_HALF - -#define AVX512F_LEN 128 +#define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vdpphps-2.c" +#include "avx10_2-vdpphps-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.h new file mode 100644 index 0000000..3aad99a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vdpphps-2.h @@ -0,0 +1,62 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (float *dest, _Float16 *src1, _Float16 *src2) +{ + int i; + + for (i = 0; i < SIZE; i++) + { + dest[i] += (float) src1[2 * i + 1] * (float) src2[2 * i + 1]; + dest[i] += (float) src1[2 * i] * (float) src2[2 * i]; + } +} + +void +TEST(void) +{ + UNION_TYPE (AVX512F_LEN, h) src1, src2; + UNION_TYPE (AVX512F_LEN,) res1, res2, res3; + MASK_TYPE mask = MASK_VALUE; + float res_ref[SIZE], res_ref2[SIZE], res_ref3[SIZE]; + + for (int i = 0; i < SRC_SIZE; i++) + { + src1.a[i] = (_Float16) (i * 4) + 1.25f16; + src2.a[i] = (_Float16) (i * 2) + 2.5f16; + } + + for (int i = 0; i < SIZE; i++) + { + res1.a[i] = 3.125f + 2 * i; + res_ref[i] = 3.125f + 2 * i; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + res_ref2[i] = DEFAULT_VALUE; + res_ref3[i] = DEFAULT_VALUE; + } + + res1.x = INTRINSIC (_dpph_ps) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpph_ps) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpph_ps) (mask, res3.x, src1.x, src2.x); + + CALC(res_ref, src1.a, src2.a); + CALC(res_ref2, src1.a, src2.a); + CALC(res_ref3, src1.a, src2.a); + + if (UNION_CHECK(AVX512F_LEN,) (res1, res_ref)) + abort (); + + MASK_MERGE () (res_ref2, mask, SIZE); + if (UNION_CHECK(AVX512F_LEN,) (res2, res_ref2)) + abort (); + + MASK_ZERO () (res_ref3, mask, SIZE); + if (UNION_CHECK(AVX512F_LEN,) (res3, res_ref3)) + abort (); +} + diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.c index 85041d4..6e27b19 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vfmaddXXXbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfmaddXXXbf16-2.c" +#include "avx10_2-vfmaddXXXbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfmaddXXXbf16-2.c" +#include "avx10_2-vfmaddXXXbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.h new file mode 100644 index 0000000..fea8572 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfmaddXXXbf16-2.h @@ -0,0 +1,44 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + float x = 0.5; + float y = 2; + float z = 0.25; + src1.a[i] = convert_fp32_to_bf16 (x); + src2.a[i] = convert_fp32_to_bf16 (y); + res1.a[i] = convert_fp32_to_bf16 (z); + res2.a[i] = res1.a[i]; + float x16, y16, z16, m1, m2; + x16 = convert_bf16_to_fp32 (src1.a[i]); + y16 = convert_bf16_to_fp32 (src2.a[i]); + z16 = convert_bf16_to_fp32 (res1.a[i]); + m1 = y16 + x16 * z16; + m2 = z16 + x16 * y16; + res_ref[i] = convert_fp32_to_bf16 (m1); + res_ref2[i] = convert_fp32_to_bf16 (m2); + } + + MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); + MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); + res1.x = INTRINSIC (_mask_fmadd_pbh) (res1.x, mask, src1.x, src2.x); + res2.x = INTRINSIC (_mask3_fmadd_pbh) (src1.x, src2.x, res2.x, mask); + + MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.c index 761d5d1..bcb2362 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vfmsubXXXbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfmsubXXXbf16-2.c" +#include "avx10_2-vfmsubXXXbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfmsubXXXbf16-2.c" +#include "avx10_2-vfmsubXXXbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.h new file mode 100644 index 0000000..df49e80 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfmsubXXXbf16-2.h @@ -0,0 +1,45 @@ +#include "avx10-helper.h" + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + float x = 0.5; + float y = 2; + float z = 0.25; + src1.a[i] = convert_fp32_to_bf16 (x); + src2.a[i] = convert_fp32_to_bf16 (y); + res1.a[i] = convert_fp32_to_bf16 (z); + res2.a[i] = res1.a[i]; + float x16, y16, z16, m1, m2; + x16 = convert_bf16_to_fp32 (src1.a[i]); + y16 = convert_bf16_to_fp32 (src2.a[i]); + z16 = convert_bf16_to_fp32 (res1.a[i]); + m1 = -y16 + x16 * z16; + m2 = -z16 + x16 * y16; + res_ref[i] = convert_fp32_to_bf16 (m1); + res_ref2[i] = convert_fp32_to_bf16 (m2); + } + + MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); + MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); + res1.x = INTRINSIC (_mask_fmsub_pbh) (res1.x, mask, src1.x, src2.x); + res2.x = INTRINSIC (_mask3_fmsub_pbh) (src1.x, src2.x, res2.x, mask); + + MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.c index 9b260aa..c41a263 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vfnmaddXXXbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfnmaddXXXbf16-2.c" +#include "avx10_2-vfnmaddXXXbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfnmaddXXXbf16-2.c" +#include "avx10_2-vfnmaddXXXbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.h new file mode 100644 index 0000000..fb55f39 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.h @@ -0,0 +1,45 @@ +#include "avx10-helper.h" + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + float x = 0.5; + float y = 2; + float z = 0.25; + src1.a[i] = convert_fp32_to_bf16 (x); + src2.a[i] = convert_fp32_to_bf16 (y); + res1.a[i] = convert_fp32_to_bf16 (z); + res2.a[i] = res1.a[i]; + float x16, y16, z16, m1, m2; + x16 = convert_bf16_to_fp32 (src1.a[i]); + y16 = convert_bf16_to_fp32 (src2.a[i]); + z16 = convert_bf16_to_fp32 (res1.a[i]); + m1 = y16 - x16 * z16; + m2 = z16 - x16 * y16; + res_ref[i] = convert_fp32_to_bf16 (m1); + res_ref2[i] = convert_fp32_to_bf16 (m2); + } + + MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); + MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); + res1.x = INTRINSIC (_mask_fnmadd_pbh) (res1.x, mask, src1.x, src2.x); + res2.x = INTRINSIC (_mask3_fnmadd_pbh) (src1.x, src2.x, res2.x, mask); + + MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.c index 86539f7..6a984c7 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vfnmsubXXXbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfnmsubXXXbf16-2.c" +#include "avx10_2-vfnmsubXXXbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfnmsubXXXbf16-2.c" +#include "avx10_2-vfnmsubXXXbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.h new file mode 100644 index 0000000..2d51ea4 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.h @@ -0,0 +1,45 @@ +#include "avx10-helper.h" + +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + float x = 0.5; + float y = 2; + float z = 0.25; + src1.a[i] = convert_fp32_to_bf16 (x); + src2.a[i] = convert_fp32_to_bf16 (y); + res1.a[i] = convert_fp32_to_bf16 (z); + res2.a[i] = res1.a[i]; + float x16, y16, z16, m1, m2; + x16 = convert_bf16_to_fp32 (src1.a[i]); + y16 = convert_bf16_to_fp32 (src2.a[i]); + z16 = convert_bf16_to_fp32 (res1.a[i]); + m1 = -y16 - x16 * z16; + m2 = -z16 - x16 * y16; + res_ref[i] = convert_fp32_to_bf16 (m1); + res_ref2[i] = convert_fp32_to_bf16 (m2); + } + + MASK_MERGE (bf16_uw) (res1.a, mask, SIZE); + MASK_MERGE (bf16_uw) (res2.a, mask, SIZE); + res1.x = INTRINSIC (_mask_fnmsub_pbh) (res1.x, mask, src1.x, src2.x); + res2.x = INTRINSIC (_mask3_fnmsub_pbh) (src1.x, src2.x, res2.x, mask); + + MASK_MERGE (bf16_uw) (res_ref, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.c index 40baeca..996782b 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vfpclassbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfpclassbf16-2.c" +#include "avx10_2-vfpclassbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vfpclassbf16-2.c" +#include "avx10_2-vfpclassbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.h new file mode 100644 index 0000000..f843f36 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vfpclassbf16-2.h @@ -0,0 +1,36 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + MASK_TYPE res1 = 0, res2 = 0; + __mmask16 exp = 0; + UNION_TYPE (AVX512F_LEN, bf16_uw) src1; + UNION_TYPE (AVX512F_LEN, ) src2; + MASK_TYPE mask = MASK_VALUE; + + for (i = 0; i < SIZE / 2; i++) + { + src1.a[i] = 0; + src2.a[i] = (uint32_t) (src1.a[i]) << 16; + } + + for (i = SIZE / 2; i < SIZE; i++) + src1.a[i] = 0; + + src1.a[0] = 0x7FC0; + src2.a[0] = convert_bf16_to_fp32 (src1.a[0]); + + _mm_setcsr (0x9FC0); + exp = INTRINSIC (_fpclass_ps_mask) (src2.x, 0x01); + + _mm_setcsr (0x1f80); + res1 = INTRINSIC (_fpclass_pbh_mask) (src1.x, 0x01); + res2 = INTRINSIC (_mask_fpclass_pbh_mask) (mask, src1.x, 1); + + if (exp != res1 || (mask & exp) != res2) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.c index e6a707c..4c05ccc 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vgetexpbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vgetexpbf16-2.c" +#include "avx10_2-vgetexpbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vgetexpbf16-2.c" +#include "avx10_2-vgetexpbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.h new file mode 100644 index 0000000..9240857 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vgetexpbf16-2.h @@ -0,0 +1,39 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float f, s; + f = 28 * i + 1; + src1.a[i] = convert_fp32_to_bf16 (f); + s = convert_bf16_to_fp32 (src1.a[i]); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (getexp (s)); + } + + res1.x = INTRINSIC (_getexp_pbh) (src1.x); + res2.x = INTRINSIC (_mask_getexp_pbh) (res2.x, mask, src1.x); + res3.x = INTRINSIC (_maskz_getexp_pbh) (mask, src1.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.c index 9cdec14..bb455d6 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vgetmantbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vgetmantbf16-2.c" +#include "avx10_2-vgetmantbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vgetmantbf16-2.c" +#include "avx10_2-vgetmantbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.h new file mode 100644 index 0000000..be7eb4e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vgetmantbf16-2.h @@ -0,0 +1,42 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 5.0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + src1.a[i] = 0.5; + float x = convert_bf16_to_fp32 (src1.a[i]); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (getmant (x)); + } + + res1.x = INTRINSIC (_getmant_pbh) (src1.x, _MM_MANT_NORM_1_2, + _MM_MANT_SIGN_src); + res2.x = INTRINSIC (_mask_getmant_pbh) (res2.x, mask, src1.x, + _MM_MANT_NORM_1_2, + _MM_MANT_SIGN_src); + res3.x = INTRINSIC (_maskz_getmant_pbh) (mask, src1.x, + _MM_MANT_NORM_1_2, + _MM_MANT_SIGN_src); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.c index 950870f..9b840c6 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vmaxbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vmaxbf16-2.c" +#include "avx10_2-vmaxbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vmaxbf16-2.c" +#include "avx10_2-vmaxbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.h new file mode 100644 index 0000000..d556ece --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vmaxbf16-2.h @@ -0,0 +1,43 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float x = 0.5; + float y = 0.25; + float res; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + if (x > y) + res_ref[i] = res_ref2[i] = src1.a[i]; + else + res_ref[i] = res_ref2[i] = src2.a[i]; + } + + res1.x = INTRINSIC (_max_pbh) (src1.x, src2.x); + res2.x = INTRINSIC (_mask_max_pbh) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_max_pbh) (mask, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.c index 9786127..c7a3d33 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vminbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vminbf16-2.c" +#include "avx10_2-vminbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vminbf16-2.c" +#include "avx10_2-vminbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.h new file mode 100644 index 0000000..a5a1835 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminbf16-2.h @@ -0,0 +1,43 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float x = 0.5; + float y = 0.25; + float res; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + if (x < y) + res_ref[i] = res_ref2[i] = src1.a[i]; + else + res_ref[i] = res_ref2[i] = src2.a[i]; + } + + res1.x = INTRINSIC (_min_pbh) (src1.x, src2.x); + res2.x = INTRINSIC (_mask_min_pbh) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_min_pbh) (mask, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.c index 0c181d9..b396d2c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.c @@ -3,11 +3,15 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vminmaxbf16-2.h" + +#undef AVX512F_LEN + #define AVX512VL #define AVX512F_LEN 256 -#include "avx10_2-512-vminmaxbf16-2.c" +#include "avx10_2-vminmaxbf16-2.h" #undef AVX512F_LEN #define AVX512F_LEN 128 -#include "avx10_2-512-vminmaxbf16-2.c" +#include "avx10_2-vminmaxbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.h new file mode 100644 index 0000000..42b7110 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxbf16-2.h @@ -0,0 +1,28 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include +#include "avx10-minmax-helper.h" +#include "avx512f-mask-type.h" + +void static +CALC (__bf16 *r, __bf16 *s1, __bf16 *s2, int R) +{ + for(int i = 0; i < SIZE; i++) + r[i] = minmax___bf16(&s1[i], &s2[i], R); +} + +void +TEST (void) +{ + int i, sign; + UNION_TYPE (AVX512F_LEN, bf16_bf) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + __bf16 res_ref[SIZE]; + + UNIT_TEST(0, pbh, bf16_bf, __bf16); + UNIT_TEST(1, pbh, bf16_bf, __bf16); + UNIT_TEST(4, pbh, bf16_bf, __bf16); + UNIT_TEST(5, pbh, bf16_bf, __bf16); + UNIT_TEST(16, pbh, bf16_bf, __bf16); + UNIT_TEST(17, pbh, bf16_bf, __bf16); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.c index 106083d..5be5053 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.c @@ -3,11 +3,15 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vminmaxpd-2.h" + +#undef AVX512F_LEN + #define AVX512VL #define AVX512F_LEN 256 -#include "avx10_2-512-vminmaxpd-2.c" +#include "avx10_2-vminmaxpd-2.h" #undef AVX512F_LEN #define AVX512F_LEN 128 -#include "avx10_2-512-vminmaxpd-2.c" +#include "avx10_2-vminmaxpd-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.h new file mode 100644 index 0000000..d595b6d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxpd-2.h @@ -0,0 +1,28 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 64) +#include +#include "avx10-minmax-helper.h" +#include "avx512f-mask-type.h" + +void static +CALC (double *r, double *s1, double *s2, int R) +{ + for(int i = 0; i < SIZE; i++) + r[i] = minmax_double(&s1[i], &s2[i], R); +} + +void +TEST (void) +{ + int i, sign; + UNION_TYPE (AVX512F_LEN, d) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + double res_ref[SIZE]; + + UNIT_TEST(0, pd, d, double); + UNIT_TEST(1, pd, d, double); + UNIT_TEST(4, pd, d, double); + UNIT_TEST(5, pd, d, double); + UNIT_TEST(16, pd, d, double); + UNIT_TEST(17, pd, d, double); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.c index d465e7a..b4f3737 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.c @@ -3,13 +3,15 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vminmaxph-2.h" + +#undef AVX512F_LEN + #define AVX512VL #define AVX512F_LEN 256 -typedef _Float16 __m256h __attribute__ ((__vector_size__ (32), __may_alias__)); -#include "avx10_2-512-vminmaxph-2.c" +#include "avx10_2-vminmaxph-2.h" #undef AVX512F_LEN #define AVX512F_LEN 128 -typedef _Float16 __m128h __attribute__ ((__vector_size__ (16), __may_alias__)); -#include "avx10_2-512-vminmaxph-2.c" +#include "avx10_2-vminmaxph-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.h new file mode 100644 index 0000000..a215d96 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxph-2.h @@ -0,0 +1,28 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include +#include "avx10-minmax-helper.h" +#include "avx512f-mask-type.h" + +void static +CALC (_Float16 *r, _Float16 *s1, _Float16 *s2, int R) +{ + for(int i = 0; i < SIZE; i++) + r[i] = minmax__Float16(&s1[i], &s2[i], R); +} + +void +TEST (void) +{ + int i, sign; + UNION_TYPE (AVX512F_LEN, h) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + _Float16 res_ref[SIZE]; + + UNIT_TEST(0, ph, h, _Float16); + UNIT_TEST(1, ph, h, _Float16); + UNIT_TEST(4, ph, h, _Float16); + UNIT_TEST(5, ph, h, _Float16); + UNIT_TEST(16, ph, h, _Float16); + UNIT_TEST(17, ph, h, _Float16); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.c index 88aaf5b..41962c0 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.c @@ -3,11 +3,15 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vminmaxps-2.h" + +#undef AVX512F_LEN + #define AVX512VL #define AVX512F_LEN 256 -#include "avx10_2-512-vminmaxps-2.c" +#include "avx10_2-vminmaxps-2.h" #undef AVX512F_LEN #define AVX512F_LEN 128 -#include "avx10_2-512-vminmaxps-2.c" +#include "avx10_2-vminmaxps-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.h new file mode 100644 index 0000000..9ed09a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vminmaxps-2.h @@ -0,0 +1,28 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 32) +#include +#include "avx10-minmax-helper.h" +#include "avx512f-mask-type.h" + +void static +CALC (float *r, float *s1, float *s2, int R) +{ + for(int i = 0; i < SIZE; i++) + r[i] = minmax_float(&s1[i], &s2[i], R); +} + +void +TEST (void) +{ + int i, sign; + UNION_TYPE (AVX512F_LEN, ) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + float res_ref[SIZE]; + + UNIT_TEST(0, ps, , float); + UNIT_TEST(1, ps, , float); + UNIT_TEST(4, ps, , float); + UNIT_TEST(5, ps, , float); + UNIT_TEST(16, ps, , float); + UNIT_TEST(17, ps, , float); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.c index fdf68e6..a925141 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vmpsadbw-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vmpsadbw-2.c" +#include "avx10_2-vmpsadbw-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vmpsadbw-2.c" +#include "avx10_2-vmpsadbw-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.h new file mode 100644 index 0000000..062594b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vmpsadbw-2.h @@ -0,0 +1,84 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 8) +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +static void +CALC (short* dst, char* src1, char* src2, int cont) +{ + int blk2_pos, blk1_pos, i, j, k, c; + char blk1[12], blk2[4], x; + short tmp[4], s; + + for (k = 0; k < AVX512F_LEN / 128; k++) + { + c = cont & 0xff; + if (k % 2 == 1) + c >>= 3; + blk2_pos = (c & 3) * 4; + blk1_pos = ((c >> 2) & 1) * 4; + + for (i = 0; i < 11; i++) + blk1[i] = src1[16 * k + i + blk1_pos]; + + for (i = 0; i < 4; i++) + blk2[i] = src2[16 * k + i + blk2_pos]; + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 4; j++) + { + x = blk1[j + i] - blk2[j]; + tmp[j] = x > 0 ? x : -x; + } + + s = 0; + for (j = 0; j < 4; j++) + s += tmp[j]; + dst[8 * k + i] = s; + } + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, i_b) src2; + MASK_TYPE mask = MASK_VALUE; + short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + src1.a[i] = 10 + 2 * i; + src2.a[i] = 3 * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, src1.a, src2.a, 0x21); + CALC (res_ref2, src1.a, src2.a, 0x21); + + res1.x = INTRINSIC (_mpsadbw_epu8) (src1.x, src2.x, 0x21); + res2.x = INTRINSIC (_mask_mpsadbw_epu8) (res2.x, mask, src1.x, src2.x, 0x21); + res3.x = INTRINSIC (_maskz_mpsadbw_epu8) (mask, src1.x, src2.x, 0x21); + + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) + abort (); + + MASK_MERGE (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_w) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.c index 568c0a9..d0f93d0 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vmulbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vmulbf16-2.c" +#include "avx10_2-vmulbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vmulbf16-2.c" +#include "avx10_2-vmulbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.h new file mode 100644 index 0000000..1b89350c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vmulbf16-2.h @@ -0,0 +1,41 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float x = (float) (2 * (i % 7) + 7); + float y = (float) (3 * (i % 7) - 5); + float res; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + res = x * y; + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); + } + + res1.x = INTRINSIC (_mul_pbh) (src1.x, src2.x); + res2.x = INTRINSIC (_mask_mul_pbh) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_mul_pbh) (mask, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.c index 256d10e..20ebdd5 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpbssd-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbssd-2.c" +#include "avx10_2-vpdpbssd-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbssd-2.c" +#include "avx10_2-vpdpbssd-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.h new file mode 100644 index 0000000..046af0e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssd-2.h @@ -0,0 +1,63 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 8) +#define SIZE (AVX512F_LEN / 32) + +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, char *s1, char *s2) +{ + short tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (short) s1[i] * (short) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] + + tempres[i * 4 + 2] + tempres[i * 4 + 3]; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, i_b) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign * (10 + 3 * i * i); + src2.a[i] = sign * 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpbssd_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpbssd_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpbssd_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.c index 88ab613..4983cb9 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpbssds-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbssds-2.c" +#include "avx10_2-vpdpbssds-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbssds-2.c" +#include "avx10_2-vpdpbssds-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.h new file mode 100644 index 0000000..e120ce1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbssds-2.h @@ -0,0 +1,65 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 8) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, char *s1, char *s2) +{ + short tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (short) s1[i] * (short) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] + + tempres[i * 4 + 2] + tempres[i * 4 + 3]; + long long max_int = 0x7FFFFFFF; + if (test > max_int) + test = max_int; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, i_b) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign * (10 + 3 * i * i); + src2.a[i] = sign * 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpbssds_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpbssds_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpbssds_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.c index cdbd57c..967a96c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpbsud-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbsud-2.c" +#include "avx10_2-vpdpbsud-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbsud-2.c" +#include "avx10_2-vpdpbsud-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.h new file mode 100644 index 0000000..d3f91b7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsud-2.h @@ -0,0 +1,62 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 8) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, char *s1, unsigned char *s2) +{ + short tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (short) s1[i] * (unsigned short) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] + + tempres[i * 4 + 2] + tempres[i * 4 + 3]; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, i_ub) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign*10*i*i; + src2.a[i] = 10 + 3*i*i + sign; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpbsud_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpbsud_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpbsud_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.c index 5e9937a..e03b228 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpbsuds-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbsuds-2.c" +#include "avx10_2-vpdpbsuds-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbsuds-2.c" +#include "avx10_2-vpdpbsuds-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.h new file mode 100644 index 0000000..dd038fb --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbsuds-2.h @@ -0,0 +1,65 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 8) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, char *s1, unsigned char *s2) +{ + short tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (short) s1[i] * (unsigned short) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] + + tempres[i * 4 + 2] + tempres[i * 4 + 3]; + long long max_int = 0x7FFFFFFF; + if (test > max_int) + test = max_int; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_b) src1; + UNION_TYPE (AVX512F_LEN, i_ub) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign * 10 * i * i; + src2.a[i] = 10 + 3 * i * i + sign; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpbsuds_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpbsuds_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpbsuds_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.c index 73e3f71..c6a0793 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpbuud-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbuud-2.c" +#include "avx10_2-vpdpbuud-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbuud-2.c" +#include "avx10_2-vpdpbuud-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.h new file mode 100644 index 0000000..cc3927a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuud-2.h @@ -0,0 +1,61 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 8) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, unsigned char *s1, unsigned char *s2) +{ + unsigned short tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (unsigned short) s1[i] * (unsigned short) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] + + tempres[i * 4 + 2] + tempres[i * 4 + 3]; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_ub) src1; + UNION_TYPE (AVX512F_LEN, i_ub) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + src1.a[i] = 10 + 3 * i * i; + src2.a[i] = 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpbuud_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpbuud_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpbuud_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.c index 09c1c81..455943b 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpbuuds-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbuuds-2.c" +#include "avx10_2-vpdpbuuds-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpbuuds-2.c" +#include "avx10_2-vpdpbuuds-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.h new file mode 100644 index 0000000..7721f0a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpbuuds-2.h @@ -0,0 +1,64 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 8) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, unsigned char *s1, unsigned char *s2) +{ + unsigned short tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (unsigned short) s1[i] * (unsigned short) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 4] + tempres[i * 4 + 1] + + tempres[i * 4 + 2] + tempres[i * 4 + 3]; + long long max_uint = 0xFFFFFFFF; + if (test > max_uint) + test = max_uint; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_ub) src1; + UNION_TYPE (AVX512F_LEN, i_ub) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + src1.a[i] = 10 + 3 * i * i; + src2.a[i] = 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpbuuds_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpbuuds_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpbuuds_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.c index f68d3ed..eced929 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpwsud-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwsud-2.c" +#include "avx10_2-vpdpwsud-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwsud-2.c" +#include "avx10_2-vpdpwsud-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.h new file mode 100644 index 0000000..99d3e14 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsud-2.h @@ -0,0 +1,61 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, short *s1, unsigned short *s2) +{ + int tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (int) s1[i] * (unsigned int) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_w) src1; + UNION_TYPE (AVX512F_LEN, i_uw) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign * (10 + 3 * i * i); + src2.a[i] = sign * 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpwsud_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpwsud_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpwsud_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.c index 3b3f5df..d551309 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpwsuds-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwsuds-2.c" +#include "avx10_2-vpdpwsuds-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwsuds-2.c" +#include "avx10_2-vpdpwsuds-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.h new file mode 100644 index 0000000..dd7d98c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwsuds-2.h @@ -0,0 +1,64 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, short *s1, unsigned short *s2) +{ + int tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (int) s1[i] * (unsigned int) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; + long long max_int = 0x7FFFFFFF; + if (test > max_int) + test = max_int; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_w) src1; + UNION_TYPE (AVX512F_LEN, i_uw) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign * (10 + 3 * i * i); + src2.a[i] = sign * 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpwsuds_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpwsuds_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpwsuds_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.c index 209e62d..194f263d 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpwusd-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwusd-2.c" +#include "avx10_2-vpdpwusd-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwusd-2.c" +#include "avx10_2-vpdpwusd-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.h new file mode 100644 index 0000000..e8a6e6a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusd-2.h @@ -0,0 +1,61 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, unsigned short *s1, short *s2) +{ + int tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (unsigned int) s1[i] * (int) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_uw) src1; + UNION_TYPE (AVX512F_LEN, i_w) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign * 10 * i * i; + src2.a[i] = 10 + 3 * i * i + sign; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpwusd_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpwusd_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpwusd_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.c index 6e9692b..d87f0af 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpwusds-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwusds-2.c" +#include "avx10_2-vpdpwusds-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwusds-2.c" +#include "avx10_2-vpdpwusds-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.h new file mode 100644 index 0000000..5c294e0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwusds-2.h @@ -0,0 +1,64 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, unsigned short *s1, short *s2) +{ + int tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (unsigned int) s1[i] * (int) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; + long long max_int = 0x7FFFFFFF; + if (test > max_int) + test = max_int; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_uw) src1; + UNION_TYPE (AVX512F_LEN, i_w) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + int sign = i % 2 ? 1 : -1; + src1.a[i] = sign * 10 * i * i; + src2.a[i] = 10 + 3 * i * i + sign; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpwusds_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpwusds_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpwusds_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.c index 8feb5d7..4b32bfd 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpwuud-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwuud-2.c" +#include "avx10_2-vpdpwuud-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwuud-2.c" +#include "avx10_2-vpdpwuud-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.h new file mode 100644 index 0000000..3e8b694 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuud-2.h @@ -0,0 +1,60 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, unsigned short *s1, unsigned short *s2) +{ + unsigned int tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (unsigned int) s1[i] * (unsigned int) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_uw) src1; + UNION_TYPE (AVX512F_LEN, i_uw) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + src1.a[i] = 10 + 3 * i * i; + src2.a[i] = 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpwuud_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpwuud_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpwuud_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.c index 930839e..091d0be 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vpdpwuuds-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwuuds-2.c" +#include "avx10_2-vpdpwuuds-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vpdpwuuds-2.c" +#include "avx10_2-vpdpwuuds-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.h new file mode 100644 index 0000000..f4ff08a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vpdpwuuds-2.h @@ -0,0 +1,63 @@ +#include "avx10-helper.h" + +#define SRC_SIZE (AVX512F_LEN / 16) +#define SIZE (AVX512F_LEN / 32) +#include "avx512f-mask-type.h" + +static void +CALC (int *r, int *dst, unsigned short *s1, unsigned short *s2) +{ + unsigned int tempres[SRC_SIZE]; + for (int i = 0; i < SRC_SIZE; i++) + tempres[i] = (unsigned int) s1[i] * (unsigned int) s2[i]; + for (int i = 0; i < SIZE; i++) + { + long long test = (long long) dst[i] + tempres[i * 2] + tempres[i * 2 + 1]; + long long max_uint = 0xFFFFFFFF; + if (test > max_uint) + test = max_uint; + r[i] = test; + } +} + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; + UNION_TYPE (AVX512F_LEN, i_uw) src1; + UNION_TYPE (AVX512F_LEN, i_uw) src2; + MASK_TYPE mask = MASK_VALUE; + int res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SRC_SIZE; i++) + { + src1.a[i] = 10 + 3 * i * i; + src2.a[i] = 10 * i * i; + } + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0x7FFFFFFF; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + } + + CALC (res_ref, res1.a, src1.a, src2.a); + CALC (res_ref2, res2.a, src1.a, src2.a); + + res1.x = INTRINSIC (_dpwuuds_epi32) (res1.x, src1.x, src2.x); + res2.x = INTRINSIC (_mask_dpwuuds_epi32) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_dpwuuds_epi32) (mask, res3.x, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) + abort (); + + MASK_MERGE (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) + abort (); + + MASK_ZERO (i_d) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.c index 367b2cf..ea4cd6c 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vrcpbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vrcpbf16-2.c" +#include "avx10_2-vrcpbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vrcpbf16-2.c" +#include "avx10_2-vrcpbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.h new file mode 100644 index 0000000..bd0c3d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vrcpbf16-2.h @@ -0,0 +1,37 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float s1 = 2.0; + src1.a[i] = convert_fp32_to_bf16 (s1); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (1.0 / s1); + } + + res1.x = INTRINSIC (_rcp_pbh) (src1.x); + res2.x = INTRINSIC (_mask_rcp_pbh) (res2.x, mask, src1.x); + res3.x = INTRINSIC (_maskz_rcp_pbh) (mask, src1.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.c index 318e430..21ed844 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vreducebf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vreducebf16-2.c" +#include "avx10_2-vreducebf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vreducebf16-2.c" +#include "avx10_2-vreducebf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.h new file mode 100644 index 0000000..e920e10 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vreducebf16-2.h @@ -0,0 +1,42 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 5.0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float s = (float) (SIZE - 1) / (float) i; + src1.a[i] = convert_fp32_to_bf16 (s); + float x = convert_bf16_to_fp32 (src1.a[i]); + __m128 px = _mm_load_ss (&x); + __m128 mx = _mm_broadcastss_ps (px); + __m128 out = _mm_reduce_ps (mx, 0x10); + float res = _mm_cvtss_f32 (out); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); + } + + res1.x = INTRINSIC (_reduce_pbh) (src1.x, 0x10); + res2.x = INTRINSIC (_mask_reduce_pbh) (res2.x, mask, src1.x, 0x10); + res3.x = INTRINSIC (_maskz_reduce_pbh) (mask, src1.x, 0x10); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.c index 5720438..66b0911 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vrndscalebf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vrndscalebf16-2.c" +#include "avx10_2-vrndscalebf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vrndscalebf16-2.c" +#include "avx10_2-vrndscalebf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.h new file mode 100644 index 0000000..6a973c6 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vrndscalebf16-2.h @@ -0,0 +1,38 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 5.0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float s = (float) (SIZE - 1) / (float) i; + src1.a[i] = convert_fp32_to_bf16 (s); + float x = convert_bf16_to_fp32 (src1.a[i]); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (rndscale (x)); + } + + res1.x = INTRINSIC (_roundscale_pbh) (src1.x, 0x10); + res2.x = INTRINSIC (_mask_roundscale_pbh) (res2.x, mask, src1.x, 0x10); + res3.x = INTRINSIC (_maskz_roundscale_pbh) (mask, src1.x, 0x10); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.c index 6083c86..9cebca9 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vrsqrtbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vrsqrtbf16-2.c" +#include "avx10_2-vrsqrtbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vrsqrtbf16-2.c" +#include "avx10_2-vrsqrtbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.h new file mode 100644 index 0000000..14811bc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vrsqrtbf16-2.h @@ -0,0 +1,39 @@ +#include "avx10-helper.h" +#include +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float s1 = 2.0; + float rs = 1.0 / sqrtf (s1); + src1.a[i] = convert_fp32_to_bf16 (s1); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (rs); + } + + res1.x = INTRINSIC (_rsqrt_pbh) (src1.x); + res2.x = INTRINSIC (_mask_rsqrt_pbh) (res2.x, mask, src1.x); + res3.x = INTRINSIC (_maskz_rsqrt_pbh) (mask, src1.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.c index 81b24f3..28f85bc 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vscalefbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vscalefbf16-2.c" +#include "avx10_2-vscalefbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vscalefbf16-2.c" +#include "avx10_2-vscalefbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.h new file mode 100644 index 0000000..08565f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vscalefbf16-2.h @@ -0,0 +1,43 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float x = (float) (2 * (i % 7) + 7); + float y = 1.0 + (float) (4 * i) / (float) SIZE; + float xx, yy, res; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + xx = convert_bf16_to_fp32 (src1.a[i]); + yy = convert_bf16_to_fp32 (src2.a[i]); + res = scalef (xx, yy); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16 (res); + } + + res1.x = INTRINSIC (_scalef_pbh) (src1.x, src2.x); + res2.x = INTRINSIC (_mask_scalef_pbh) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_scalef_pbh) (mask, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.c index 5188e05..288c22b 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vsqrtbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vsqrtbf16-2.c" +#include "avx10_2-vsqrtbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vsqrtbf16-2.c" +#include "avx10_2-vsqrtbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.h new file mode 100644 index 0000000..30e1bd2 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vsqrtbf16-2.h @@ -0,0 +1,39 @@ +#include "avx10-helper.h" +#include +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float s1 = i + 1.0; + float rs = sqrtf (s1); + src1.a[i] = convert_fp32_to_bf16_ne (s1); + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (rs); + } + + res1.x = INTRINSIC (_sqrt_pbh) (src1.x); + res2.x = INTRINSIC (_mask_sqrt_pbh) (res2.x, mask, src1.x); + res3.x = INTRINSIC (_maskz_sqrt_pbh) (mask, src1.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.c index 16f444a..09f05a0 100644 --- a/gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.c +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.c @@ -3,14 +3,19 @@ /* { dg-require-effective-target avx10_2 } */ #define AVX10_2 +#include "avx10_2-vsubbf16-2.h" + +#undef AVX512F_LEN +#undef AVX512F_LEN_HALF + #define AVX512VL #define AVX512F_LEN 256 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vsubbf16-2.c" +#include "avx10_2-vsubbf16-2.h" #undef AVX512F_LEN #undef AVX512F_LEN_HALF #define AVX512F_LEN 128 #define AVX512F_LEN_HALF 128 -#include "avx10_2-512-vsubbf16-2.c" +#include "avx10_2-vsubbf16-2.h" diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.h b/gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.h new file mode 100644 index 0000000..379d840 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx10_2-vsubbf16-2.h @@ -0,0 +1,41 @@ +#include "avx10-helper.h" +#define SIZE (AVX512F_LEN / 16) +#include "avx512f-mask-type.h" + +void +TEST (void) +{ + int i; + UNION_TYPE (AVX512F_LEN, bf16_uw) res1, res2, res3, src1, src2; + MASK_TYPE mask = MASK_VALUE; + unsigned short res_ref[SIZE], res_ref2[SIZE]; + + for (i = 0; i < SIZE; i++) + { + res1.a[i] = 0; + res2.a[i] = DEFAULT_VALUE; + res3.a[i] = DEFAULT_VALUE; + float x = (float) (2 * (i % 7) + 7); + float y = (float) (3 * (i % 7) - 5); + float res; + src2.a[i] = convert_fp32_to_bf16 (y); + src1.a[i] = convert_fp32_to_bf16 (x); + res = x - y; + res_ref[i] = res_ref2[i] = convert_fp32_to_bf16_ne (res); + } + + res1.x = INTRINSIC (_sub_pbh) (src1.x, src2.x); + res2.x = INTRINSIC (_mask_sub_pbh) (res2.x, mask, src1.x, src2.x); + res3.x = INTRINSIC (_maskz_sub_pbh) (mask, src1.x, src2.x); + + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res1, res_ref)) + abort (); + + MASK_MERGE (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res2, res_ref2)) + abort (); + + MASK_ZERO (bf16_uw) (res_ref2, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, bf16_uw) (res3, res_ref2)) + abort (); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512f-helper.h b/gcc/testsuite/gcc.target/i386/avx512f-helper.h index 41f09e3..f008981 100644 --- a/gcc/testsuite/gcc.target/i386/avx512f-helper.h +++ b/gcc/testsuite/gcc.target/i386/avx512f-helper.h @@ -97,7 +97,7 @@ MAKE_MASK_ZERO(bf16_bf, __bf16) /* Function which calculates result. */ #define CALC EVAL(calc_, AVX512F_LEN,) -#if !defined(AVX512VL) || defined(AVX10_512BIT) +#if !defined(AVX512VL) #define AVX512F_LEN 512 #define AVX512F_LEN_HALF 256 #endif diff --git a/gcc/testsuite/gcc.target/i386/sm4-check.h b/gcc/testsuite/gcc.target/i386/sm4-check.h index 76c16db..c9d95ef 100644 --- a/gcc/testsuite/gcc.target/i386/sm4-check.h +++ b/gcc/testsuite/gcc.target/i386/sm4-check.h @@ -1,8 +1,8 @@ #include #include "m512-check.h" -#ifdef AVX10_2_512 -static void sm4_avx512f_test (void); +#ifdef AVX10_2 +static void sm4_avx10_test (void); #else static void sm4_test (void); #endif @@ -160,7 +160,7 @@ compute_sm4##name##4 (int *dst, int *src1, int *src2, int vl) \ if (check_union256i_d (res2, dst2)) \ abort (); -#define SM4_AVX512F_SIMULATE(name) \ +#define SM4_AVX10_SIMULATE(name) \ union512i_d src5, src6, res3; \ int dst3[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; \ \ @@ -181,8 +181,8 @@ static void __attribute__ ((noinline)) do_test (void) { -#ifdef AVX10_512BIT - sm4_avx512f_test (); +#ifdef AVX10_2 + sm4_avx10_test (); #else sm4_test (); #endif diff --git a/gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-2.c b/gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-2.c new file mode 100644 index 0000000..2cb638e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-2.c @@ -0,0 +1,16 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -march=x86-64-v3 -msm4 -mavx10.2" } */ +/* { dg-require-effective-target sm4 } */ +/* { dg-require-effective-target avx10_2 } */ + +#define AVX10_2 +#include "sm4-check.h" + +char key; +SM4_FUNC (key); + +static void +sm4_avx10_test (void) +{ + SM4_AVX10_SIMULATE (key); +} diff --git a/gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-512-2.c b/gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-512-2.c deleted file mode 100644 index 1c8b2c3..0000000 --- a/gcc/testsuite/gcc.target/i386/sm4key4-avx10_2-512-2.c +++ /dev/null @@ -1,18 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -msm4 -mavx10.2" } */ -/* { dg-require-effective-target sm4 } */ -/* { dg-require-effective-target avx10_2 } */ - -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#include "sm4-check.h" - -char key; -SM4_FUNC (key); - -static void -sm4_avx512f_test (void) -{ - SM4_AVX512F_SIMULATE (key); -} diff --git a/gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-2.c b/gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-2.c new file mode 100644 index 0000000..b544c07 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-2.c @@ -0,0 +1,16 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -march=x86-64-v3 -msm4 -mavx10.2" } */ +/* { dg-require-effective-target sm4 } */ +/* { dg-require-effective-target avx10_2 } */ + +#define AVX10_2 +#include "sm4-check.h" + +char rnds; +SM4_FUNC (rnds); + +static void +sm4_avx10_test (void) +{ + SM4_AVX10_SIMULATE (rnds); +} diff --git a/gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-512-2.c b/gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-512-2.c deleted file mode 100644 index 5418a53..0000000 --- a/gcc/testsuite/gcc.target/i386/sm4rnds4-avx10_2-512-2.c +++ /dev/null @@ -1,18 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O2 -march=x86-64-v3 -msm4 -mavx10.2" } */ -/* { dg-require-effective-target sm4 } */ -/* { dg-require-effective-target avx10_2 } */ - -#define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT -#include "sm4-check.h" - -char rnds; -SM4_FUNC (rnds); - -static void -sm4_avx512f_test (void) -{ - SM4_AVX512F_SIMULATE (rnds); -} diff --git a/gcc/testsuite/gcc.target/i386/vnniint16-auto-vectorize-4.c b/gcc/testsuite/gcc.target/i386/vnniint16-auto-vectorize-4.c index 06a85a8..204348f1 100644 --- a/gcc/testsuite/gcc.target/i386/vnniint16-auto-vectorize-4.c +++ b/gcc/testsuite/gcc.target/i386/vnniint16-auto-vectorize-4.c @@ -5,8 +5,7 @@ #define N 512 #define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT +#define AVX10_SCALAR #define AVX512F_LEN 512 #define TEST test_512 diff --git a/gcc/testsuite/gcc.target/i386/vnniint8-auto-vectorize-4.c b/gcc/testsuite/gcc.target/i386/vnniint8-auto-vectorize-4.c index 76cca22..798e7fc 100644 --- a/gcc/testsuite/gcc.target/i386/vnniint8-auto-vectorize-4.c +++ b/gcc/testsuite/gcc.target/i386/vnniint8-auto-vectorize-4.c @@ -5,8 +5,7 @@ #define N 512 #define AVX10_2 -#define AVX10_2_512 -#define AVX10_512BIT +#define AVX10_SCALAR #define AVX512F_LEN 512 #define TEST test_512 -- cgit v1.1