public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/99411] s311, s312, s31111, s31111, s3110, vsumr benchmark of TSVC is vectorized by clang better than by gcc
Date: Wed, 11 Jan 2023 22:36:50 +0000	[thread overview]
Message-ID: <bug-99411-4-1PxTmxXMpN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99411-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Compared to aocc we also do worse on zen4:
jh@alberti:~/tsvc/bin> ~/trunk-install/bin/gcc -Ofast -march=native s311.c      
jh@alberti:~/tsvc/bin> time ./a.out

real    0m3.207s
user    0m3.206s
sys     0m0.000s
jh@alberti:~/tsvc/bin> ~/aocc-compiler-4.0.0/bin/clang -Ofast -march=native
s311.c 
jh@alberti:~/tsvc/bin> time ./a.out

real    0m1.221s
user    0m1.221s
sys     0m0.000s

aocc code seems similar to clangs from two years ago except for additional use
of avx512.

main:                                   # @main
        .cfi_startproc
# %bb.0:                                # %entry
        xorl    %eax, %eax
        .p2align        4, 0x90
.LBB0_1:                                # %vector.ph
                                        # =>This Loop Header: Depth=1
                                        #     Child Loop BB0_2 Depth 2
        vxorps  %xmm0, %xmm0, %xmm0
        movq    $-128000, %rcx                  # imm = 0xFFFE0C00
        vxorps  %xmm1, %xmm1, %xmm1
        vxorps  %xmm2, %xmm2, %xmm2
        vxorps  %xmm3, %xmm3, %xmm3
        .p2align        4, 0x90
.LBB0_2:                                # %vector.body
                                        #   Parent Loop BB0_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
        vaddps  a+128000(%rcx), %zmm0, %zmm0
        vaddps  a+128064(%rcx), %zmm1, %zmm1
        vaddps  a+128128(%rcx), %zmm2, %zmm2
        vaddps  a+128192(%rcx), %zmm3, %zmm3
        addq    $256, %rcx                      # imm = 0x100
        jne     .LBB0_2
# %bb.3:                                # %middle.block
                                        #   in Loop: Header=BB0_1 Depth=1
        incl    %eax
        cmpl    $1000000, %eax                  # imm = 0xF4240
        jne     .LBB0_1
# %bb.4:                                # %for.cond.cleanup
        vaddps  %zmm0, %zmm1, %zmm0
        xorl    %eax, %eax
        vaddps  %zmm0, %zmm2, %zmm0
        vaddps  %zmm0, %zmm3, %zmm0
        vextractf64x4   $1, %zmm0, %ymm1
        vaddps  %zmm1, %zmm0, %zmm0
        vextractf128    $1, %ymm0, %xmm1
        vaddps  %xmm1, %xmm0, %xmm0
        vpermilpd       $1, %xmm0, %xmm1        # xmm1 = xmm0[1,0]
        vaddps  %xmm1, %xmm0, %xmm0
        vmovshdup       %xmm0, %xmm1            # xmm1 = xmm0[1,1,3,3]
        vaddss  %xmm1, %xmm0, %xmm0
        vucomiss        .LCPI0_0(%rip), %xmm0
        seta    %al
        vzeroupper
        retq

      parent reply	other threads:[~2023-01-11 22:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 14:30 [Bug middle-end/99411] New: s311 " hubicka at gcc dot gnu.org
2021-03-05 14:41 ` [Bug middle-end/99411] s311 and s31111 " hubicka at gcc dot gnu.org
2021-03-05 14:43 ` [Bug middle-end/99411] s311, s312 " hubicka at gcc dot gnu.org
2021-03-05 14:46 ` [Bug middle-end/99411] s311, s312, s31111 " hubicka at gcc dot gnu.org
2021-03-05 14:49 ` [Bug middle-end/99411] s311, s312, s31111 and s31111, s3110 " hubicka at gcc dot gnu.org
2021-03-05 15:03 ` [Bug middle-end/99411] s311, s312, s31111, s31111, s3110, vsumr " hubicka at gcc dot gnu.org
2021-03-08  8:24 ` [Bug tree-optimization/99411] " rguenth at gcc dot gnu.org
2022-11-16 17:16 ` hubicka at gcc dot gnu.org
2023-01-11 22:36 ` hubicka at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99411-4-1PxTmxXMpN@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).