Skip to content

Instantly share code, notes, and snippets.

@kisssko
Created December 13, 2021 07:12
Show Gist options
  • Save kisssko/6a28bbe17576f7acdd8d431557776ac4 to your computer and use it in GitHub Desktop.
Save kisssko/6a28bbe17576f7acdd8d431557776ac4 to your computer and use it in GitHub Desktop.
gcc vectors
#ifndef __VECTOR
#define __VECTOR(SZ) __attribute__ ((vector_size (SZ)))
#endif
typedef uint8_t u16x4_t __VECTOR(4);
typedef uint16_t u16x2_t __VECTOR(4);
typedef uint8_t u8x8_t __VECTOR(8);
typedef uint16_t u16x4_t __VECTOR(8);
typedef uint32_t u32x2_t __VECTOR(8);
typedef uint8_t u8x16_t __VECTOR(16);
typedef uint16_t u16x8_t __VECTOR(16);
typedef uint32_t u32x4_t __VECTOR(16);
typedef uint64_t u32x2_t __VECTOR(16);
typedef uint8_t u8x32_t __VECTOR(32);
typedef uint16_t u16x16_t __VECTOR(32);
typedef uint32_t u32x8_t __VECTOR(32);
typedef uint64_t u64x4_t __VECTOR(32);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment