https://gcc.gnu.org/g:08043db89e706aa82ab808bfcec6168527c90e54

commit r17-5225-g08043db89e706aa82ab808bfcec6168527c90e54
Author: Uros Bizjak <[email protected]>
Date:   Thu Oct 15 10:36:10 2026 +0200

    i386: Use <MODE_SIZE> more
    
    Use the <MODE_SIZE> mode attribute instead of GET_MODE_SIZE (<MODE>mode)
    in a few more places.
    
    Also simplify the double-word check in "cstore<mode>4" by using
    <MODE_SIZE> > UNITS_PER_WORD and bt_comparison_operator in place of
    the explicit (TARGET_64BIT ? TImode : DImode) mode test and the
    EQ/NE code comparisons.
    
    No functional changes.
    
    gcc/ChangeLog:
    
            * config/i386/i386.md (cstore<mode>4): Use <MODE_SIZE> and
            bt_comparison_operator to reject non-equality double-word
            comparisons.
            (push splitter): Use <SWI48DWI:MODE_SIZE> instead of
            GET_MODE_SIZE (<SWI48DWI:MODE>mode).
            (narrow test insn peephole2): Use <MODE_SIZE> instead of
            GET_MODE_SIZE (<MODE>mode).
            (and<mode>3): Ditto.
            (<any_or:code><mode>3): Ditto.

Diff:
---
 gcc/config/i386/i386.md | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 2f4997221820..619cd50bc3bb 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1550,12 +1550,9 @@
          [(reg:CC FLAGS_REG) (const_int 0)]))]
   ""
 {
-  if (<MODE>mode == (TARGET_64BIT ? TImode : DImode))
-    {
-      if (GET_CODE (operands[1]) != EQ
-         && GET_CODE (operands[1]) != NE)
-       FAIL;
-    }
+  if (<MODE_SIZE> > UNITS_PER_WORD
+      && !bt_comparison_operator (operands[1], VOIDmode))
+    FAIL;
   else if (MEM_P (operands[2]) && MEM_P (operands[3]))
     operands[2] = force_reg (<MODE>mode, operands[2]);
   ix86_expand_setcc (operands[0], GET_CODE (operands[1]),
@@ -2315,7 +2312,7 @@
   [(set (reg:P SP_REG) (plus:P (reg:P SP_REG) (match_dup 2)))
     (set (match_dup 0) (match_dup 1))]
 {
-  operands[2] = GEN_INT (-PUSH_ROUNDING (GET_MODE_SIZE (<SWI48DWI:MODE>mode)));
+  operands[2] = GEN_INT (-PUSH_ROUNDING (<SWI48DWI:MODE_SIZE>));
   /* Preserve memory attributes. */
   operands[0] = replace_equiv_address (operands[0], stack_pointer_rtx);
 })
@@ -13289,7 +13286,7 @@
   else
     new_mode = DImode;
 
-  if (GET_MODE_SIZE (new_mode) >= GET_MODE_SIZE (<MODE>mode))
+  if (GET_MODE_SIZE (new_mode) >= <MODE_SIZE>)
     FAIL;
 
   new_addr = adjust_address (operands[0], new_mode, first_nonzero_byte);
@@ -13310,11 +13307,11 @@
 {
   machine_mode mode = <MODE>mode;
 
-  if (GET_MODE_SIZE (<MODE>mode) > UNITS_PER_WORD
+  if (<MODE_SIZE> > UNITS_PER_WORD
       && !x86_64_hilo_general_operand (operands[2], <MODE>mode))
     operands[2] = force_reg (<MODE>mode, operands[2]);
 
-  if (GET_MODE_SIZE (<MODE>mode) <= UNITS_PER_WORD
+  if (<MODE_SIZE> <= UNITS_PER_WORD
       && const_int_operand (operands[2], <MODE>mode)
       && register_operand (operands[0], <MODE>mode)
       && !(TARGET_ZERO_EXTEND_WITH_AND
@@ -14387,7 +14384,7 @@
                      (match_operand:SDWIM 2 "<general_operand>")))]
   ""
 {
-  if (GET_MODE_SIZE (<MODE>mode) > UNITS_PER_WORD
+  if (<MODE_SIZE> > UNITS_PER_WORD
       && !x86_64_hilo_general_operand (operands[2], <MODE>mode))
     operands[2] = force_reg (<MODE>mode, operands[2]);

Reply via email to