[Bug target/89028] 8-byte loop isn't vectorized

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 24 09:28:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89028

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-* i?86-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-01-24
             Blocks|                            |53947
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Of course we do not vectorize at -O2.  At -O3 the issue is the target doesn't
advertise word_mode as vector size to use and the vectorizer doesn't support
vectorization using half of a vector.

If you'd do

Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c      (revision 268010)
+++ gcc/config/i386/i386.c      (working copy)
@@ -50153,6 +50153,11 @@ ix86_autovectorize_vector_sizes (vector_
       sizes->safe_push (32);
       sizes->safe_push (16);
     }
+  else
+    {
+      sizes->safe_push (16);
+      sizes->safe_push (8);
+    }
 }

 /* Implemenation of targetm.vectorize.get_mask_mode.  */

you get vectorization using DImode regs:

rsqrt:
.LFB0:
        .cfi_startproc
        movabsq $9187201950435737471, %rdx
        movq    (%rdi), %rax
        movq    (%rsi), %rsi
        movq    %rdx, %rcx
        andq    %rax, %rcx
        andq    %rsi, %rdx
        xorq    %rsi, %rax
        addq    %rcx, %rdx
        movabsq $-9187201950435737472, %rcx
        andq    %rcx, %rax
        xorq    %rdx, %rax
        movq    %rax, (%rdi)
        ret

not exactly what you wanted I guess ;)  Anything else would require
vectorizer adjustments.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations


More information about the Gcc-bugs mailing list