gcc: ARC SIMD Built-in Functions

1 
1 6.59.5 ARC SIMD Built-in Functions
1 ----------------------------------
1 
1 SIMD builtins provided by the compiler can be used to generate the
1 vector instructions.  This section describes the available builtins and
1 their usage in programs.  With the '-msimd' option, the compiler
1 provides 128-bit vector types, which can be specified using the
1 'vector_size' attribute.  The header file 'arc-simd.h' can be included
1 to use the following predefined types:
1      typedef int __v4si   __attribute__((vector_size(16)));
1      typedef short __v8hi __attribute__((vector_size(16)));
1 
1  These types can be used to define 128-bit variables.  The built-in
1 functions listed in the following section can be used on these variables
1 to generate the vector operations.
1 
1  For all builtins, '__builtin_arc_SOMEINSN', the header file
1 'arc-simd.h' also provides equivalent macros called '_SOMEINSN' that can
1 be used for programming ease and improved readability.  The following
1 macros for DMA control are also provided:
1      #define _setup_dma_in_channel_reg _vdiwr
1      #define _setup_dma_out_channel_reg _vdowr
1 
1  The following is a complete list of all the SIMD built-ins provided for
1 ARC, grouped by calling signature.
1 
1  The following take two '__v8hi' arguments and return a '__v8hi' result:
1      __v8hi __builtin_arc_vaddaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vaddw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vand (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vandaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vavb (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vavrb (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vbic (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vbicaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vdifaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vdifw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_veqw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vh264f (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vh264ft (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vh264fw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vlew (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vltw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmaxaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmaxw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vminaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vminw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr1aw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr1w (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr2aw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr2w (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr3aw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr3w (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr4aw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr4w (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr5aw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr5w (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr6aw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr6w (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr7aw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmr7w (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmrb (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmulaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmulfaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmulfw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vmulw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vnew (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vor (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vsubaw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vsubw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vsummw (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vvc1f (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vvc1ft (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vxor (__v8hi, __v8hi)
1      __v8hi __builtin_arc_vxoraw (__v8hi, __v8hi)
1 
1  The following take one '__v8hi' and one 'int' argument and return a
1 '__v8hi' result:
1 
1      __v8hi __builtin_arc_vbaddw (__v8hi, int)
1      __v8hi __builtin_arc_vbmaxw (__v8hi, int)
1      __v8hi __builtin_arc_vbminw (__v8hi, int)
1      __v8hi __builtin_arc_vbmulaw (__v8hi, int)
1      __v8hi __builtin_arc_vbmulfw (__v8hi, int)
1      __v8hi __builtin_arc_vbmulw (__v8hi, int)
1      __v8hi __builtin_arc_vbrsubw (__v8hi, int)
1      __v8hi __builtin_arc_vbsubw (__v8hi, int)
1 
1  The following take one '__v8hi' argument and one 'int' argument which
1 must be a 3-bit compile time constant indicating a register number
1 I0-I7.  They return a '__v8hi' result.
1      __v8hi __builtin_arc_vasrw (__v8hi, const int)
1      __v8hi __builtin_arc_vsr8 (__v8hi, const int)
1      __v8hi __builtin_arc_vsr8aw (__v8hi, const int)
1 
1  The following take one '__v8hi' argument and one 'int' argument which
1 must be a 6-bit compile time constant.  They return a '__v8hi' result.
1      __v8hi __builtin_arc_vasrpwbi (__v8hi, const int)
1      __v8hi __builtin_arc_vasrrpwbi (__v8hi, const int)
1      __v8hi __builtin_arc_vasrrwi (__v8hi, const int)
1      __v8hi __builtin_arc_vasrsrwi (__v8hi, const int)
1      __v8hi __builtin_arc_vasrwi (__v8hi, const int)
1      __v8hi __builtin_arc_vsr8awi (__v8hi, const int)
1      __v8hi __builtin_arc_vsr8i (__v8hi, const int)
1 
1  The following take one '__v8hi' argument and one 'int' argument which
1 must be a 8-bit compile time constant.  They return a '__v8hi' result.
1      __v8hi __builtin_arc_vd6tapf (__v8hi, const int)
1      __v8hi __builtin_arc_vmvaw (__v8hi, const int)
1      __v8hi __builtin_arc_vmvw (__v8hi, const int)
1      __v8hi __builtin_arc_vmvzw (__v8hi, const int)
1 
1  The following take two 'int' arguments, the second of which which must
1 be a 8-bit compile time constant.  They return a '__v8hi' result:
1      __v8hi __builtin_arc_vmovaw (int, const int)
1      __v8hi __builtin_arc_vmovw (int, const int)
1      __v8hi __builtin_arc_vmovzw (int, const int)
1 
1  The following take a single '__v8hi' argument and return a '__v8hi'
1 result:
1      __v8hi __builtin_arc_vabsaw (__v8hi)
1      __v8hi __builtin_arc_vabsw (__v8hi)
1      __v8hi __builtin_arc_vaddsuw (__v8hi)
1      __v8hi __builtin_arc_vexch1 (__v8hi)
1      __v8hi __builtin_arc_vexch2 (__v8hi)
1      __v8hi __builtin_arc_vexch4 (__v8hi)
1      __v8hi __builtin_arc_vsignw (__v8hi)
1      __v8hi __builtin_arc_vupbaw (__v8hi)
1      __v8hi __builtin_arc_vupbw (__v8hi)
1      __v8hi __builtin_arc_vupsbaw (__v8hi)
1      __v8hi __builtin_arc_vupsbw (__v8hi)
1 
1  The following take two 'int' arguments and return no result:
1      void __builtin_arc_vdirun (int, int)
1      void __builtin_arc_vdorun (int, int)
1 
1  The following take two 'int' arguments and return no result.  The first
1 argument must a 3-bit compile time constant indicating one of the
1 DR0-DR7 DMA setup channels:
1      void __builtin_arc_vdiwr (const int, int)
1      void __builtin_arc_vdowr (const int, int)
1 
1  The following take an 'int' argument and return no result:
1      void __builtin_arc_vendrec (int)
1      void __builtin_arc_vrec (int)
1      void __builtin_arc_vrecrun (int)
1      void __builtin_arc_vrun (int)
1 
1  The following take a '__v8hi' argument and two 'int' arguments and
1 return a '__v8hi' result.  The second argument must be a 3-bit compile
1 time constants, indicating one the registers I0-I7, and the third
1 argument must be an 8-bit compile time constant.
1 
1  _Note:_ Although the equivalent hardware instructions do not take an
1 SIMD register as an operand, these builtins overwrite the relevant bits
1 of the '__v8hi' register provided as the first argument with the value
1 loaded from the '[Ib, u8]' location in the SDM.
1 
1      __v8hi __builtin_arc_vld32 (__v8hi, const int, const int)
1      __v8hi __builtin_arc_vld32wh (__v8hi, const int, const int)
1      __v8hi __builtin_arc_vld32wl (__v8hi, const int, const int)
1      __v8hi __builtin_arc_vld64 (__v8hi, const int, const int)
1 
1  The following take two 'int' arguments and return a '__v8hi' result.
1 The first argument must be a 3-bit compile time constants, indicating
1 one the registers I0-I7, and the second argument must be an 8-bit
1 compile time constant.
1 
1      __v8hi __builtin_arc_vld128 (const int, const int)
1      __v8hi __builtin_arc_vld64w (const int, const int)
1 
1  The following take a '__v8hi' argument and two 'int' arguments and
1 return no result.  The second argument must be a 3-bit compile time
1 constants, indicating one the registers I0-I7, and the third argument
1 must be an 8-bit compile time constant.
1 
1      void __builtin_arc_vst128 (__v8hi, const int, const int)
1      void __builtin_arc_vst64 (__v8hi, const int, const int)
1 
1  The following take a '__v8hi' argument and three 'int' arguments and
1 return no result.  The second argument must be a 3-bit compile-time
1 constant, identifying the 16-bit sub-register to be stored, the third
1 argument must be a 3-bit compile time constants, indicating one the
1 registers I0-I7, and the fourth argument must be an 8-bit compile time
1 constant.
1 
1      void __builtin_arc_vst16_n (__v8hi, const int, const int, const int)
1      void __builtin_arc_vst32_n (__v8hi, const int, const int, const int)
1