]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Micro-optimize ix86_expand_sse_extend
authorUros Bizjak <ubizjak@gmail.com>
Sun, 20 Aug 2023 15:52:22 +0000 (17:52 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Sun, 20 Aug 2023 15:55:51 +0000 (17:55 +0200)
Partial vector src is forced to a register as ops[1], we can use it
instead of SRC in the call to ix86_expand_sse_cmp.  This change avoids
forcing operand[1] to a register in sign/zero-extend expanders.

gcc/ChangeLog:

* config/i386/i386-expand.cc (ix86_expand_sse_extend): Use ops[1]
instead of src in the call to ix86_expand_sse_cmp.
* config/i386/sse.md (<any_extend:insn>v8qiv8hi2): Do not
force operands[1] to a register.
(<any_extend:insn>v4hiv4si2): Ditto.
(<any_extend:insn>v2siv2di2): Ditto.

gcc/config/i386/i386-expand.cc
gcc/config/i386/sse.md

index 460d496ef226c059aadcc6c40266f53409db6f15..031e2f72d15ce37bc397392b1a5b36b3b198a6a2 100644 (file)
@@ -5667,7 +5667,7 @@ ix86_expand_sse_extend (rtx dest, rtx src, bool unsigned_p)
     ops[2] = force_reg (imode, CONST0_RTX (imode));
   else
     ops[2] = ix86_expand_sse_cmp (gen_reg_rtx (imode), GT, CONST0_RTX (imode),
-                                 src, pc_rtx, pc_rtx);
+                                 ops[1], pc_rtx, pc_rtx);
 
   ix86_split_mmx_punpck (ops, false);
   emit_move_insn (dest, lowpart_subreg (GET_MODE (dest), ops[0], imode));
index 87c3bf0702082b1335519c94ecc34111e0c25be6..da85223a9b425cfa637898834cf616f33844138d 100644 (file)
 {
   if (!TARGET_SSE4_1)
     {
-      rtx op1 = force_reg (V8QImode, operands[1]);
-      ix86_expand_sse_extend (operands[0], op1, <u_bool>);
+      ix86_expand_sse_extend (operands[0], operands[1], <u_bool>);
       DONE;
     }
 
 {
   if (!TARGET_SSE4_1)
     {
-      rtx op1 = force_reg (V4HImode, operands[1]);
-      ix86_expand_sse_extend (operands[0], op1, <u_bool>);
+      ix86_expand_sse_extend (operands[0], operands[1], <u_bool>);
       DONE;
     }
 
 {
   if (!TARGET_SSE4_1)
     {
-      rtx op1 = force_reg (V2SImode, operands[1]);
-      ix86_expand_sse_extend (operands[0], op1, <u_bool>);
+      ix86_expand_sse_extend (operands[0], operands[1], <u_bool>);
       DONE;
     }