Fix _mm512_cvt_roundps_ph to generate sae instruction.
authorliuhongt <hongtao.liu@intel.com>
Tue, 30 Aug 2022 09:32:47 +0000 (17:32 +0800)
committerliuhongt <hongtao.liu@intel.com>
Tue, 6 Sep 2022 05:40:57 +0000 (13:40 +0800)
commit20288a0c89906ec21b90a3008a5bc98df1e69375
treed18e5d2a157bbf2e614fa6122b2edf4e5971c7e2
parent47d2dcd1397bf02b79515c39438e0ea9898f9056
Fix _mm512_cvt_roundps_ph to generate sae instruction.

zmm-version vcvtps2ph is special, it encodes {sae} in evex, but put
round control in the imm. For intrinsic _mm512_cvt_roundps_ph (a,
imm), imm contains both {sae} and round control, we need to separate
it in the assembly output since vcvtps2ph will ignore imm[3:7].

gcc/ChangeLog:

* config/i386/i386-builtin.def (IX86_BUILTIN_CVTPS2PH512):
Map to CODE_FOR_avx512f_vcvtps2ph512_mask_sae.
* config/i386/sse.md (<mask_codefor>avx512f_vcvtps2ph512<mask_name>): Extend to ..
(<mask_codefor>avx512f_vcvtps2ph512<mask_name><round_saeonly_name>): .. this.
(avx512f_vcvtps2ph512_mask_sae): New expander

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512f-vcvtps2ph-sae.c: New test.
gcc/config/i386/i386-builtin.def
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/avx512f-vcvtps2ph-sae.c [new file with mode: 0644]