x86: Add missing intrinsics [PR95483]
authorSunil K Pandey <skpgkp2@gmail.com>
Wed, 14 Oct 2020 18:36:39 +0000 (11:36 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 14 Oct 2020 18:37:38 +0000 (11:37 -0700)
commit93103603fd66a9fcf3ea2d8b52657e4b2496f544
tree81903fe7a2a57d752baaef08c0e3cfb5016b5f95
parent2fca6a981790b8445e91db9b955909ed902d94a6
x86: Add missing intrinsics [PR95483]

Tested on x86-64.

gcc/ChangeLog:

PR target/95483
* config/i386/avx2intrin.h (_mm_broadcastsi128_si256): New intrinsics.
(_mm_broadcastsd_pd): Ditto.
* config/i386/avx512bwintrin.h (_mm512_loadu_epi16): New intrinsics.
(_mm512_storeu_epi16): Ditto.
(_mm512_loadu_epi8): Ditto.
(_mm512_storeu_epi8): Ditto.
* config/i386/avx512dqintrin.h (_mm_reduce_round_sd): New intrinsics.
(_mm_mask_reduce_round_sd): Ditto.
(_mm_maskz_reduce_round_sd): Ditto.
(_mm_reduce_round_ss): Ditto.
(_mm_mask_reduce_round_ss): Ditto.
(_mm_maskz_reduce_round_ss): Ditto.
(_mm512_reduce_round_pd): Ditto.
(_mm512_mask_reduce_round_pd): Ditto.
(_mm512_maskz_reduce_round_pd): Ditto.
(_mm512_reduce_round_ps): Ditto.
(_mm512_mask_reduce_round_ps): Ditto.
(_mm512_maskz_reduce_round_ps): Ditto.
* config/i386/avx512erintrin.h
(_mm_mask_rcp28_round_sd): New intrinsics.
(_mm_maskz_rcp28_round_sd): Ditto.
(_mm_mask_rcp28_round_ss): Ditto.
(_mm_maskz_rcp28_round_ss): Ditto.
(_mm_mask_rsqrt28_round_sd): Ditto.
(_mm_maskz_rsqrt28_round_sd): Ditto.
(_mm_mask_rsqrt28_round_ss): Ditto.
(_mm_maskz_rsqrt28_round_ss): Ditto.
(_mm_mask_rcp28_sd): Ditto.
(_mm_maskz_rcp28_sd): Ditto.
(_mm_mask_rcp28_ss): Ditto.
(_mm_maskz_rcp28_ss): Ditto.
(_mm_mask_rsqrt28_sd): Ditto.
(_mm_maskz_rsqrt28_sd): Ditto.
(_mm_mask_rsqrt28_ss): Ditto.
(_mm_maskz_rsqrt28_ss): Ditto.
* config/i386/avx512fintrin.h (_mm_mask_sqrt_sd): New intrinsics.
(_mm_maskz_sqrt_sd): Ditto.
(_mm_mask_sqrt_ss): Ditto.
(_mm_maskz_sqrt_ss): Ditto.
(_mm_mask_scalef_sd): Ditto.
(_mm_maskz_scalef_sd): Ditto.
(_mm_mask_scalef_ss): Ditto.
(_mm_maskz_scalef_ss): Ditto.
(_mm_mask_cvt_roundsd_ss): Ditto.
(_mm_maskz_cvt_roundsd_ss): Ditto.
(_mm_mask_cvt_roundss_sd): Ditto.
(_mm_maskz_cvt_roundss_sd): Ditto.
(_mm_mask_cvtss_sd): Ditto.
(_mm_maskz_cvtss_sd): Ditto.
(_mm_mask_cvtsd_ss): Ditto.
(_mm_maskz_cvtsd_ss): Ditto.
(_mm512_cvtsi512_si32): Ditto.
(_mm_cvtsd_i32): Ditto.
(_mm_cvtss_i32): Ditto.
(_mm_cvti32_sd): Ditto.
(_mm_cvti32_ss): Ditto.
(_mm_cvtsd_i64): Ditto.
(_mm_cvtss_i64): Ditto.
(_mm_cvti64_sd): Ditto.
(_mm_cvti64_ss): Ditto.
* config/i386/avx512vlbwintrin.h (_mm256_storeu_epi8): New intrinsics.
(_mm_storeu_epi8): Ditto.
(_mm256_loadu_epi16): Ditto.
(_mm_loadu_epi16): Ditto.
(_mm256_loadu_epi8): Ditto.
(_mm_loadu_epi8): Ditto.
(_mm256_storeu_epi16): Ditto.
(_mm_storeu_epi16): Ditto.
* config/i386/avx512vlintrin.h (_mm256_load_epi64): New intrinsics.
(_mm_load_epi64): Ditto.
(_mm256_load_epi32): Ditto.
(_mm_load_epi32): Ditto.
(_mm256_store_epi32): Ditto.
(_mm_store_epi32): Ditto.
(_mm256_loadu_epi64): Ditto.
(_mm_loadu_epi64): Ditto.
(_mm256_loadu_epi32): Ditto.
(_mm_loadu_epi32): Ditto.
(_mm256_mask_cvt_roundps_ph): Ditto.
(_mm256_maskz_cvt_roundps_ph): Ditto.
(_mm_mask_cvt_roundps_ph): Ditto.
(_mm_maskz_cvt_roundps_ph): Ditto.
* config/i386/avxintrin.h (_mm256_cvtsi256_si32): New intrinsics.
* config/i386/emmintrin.h (_mm_loadu_si32): New intrinsics.
(_mm_loadu_si16): Ditto.
(_mm_storeu_si32): Ditto.
(_mm_storeu_si16): Ditto.
* config/i386/i386-builtin-types.def
(V8DF_FTYPE_V8DF_INT_V8DF_UQI_INT): Add new type.
(V16SF_FTYPE_V16SF_INT_V16SF_UHI_INT): Ditto.
(V4SF_FTYPE_V4SF_V2DF_V4SF_UQI_INT): Ditto.
(V2DF_FTYPE_V2DF_V4SF_V2DF_UQI_INT): Ditto.
* config/i386/i386-builtin.def
(__builtin_ia32_cvtsd2ss_mask_round): New builtin.
(__builtin_ia32_cvtss2sd_mask_round): Ditto.
(__builtin_ia32_rcp28sd_mask_round): Ditto.
(__builtin_ia32_rcp28ss_mask_round): Ditto.
(__builtin_ia32_rsqrt28sd_mask_round): Ditto.
(__builtin_ia32_rsqrt28ss_mask_round): Ditto.
(__builtin_ia32_reducepd512_mask_round): Ditto.
(__builtin_ia32_reduceps512_mask_round): Ditto.
(__builtin_ia32_reducesd_mask_round): Ditto.
(__builtin_ia32_reducess_mask_round): Ditto.
* config/i386/i386-expand.c
(ix86_expand_round_builtin): Expand round builtin for new type.
(V8DF_FTYPE_V8DF_INT_V8DF_UQI_INT)
(V16SF_FTYPE_V16SF_INT_V16SF_UHI_INT)
(V4SF_FTYPE_V4SF_V2DF_V4SF_UQI_INT)
(V2DF_FTYPE_V2DF_V4SF_V2DF_UQI_INT)
* config/i386/mmintrin.h ()
Define datatype __m32 and __m16.
Define datatype __m32_u and __m16_u.
* config/i386/sse.md: Adjust pattern.
(<mask_codefor>reducep<mode><mask_name><round_saeonly_name>): Adjust.
(reduces<mode><mask_scalar_name><round_saeonly_scalar_name>): Ditto.
(sse2_cvtsd2ss<mask_name><round_name>): Ditto.
(sse2_cvtss2sd<mask_name><round_saeonly_name>): Ditto.
(avx512er_vmrcp28<mode><mask_name><round_saeonly_name>): Ditto.
(avx512er_vmrsqrt28<mode><mask_name><round_saeonly_name>): Ditto.

gcc/testsuite/ChangeLog:

PR target/95483
* gcc.target/i386/avx-1.c: Add test.
* gcc.target/i386/avx2-vbroadcastsi128-1.c: Ditto.
* gcc.target/i386/avx2-vbroadcastsi128-2.c: Ditto.
* gcc.target/i386/avx512bw-vmovdqu16-1.c: Ditto.
* gcc.target/i386/avx512bw-vmovdqu8-1.c: Ditto.
* gcc.target/i386/avx512dq-vreducesd-1.c: Ditto.
* gcc.target/i386/avx512dq-vreducesd-2.c: Ditto.
* gcc.target/i386/avx512dq-vreducess-1.c: Ditto.
* gcc.target/i386/avx512dq-vreducess-2.c: Ditto.
* gcc.target/i386/avx512er-vrcp28sd-1.c: Ditto.
* gcc.target/i386/avx512er-vrcp28sd-2.c: Ditto.
* gcc.target/i386/avx512er-vrcp28ss-1.c: Ditto.
* gcc.target/i386/avx512er-vrcp28ss-2.c: Ditto.
* gcc.target/i386/avx512er-vrsqrt28sd-1.c: Ditto.
* gcc.target/i386/avx512er-vrsqrt28sd-2.c: Ditto.
* gcc.target/i386/avx512er-vrsqrt28ss-1.c: Ditto.
* gcc.target/i386/avx512er-vrsqrt28ss-2.c: Ditto.
* gcc.target/i386/avx512f-vcvtsd2si-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtsd2si64-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtsd2ss-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtsi2sd64-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtsi2ss-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtsi2ss64-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtss2sd-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtss2si-1.c: Ditto.
* gcc.target/i386/avx512f-vcvtss2si64-1.c: Ditto.
* gcc.target/i386/avx512f-vscalefsd-1.c: Ditto.
* gcc.target/i386/avx512f-vscalefsd-2.c: Ditto.
* gcc.target/i386/avx512f-vscalefss-1.c: Ditto.
* gcc.target/i386/avx512f-vscalefss-2.c: Ditto.
* gcc.target/i386/avx512f-vsqrtsd-1.c: Ditto.
* gcc.target/i386/avx512f-vsqrtsd-2.c: Ditto.
* gcc.target/i386/avx512f-vsqrtss-1.c: Ditto.
* gcc.target/i386/avx512f-vsqrtss-2.c: Ditto.
* gcc.target/i386/avx512vl-vmovdqa32-1.c: Ditto.
* gcc.target/i386/avx512vl-vmovdqa64-1.c: Ditto.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/avx512dq-vreducepd-3.c: New test.
* gcc.target/i386/avx512dq-vreducepd-4.c: New test.
* gcc.target/i386/avx512dq-vreduceps-3.c: New test.
* gcc.target/i386/avx512dq-vreduceps-4.c: New test.
* gcc.target/i386/avx512f-vcvtsi2sd-1.c: New test.
* gcc.target/i386/pr95483-1.c: New test.
* gcc.target/i386/pr95483-2.c: New test.
* gcc.target/i386/pr95483-3.c: New test.
* gcc.target/i386/pr95483-4.c: New test.
* gcc.target/i386/pr95483-5.c: New test.
* gcc.target/i386/pr95483-6.c: New test.
* gcc.target/i386/pr95483-7.c: New test.
64 files changed:
gcc/config/i386/avx2intrin.h
gcc/config/i386/avx512bwintrin.h
gcc/config/i386/avx512dqintrin.h
gcc/config/i386/avx512erintrin.h
gcc/config/i386/avx512fintrin.h
gcc/config/i386/avx512vlbwintrin.h
gcc/config/i386/avx512vlintrin.h
gcc/config/i386/avxintrin.h
gcc/config/i386/emmintrin.h
gcc/config/i386/i386-builtin-types.def
gcc/config/i386/i386-builtin.def
gcc/config/i386/i386-expand.c
gcc/config/i386/mmintrin.h
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/avx-1.c
gcc/testsuite/gcc.target/i386/avx2-vbroadcastsi128-1.c
gcc/testsuite/gcc.target/i386/avx2-vbroadcastsi128-2.c
gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu16-1.c
gcc/testsuite/gcc.target/i386/avx512bw-vmovdqu8-1.c
gcc/testsuite/gcc.target/i386/avx512dq-vreducepd-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512dq-vreducepd-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512dq-vreduceps-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512dq-vreduceps-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512dq-vreducesd-1.c
gcc/testsuite/gcc.target/i386/avx512dq-vreducesd-2.c
gcc/testsuite/gcc.target/i386/avx512dq-vreducess-1.c
gcc/testsuite/gcc.target/i386/avx512dq-vreducess-2.c
gcc/testsuite/gcc.target/i386/avx512er-vrcp28sd-1.c
gcc/testsuite/gcc.target/i386/avx512er-vrcp28sd-2.c
gcc/testsuite/gcc.target/i386/avx512er-vrcp28ss-1.c
gcc/testsuite/gcc.target/i386/avx512er-vrcp28ss-2.c
gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28sd-1.c
gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28sd-2.c
gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ss-1.c
gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ss-2.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2si64-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtsd2ss-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2sd-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2sd64-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2ss-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtsi2ss64-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtss2sd-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si-1.c
gcc/testsuite/gcc.target/i386/avx512f-vcvtss2si64-1.c
gcc/testsuite/gcc.target/i386/avx512f-vscalefsd-1.c
gcc/testsuite/gcc.target/i386/avx512f-vscalefsd-2.c
gcc/testsuite/gcc.target/i386/avx512f-vscalefss-1.c
gcc/testsuite/gcc.target/i386/avx512f-vscalefss-2.c
gcc/testsuite/gcc.target/i386/avx512f-vsqrtsd-1.c
gcc/testsuite/gcc.target/i386/avx512f-vsqrtsd-2.c
gcc/testsuite/gcc.target/i386/avx512f-vsqrtss-1.c
gcc/testsuite/gcc.target/i386/avx512f-vsqrtss-2.c
gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa32-1.c
gcc/testsuite/gcc.target/i386/avx512vl-vmovdqa64-1.c
gcc/testsuite/gcc.target/i386/pr95483-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95483-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95483-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95483-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95483-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95483-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95483-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse-13.c
gcc/testsuite/gcc.target/i386/sse-23.c