]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Fix cstorebf4 fp comparison operand [PR117495]
authorHongyu Wang <hongyu.wang@intel.com>
Tue, 12 Nov 2024 05:04:46 +0000 (13:04 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Thu, 14 Nov 2024 03:30:42 +0000 (11:30 +0800)
commit19b24f4aae6c59d70cc882623b1e9b279b3872f3
tree62d094b8151f7cbc0b21d0352a21d2562e60e1f1
parent8564d0948c72df0a66d7eb47e15c6ab43e9b25ce
i386: Fix cstorebf4 fp comparison operand [PR117495]

For cstorebf4 it uses comparison_operator for BFmode compare, which is
incorrect when directly uses ix86_expand_setcc as it does not canonicalize
the input comparison to correct the compare code by swapping operands.
The original code without AVX10.2 calls emit_store_flag_force, who
actually calls to emit_store_flags_1 and recurisive calls to this expander
again with swapped operand and flag.
Therefore, we can avoid do the redundant recurisive call by adjusting
the comparison_operator to ix86_fp_comparison_operator, and calls
ix86_expand_setcc directly.

gcc/ChangeLog:

PR target/117495
* config/i386/i386.md (cstorebf4): Use ix86_fp_comparison_operator
and calls ix86_expand_setcc directly.

gcc/testsuite/ChangeLog:

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