Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AArch64][SVE] can improve vector constant generation with SVE's INDEX instruction #110410

Closed
k-arrows opened this issue Sep 29, 2024 · 1 comment · Fixed by #113424
Closed

[AArch64][SVE] can improve vector constant generation with SVE's INDEX instruction #110410

k-arrows opened this issue Sep 29, 2024 · 1 comment · Fixed by #113424
Labels
backend:AArch64 SVE ARM Scalable Vector Extensions

Comments

@k-arrows
Copy link

GCC has implemented this in a recent patch. Consider the following example.
https://godbolt.org/z/szzTesvKz

#include <arm_sve.h>

typedef int v4si __attribute__ ((vector_size (16)));
v4si
f_v4si (void)
{
  return (v4si){ 0, 1, 2, 3 };
}

GCC:

f_v4si():
        index   z0.s, #0, #1
        ret

Clang:

.LCPI0_0:
        .word   0
        .word   1
        .word   2
        .word   3
f_v4si():
        adrp    x8, .LCPI0_0
        ldr     q0, [x8, :lo12:.LCPI0_0]
        ret

I referred to the following GCC patch.
INDEX

@k-arrows k-arrows added backend:AArch64 SVE ARM Scalable Vector Extensions and removed new issue labels Sep 29, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 29, 2024

@llvm/issue-subscribers-backend-aarch64

Author: None (k-arrows)

GCC has implemented this in a recent patch. Consider the following example. https://godbolt.org/z/szzTesvKz ```cpp #include <arm_sve.h>

typedef int v4si attribute ((vector_size (16)));
v4si
f_v4si (void)
{
return (v4si){ 0, 1, 2, 3 };
}


GCC:
```asm
f_v4si():
        index   z0.s, #<!-- -->0, #<!-- -->1
        ret

Clang:

.LCPI0_0:
        .word   0
        .word   1
        .word   2
        .word   3
f_v4si():
        adrp    x8, .LCPI0_0
        ldr     q0, [x8, :lo12:.LCPI0_0]
        ret

I referred to the following GCC patch.
INDEX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 SVE ARM Scalable Vector Extensions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants