Open pinskia opened 9 months ago
@llvm/issue-subscribers-backend-aarch64
Author: Andrew Pinski (pinskia)
I also find which elements that are used for V2short is just really interesting. That is:
#define vector __attribute__((vector_size(4)))
vector unsigned short f(vector unsigned short* __restrict b, int n)
{
return *b;
}
Produces:
ld1 { v0.h }[0], [x0]
add x8, x0, #2
ld1 { v0.h }[2], [x8]
so v0.4h[1] and v0.4h[3] are undefined rather than chosing 0,1 as the element.
I hadn't realized there was a way to define these "illegal" vector types in gcc. It looks like the clang frontend is coercing the input value, but doesn't do the same for the return: https://godbolt.org/z/E4q8Taf45
Take:
GCC passes the argument via
w0
and returns inw0
. While clang/LLVM passes the argument viaw0
but returns inv0
which seems wrong.