Closed zchrissirhcz closed 2 years ago
I guess this is due to invalid test
Line 106 and line 110 is commented by me. They were using nc=4
for test, but compile time the compiler complains it is out of range [0,3].
ndk is not officially supported currently.
ndk is not officially supported currently.
OK, this issue should be described as "aarch64/arm compilation failed due to some invalid test case arguments".
Just searched the ARM official manual about vextq_f32
, without specific ISA specified, the 3rd parameter as the document described, should in range [0, 3]:
https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=vextq_f32
Seems like an ndk compiler bug. https://github.com/android/ndk/issues/1657
Your template specialization with <4> leads to this code emitted:
t_right = vextq_f32(tcurr, tnext, 4);
which is illegal (last f32 index in a 128-bit vector is 3) and leads to the above-mentioned error. The index range verification happens before the dead code elimination is kicked in (later on in opt stage).
Based on the above, looks like intended behaviour to me.
Originally posted by @Over17 in https://github.com/android/ndk/issues/1657#issuecomment-1027948784
hi, I fixed this bug in the newest PR, you can try this commit on your machine.
hi, I fixed this bug in the newest PR, you can try this commit on your machine.
I think nc == 2
is missing. Though it is a rare case, when people first look at the function head (i.e. the declaration), will guess maybe nc == 2 is also supported.
I would suggest writing a small template function as thin wrapper of vextq_f32
:
template<int nc>
vextq_f32(...)
{
...
}
In the header file, we clearly stated that we only support 1, 3, and 4 channels now. As for nc=2, PR is welcome~
Error message
Reproduce
Create build/android-arm64-build.sh script with contents: