https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71921
--- Comment #27 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <[email protected]>: https://gcc.gnu.org/g:106e001b4bb5313a8d59b858e80d5633f90fcec0 commit r16-5846-g106e001b4bb5313a8d59b858e80d5633f90fcec0 Author: liuhongt <[email protected]> Date: Mon Dec 1 00:51:26 2025 -0800 Transform std::max(t, float(0)) into vmaxps w/o fast-math. The pattern is simplied to below since there's const0_operand (set (reg:V8SF 124) (and:V8SF (not:V8SF (lt:V8SF (reg:V8SF 123 [ MEM <const vector(8) float> [(const float *)input_12(D) + ivtmp.30_4 * 1] ]) (const_vector:V8SF [ (const_double:SF 0.0 [0x0.0p+0]) repeated x8 ]))) (reg:V8SF 123 [ MEM <const vector(8) float> [(const float *)input_12(D) + ivtmp.30_4 * 1] ])) Add new combine pattern to match it. Also extend related avx512 pattern to accept immediate_operand, so that the optimization is also available under AVX512. The codegen is now better than before, however, vpxor is not hoisted outside of the loop after it's created in split1. gcc/ChangeLog: PR target/71921 * config/i386/predicates.md (ieee_maxmin_comparison_operator): New predicator. * config/i386/sse.md (*minmax<mode>3_3): New define_insn_and_split. (*minmax<mode>3_4): Ditto. (*minmax<mode>3_1): Extend operands[2]/operands[4] to handle immediate_operand. gcc/testsuite/ChangeLog: * g++.target/i386/avx512-pr71921.C: New test. * g++.target/i386/pr71921.C: New test.
