[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


            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

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

gcc commit

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