18 #if !defined(AT_CORE_H_INSIDE) 19 #error "Only <at/core.h> can be included directly." 25 typedef uint8_t __attribute__((vector_size(2))) v2u8;
26 typedef uint8_t __attribute__((vector_size(4))) v4u8;
28 typedef uint16_t __attribute__((vector_size(4))) v2u16;
29 typedef uint16_t __attribute__((vector_size(8))) v4u16;
31 typedef uint32_t __attribute__((vector_size(8))) v2u32;
32 typedef uint32_t __attribute__((vector_size(16))) v4u32;
34 typedef uint64_t __attribute__((vector_size(16))) v2u64;
35 typedef uint64_t __attribute__((vector_size(32))) v4u64;
37 typedef int8_t __attribute__((vector_size(2))) v2i8;
38 typedef int8_t __attribute__((vector_size(4))) v4i8;
40 typedef int16_t __attribute__((vector_size(4))) v2i16;
41 typedef int16_t __attribute__((vector_size(8))) v4i16;
43 typedef int32_t __attribute__((vector_size(8))) v2i32;
44 typedef int32_t __attribute__((vector_size(16))) v4i32;
46 typedef int64_t __attribute__((vector_size(16))) v2i64;
47 typedef int64_t __attribute__((vector_size(32))) v4i64;
49 typedef
float __attribute__((vector_size(8))) v2f32;
50 typedef
float __attribute__((vector_size(16))) v4f32;
52 typedef
double __attribute__((vector_size(16))) v2d64;
53 typedef
double __attribute__((vector_size(32))) v4d64;
55 #define AT_DECLARE_VEC2(vectype, uniontype, type) \ 59 struct{ type x; type y;}; \ 60 struct{ type width; type height;}; \ 63 #define AT_DECLARE_VEC3(vectype, uniontype, type) \ 67 struct{ type x; type y; type z;}; \ 68 struct{ type r; type g; type b;}; \ 71 #define AT_DECLARE_VEC4(vectype, uniontype, type) \ 75 struct{ type x; type y; union{struct{type z; type w;};struct{type width; type height;};};}; \ 76 struct{ type x0; type y0; type x1; type y1;}; \ 77 struct{ type r; type g; type b; type a;}; \ 80 AT_DECLARE_VEC2(u8, U8, uint8_t)
81 AT_DECLARE_VEC2(u16,U16,uint16_t)
82 AT_DECLARE_VEC2(u32,U32,uint32_t)
83 AT_DECLARE_VEC2(u64,U64,uint64_t)
84 AT_DECLARE_VEC2(i8, I8, int8_t)
85 AT_DECLARE_VEC2(i16,I16,int16_t)
86 AT_DECLARE_VEC2(i32,I32,int32_t)
87 AT_DECLARE_VEC2(i64,I64,int64_t)
88 AT_DECLARE_VEC2(f32,F32,
float)
89 AT_DECLARE_VEC2(d64,D64,
double)
91 AT_DECLARE_VEC3(u8, U8, uint8_t)
92 AT_DECLARE_VEC3(u16,U16,uint16_t)
93 AT_DECLARE_VEC3(u32,U32,uint32_t)
94 AT_DECLARE_VEC3(u64,U64,uint64_t)
95 AT_DECLARE_VEC3(i8, I8, int8_t)
96 AT_DECLARE_VEC3(i16,I16,int16_t)
97 AT_DECLARE_VEC3(i32,I32,int32_t)
98 AT_DECLARE_VEC3(i64,I64,int64_t)
99 AT_DECLARE_VEC3(f32,F32,
float)
100 AT_DECLARE_VEC3(d64,D64,
double)
102 AT_DECLARE_VEC4(u8, U8, uint8_t)
103 AT_DECLARE_VEC4(u16,U16,uint16_t)
104 AT_DECLARE_VEC4(u32,U32,uint32_t)
105 AT_DECLARE_VEC4(u64,U64,uint64_t)
106 AT_DECLARE_VEC4(i8, I8, int8_t)
107 AT_DECLARE_VEC4(i16,I16,int16_t)
108 AT_DECLARE_VEC4(i32,I32,int32_t)
109 AT_DECLARE_VEC4(i64,I64,int64_t)
110 AT_DECLARE_VEC4(f32,F32,
float)
111 AT_DECLARE_VEC4(d64,D64,
double)
114 at_vec3d64_normalize(AtVec3D64 vec);