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

            Bug ID: 52141
           Summary: [AArch64] Generate stp for complex repeating
                    constansts
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Keywords: beginner
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected],
                    [email protected], [email protected],
                    [email protected]

For complex repeating constants like:
void
foo (unsigned long long *a)
{
  a[0] = 0x0140c0da0140c0daULL;
}
aarch64 clang generates
foo(unsigned long long*):                               // @foo(unsigned long
long*)
        mov     x8, #49370
        movk    x8, #320, lsl #16
        movk    x8, #49370, lsl #32
        movk    x8, #320, lsl #48
        str     x8, [x0]
        ret
but for constants where the top half is the same as the bottom half we can
construct just one half and use a store pair to duplicate it:
foo(unsigned long long*):
        mov     w1, 49370
        movk    w1, 0x140, lsl 16
        stp     w1, w1, [x0]
        ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to