Skip to content

[AArch64] Suboptimal memcpy for non-power of two sizes #165947

@Kmeakin

Description

@Kmeakin

Split off from #165625

https://godbolt.org/z/Yfq56nfTP

LLVM assembly:

copy65:
        ldr     q0, [x1]
        str     q0, [x0]
        ldp     q2, q0, [x1, #32]
        ldrb    w8, [x1, #64]
        ldr     q1, [x1, #16]
        strb    w8, [x0, #64]
        stp     q2, q0, [x0, #32]
        str     q1, [x0, #16]
        ret

GCC assembly:

copy65:
        ldp     q29, q28, [x1]
        ldp     q31, q30, [x1, 32]
        ldrb    w1, [x1, 64]
        stp     q29, q28, [x0]
        stp     q31, q30, [x0, 32]
        strb    w1, [x0, 64]
        ret

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions