[llvm-bugs] [Bug 52298] New: [AArch64] Optimise xtn+xtn to uzp

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 25 13:46:45 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52298

            Bug ID: 52298
           Summary: [AArch64] Optimise xtn+xtn to uzp
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: beginner
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: pavel.iliin at arm.com
                CC: arnaud.degrandmaison at arm.com,
                    llvm-bugs at lists.llvm.org, smithp352 at googlemail.com,
                    Ties.Stuij at arm.com

Optimise truncate operations with a hi/lo pair into a single permute of half
the bit size of the input and just ignoring the top bits (which are truncated
out).

void d2 (short * restrict a, int *b, int n) {
    for (int i = 0; i < n; i++)
        a[i] = b[i];
}

clang -O3 generates
 ldp q0, q1, [x9, #-16]
 add x9, x9, #32
 subs x8, x8, #8
 xtn v0.4h, v0.4s
 xtn v1.4h, v1.4s
 stur d0, [x10, #-8]
 str d1, [x10], #16
 b.ne .LBB0_2

gcc -O3 combines the two `xtn`s into a `uzp`
 ldp q0, q1, [x1]
 add x1, x1, 32
 uzp1 v0.8h, v0.8h, v1.8h
 str q0, [x0], 16
 cmp x1, x2
 bne .L3
https://godbolt.org/z/dYozq6GPh

gcc commit
https://github.com/gcc-mirror/gcc/commit/52da40ffe2aaf086f622e513cc99a64bc7573a67#diff-e55f82ad6f42cf1df30ab3fffeba1fd00aea748d04e231dda6f247b5c7e1c35a

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211025/0634ecc8/attachment.html>


More information about the llvm-bugs mailing list