[committed] i386: Swap compare operands in ustrunc patterns

Message ID CAFULd4ZiVZ3vZbqeb+zH=eyJSXCtqOBzyDA6QuhL0OzzbfYEXA@mail.gmail.com
State New
Headers
Series [committed] i386: Swap compare operands in ustrunc patterns |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gcc_check--master-arm warning Patch is already merged

Commit Message

Uros Bizjak July 10, 2024, 9:03 p.m. UTC
  A last minute change led to a wrong operand order in the  compare insn.

gcc/ChangeLog:

    * config/i386/i386.md (ustruncdi<mode>2): Swap compare operands.
    (ustruncsi<mode>2): Ditto.
    (ustrunchiqi2): Ditto.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Uros.
  

Patch

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e2f30695d70..de9f4ba0496 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -9990,7 +9990,7 @@  (define_expand "ustruncdi<mode>2"
   rtx sat = force_reg (DImode, GEN_INT (GET_MODE_MASK (<MODE>mode)));
   rtx dst;
 
-  emit_insn (gen_cmpdi_1 (op1, sat));
+  emit_insn (gen_cmpdi_1 (sat, op1));
 
   if (TARGET_CMOVE)
     {
@@ -10026,7 +10026,7 @@  (define_expand "ustruncsi<mode>2"
   rtx sat = force_reg (SImode, GEN_INT (GET_MODE_MASK (<MODE>mode)));
   rtx dst;
 
-  emit_insn (gen_cmpsi_1 (op1, sat));
+  emit_insn (gen_cmpsi_1 (sat, op1));
 
   if (TARGET_CMOVE)
     {
@@ -10062,7 +10062,7 @@  (define_expand "ustrunchiqi2"
   rtx sat = force_reg (HImode, GEN_INT (GET_MODE_MASK (QImode)));
   rtx dst;
 
-  emit_insn (gen_cmphi_1 (op1, sat));
+  emit_insn (gen_cmphi_1 (sat, op1));
 
   if (TARGET_CMOVE)
     {