Check your knowledge
-
What is Neon?
Neon is the implementation of the Advanced SIMD extension to the Arm architecture.
All processors compliant with the Armv8-A architecture (for example, the Cortex-A76 or Cortex-A57) include Neon. In the programmer's view, Neon provides an additional 32 128-bit registers with instructions that operate on 8, 16, 32, or 64 bit lanes within these registers.
-
Which header file must you include in a C file in order to use the Neon intrinsics?
arm_neon.h
#include <arm_neon.h>
must appear before the use of any Neon intrinsics. -
What does this function do? int8x16_t vmulq_s8 (int8x16_t a, int8x16_t b)
The
mul
in the function name is a hint that this intrinsic uses theMUL
instruction. Based on the types of the arguments and return value, sixteen bytes of signed integers, we might guess this intrinsic maps to the following instruction:MUL Vd.16B, Vn.16B, Vm.16B
So this function multiplies corresponding elements of
a
andb
and returns the result. Checking the definition shows this is indeed true. -
The deinterleave function defined in this tutorial can only operate on blocks of sixteen 8 bit unsigned integers. If you had an array of uint8_t values that was not a multiple of sixteen in length, how might you account for this while:
1) Changing the arrays, but not the function? and 2)
Changing the function, but not the arrays?
- Changing the arrays, but not the function? In this case padding the arrays with zeros would be the simplest option, but this padding may have to be accounted for in other functions.
- Changing the function, but not the arrays? One way would be to use the Neon deinterleave for every whole multiple of sixteen values, and then use the C deinterleave for the remainder.
-
What do the data types float64_t, poly64x2_t, and int8x8x3_t represent?
float64_t
is a scalar type which is a 64-bit floating-point type.poly64x2_t
is a vector type of two 64-bit polynomial scalars.int8x8x3_t
is a vector array type of three vectors of eight 8-bit signed integers.