aboutsummaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2024-11-06 18:15:42 -0800
committerliuhongt <hongtao.liu@intel.com>2024-11-10 18:20:23 -0800
commitde867e8da30bf5e0cb51c3946ec43c3c4778d4a0 (patch)
tree0fdb1dfc26d2e7121de3e339ea2abc63fcfaf45d /gcc/common
parentca1cff0c924dfce7d7792dbeab978bbbf65df0fa (diff)
downloadgcc-de867e8da30bf5e0cb51c3946ec43c3c4778d4a0.zip
gcc-de867e8da30bf5e0cb51c3946ec43c3c4778d4a0.tar.gz
gcc-de867e8da30bf5e0cb51c3946ec43c3c4778d4a0.tar.bz2
Guard truncate from vector float to vector __bf16 with !flag_rounding_math && HONOR_NANS (BFmode).
hw instruction doesn't raise exceptions, turns sNAN into qNAN quietly, and always round to nearest (even). Output denormals are always flushed to zero and input denormals are always treated as zero. MXCSR is not consulted nor updated. W/o native instructions, flag_unsafe_math_optimizations is needed for the permutation instructions. Similar guard extend from vector __bf16 to vector float with !HONOR_NANS (BFmode). gcc/ChangeLog: * config/i386/i386.md (truncsf2bf2): Add !flag_rounding_math to the condition, require flag_unsafe_math_optimizations when native instruction is not available. * config/i386/mmx.md: (truncv2sfv2bf2): Ditto. (extendv2bfv2sf2): Add !HONOR_NANS (BFmode) to the condition. * config/i386/sse.md: (truncv4sfv4sf2): Add !flag_rounding_math to the condition, require flag_unsafe_math_optimizations when native instruction is not available. (truncv8sfv8bf2): Ditto. (truncv16sfv16bf2): Ditto. (extendv4bfv4sf2): Add !HONOR_NANS (BFmode) to the condition. (extendv8bfv8sf2): Ditto. (extendv16bfv16sf2): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/avx512bf16-truncsfbf.c: Add -ffast-math. * gcc.target/i386/avx512bw-extendbf2sf.c: Ditto. * gcc.target/i386/avx512bw-truncsfbf.c: Ditto. * gcc.target/i386/sse2-extendbf2sf.c: Ditto. * gcc.target/i386/ssse3-truncsfbf.c: Ditto.
Diffstat (limited to 'gcc/common')
0 files changed, 0 insertions, 0 deletions