Parabix on ARM
This project adds support for key Parabix operations such as transposition, long-stream addition and stream advance
on the ARM architecture targeting the SIMD Neon instructions by reimplementing platform-specific x86 SSE instructions.
Our code closely follows the format of idisa_sse_builder
in order to implement these features.
View the Parabix source code on GitLab.
Example Translation for
_mm_movmask_ps
Description
Set each bit of mask dst
based on the most significant bit of the corresponding packed single-precision (32-bit)
floating-point element in a
.
We take a 4xi32 and want to resolve an integer bitmask of the MSBs. This SSE instruction is simulated using a load, right shift, left shift, and horizontal vector addition in Neon.
Implementation
-
vld1q_s32
is used to load multiple single-element structures to up to four registers to store shift values. We'll store the values {0, 1, 2, 3} to represent the positions of each of the MSBs. -
We use
vshrq_n_u32
to right shift each of the 4 floats by 31 bits to resolve the most significant bits. Let's say, for example, that these are {0, 1, 1, 0}. -
vshlq_u32
is used to left shift every one of the MSBs we’ve got. We can apply our shift values we stored to shift every value by {0, 1, 2, 3} respectively. After shifting this should resolve {0, 10, 100, 0000}. -
vaddvq_u32
is used to add these values within the vector to resolve an integer. In our example that'd be 0+10+100+0000=0110.
Resources
-
Ong, “Porting Intel Intrinsics to Arm Neon Intrinsics”, CodeProject, 04-May-2021.
[Online]. Available:
https://www.codeproject.com/Articles/5301747/Porting-Intel-Intrinsics-to-Arm-Neon-Intrinsics.
[Accessed: 17-Jun-2021]. -
Simd-Everywhere, “simd-everywhere/simde”, GitHub.
[Online]. Available:
https://github.com/simd-everywhere/simde.
[Accessed: 17-Jun-2021]. -
Intrinsics – Arm Developer.
[Online]. Available:
https://developer.arm.com/architectures/instruction-sets/intrinsics.
[Accessed: 17-Jun-2021]. -
Intel® Intrinsics Guide.
[Online]. Available:
https://software.intel.com/sites/landingpage/IntrinsicsGuide.
[Accessed: 17-Jun-2021].