The unordered compares (UNLT, UNLE, UNGT, UNGE and UNEQ) must not raise
FE_INVALID on a quiet NaN. AVX and AVX512 have an imm8 encoding for the
quiet _UQ predicate of each, so just select it.
Legacy SSE2 has only 8 predicates and can express UNGE/UNGT/UNLT/UNLE
only as the signaling NLT/NLE, so reject those four codes in the packed
FP vec_cmp expanders when trapping math is in effect and NaNs are honored.
gcc/ChangeLog:
PR target/127177
* config/i386/i386-expand.cc (ix86_fp_cmp_code_to_pcmp_immediate):
Return the _UQ predicate immediates for UNLE, UNLT, UNGE, UNGT and
UNEQ.
* config/i386/i386.cc (ix86_print_operand):Likewise to print the
_uq suffixed AVX predicates for these codes.
* config/i386/predicates.md (ix86_fp_vec_cmp_operator): New
predicate.
* config/i386/sse.md (vec_cmp<mode><sseintvecmodelower>): Use the
new predicate for the VF_128 compare.
* config/i386/mmx.md (vec_cmpv2sfv2si): Likewise.
gcc/testsuite/ChangeLog:
PR target/127177
* gcc.target/i386/pr127177-1.c: New test.
* gcc.target/i386/pr127177-2.c: Likewise.
* gcc.target/i386/pr127177-3.c: Likewise.
* gcc.target/i386/pr127177-4.c: Likewise.
* gcc.target/i386/pr127177-5.c: Likewise.
This directory contains the GNU Compiler Collection (GCC).
The GNU Compiler Collection is free software. See the files whose
names start with COPYING for copying permission. The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.
The directory INSTALL contains copies of the installation information
as HTML and plain text. The source of this information is
gcc/doc/install.texi. The installation information includes details
of what is included in the GCC sources and what files GCC installs.
See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information. An online readable
version of the manual is in the files gcc/doc/gcc.info*.
See http://gcc.gnu.org/bugs/ for how to report bugs usefully.
Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.