i386: Prevent spurious FP exceptions with _mm_cvt{,t}ps_pi32 [PR98522]
authorUros Bizjak <ubizjak@gmail.com>
Tue, 5 Jan 2021 13:42:29 +0000 (14:42 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Tue, 5 Jan 2021 13:45:28 +0000 (14:45 +0100)
commit1ff0ddcd8b4728bcc96e1daf2e70a03dc9fbf171
tree4afbc51f1eb04e9b7b0274ad105f467b51a5c9be
parent951bdbde6ade56eb63af1dfa18777348a8a0d89e
i386: Prevent spurious FP exceptions with _mm_cvt{,t}ps_pi32 [PR98522]

Prevent spurious FP exceptions with _mm_cvt{,t}ps_pi32 for TARGET_MMX_WITH_SSE
by clearing the top 64 bytes of the input XMM register.

2021-01-05  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/98522
* config/i386/sse.md (sse_cvtps2pi): Redefine as define_insn_and_split.
Clear the top 64 bytes of the input XMM register.
(sse_cvttps2pi): Ditto.

gcc/testsuite

PR target/98522
* gcc.target/i386/pr98522.c: New test.
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/pr98522.c [new file with mode: 0644]