[Bug target/115418] Extra movapd emitted for MAX implementation

2024-06-10 Thread liuhongt at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115418

Hongtao Liu  changed:

   What|Removed |Added

 CC||liuhongt at gcc dot gnu.org

--- Comment #3 from Hongtao Liu  ---
(In reply to Andrew Pinski from comment #2)
> Note the issue is ix86_expand_sse_fp_minmax only handles LT/UNGE but it
> should handle GT/UNLT with both parts swapped (comparison and true/false).
> 
GT/UNLT is "canonicalized" to GT/UNGT in ix86_prepare_sse_fp_compare_args
 4410case GE:
 4411case GT:
 4412case UNLE:
 4413case UNLT:
 4414  /* These are not supported directly before AVX, and furthermore
 4415 ix86_expand_sse_fp_minmax only optimizes LT/UNGE.  Swap the
 4416 comparison operands to transform into something that is
 4417 supported.  */
 4418  std::swap (*pop0, *pop1);
 4419  code = swap_condition (code);

[Bug target/115418] Extra movapd emitted for MAX implementation

2024-06-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115418

Andrew Pinski  changed:

   What|Removed |Added

Summary|[14 regression] Extra   |Extra movapd emitted for
   |movapd emitted for MAX  |MAX implementation
   |implementation  |

--- Comment #2 from Andrew Pinski  ---
Note the issue is ix86_expand_sse_fp_minmax only handles LT/UNGE but it should
handle GT/UNLT with both parts swapped (comparison and true/false).

Note this was just by accident that GCC 14 does not work.