#include typedef int8_t vnx2qi __attribute__ ((vector_size (2))); typedef int8_t vnx4qi __attribute__ ((vector_size (4))); typedef int8_t vnx8qi __attribute__ ((vector_size (8))); typedef int8_t vnx16qi __attribute__ ((vector_size (16))); typedef int8_t vnx32qi __attribute__ ((vector_size (32))); typedef int8_t vnx64qi __attribute__ ((vector_size (64))); typedef int8_t vnx128qi __attribute__ ((vector_size (128))); typedef int16_t vnx2hi __attribute__ ((vector_size (4))); typedef int16_t vnx4hi __attribute__ ((vector_size (8))); typedef int16_t vnx8hi __attribute__ ((vector_size (16))); typedef int16_t vnx16hi __attribute__ ((vector_size (32))); typedef int16_t vnx32hi __attribute__ ((vector_size (64))); typedef int16_t vnx64hi __attribute__ ((vector_size (128))); typedef int32_t vnx2si __attribute__ ((vector_size (8))); typedef int32_t vnx4si __attribute__ ((vector_size (16))); typedef int32_t vnx8si __attribute__ ((vector_size (32))); typedef int32_t vnx16si __attribute__ ((vector_size (64))); typedef int32_t vnx32si __attribute__ ((vector_size (128))); typedef int64_t vnx2di __attribute__ ((vector_size (16))); typedef int64_t vnx4di __attribute__ ((vector_size (32))); typedef int64_t vnx8di __attribute__ ((vector_size (64))); typedef int64_t vnx16di __attribute__ ((vector_size (128))); typedef float vnx2sf __attribute__ ((vector_size (8))); typedef float vnx4sf __attribute__ ((vector_size (16))); typedef float vnx8sf __attribute__ ((vector_size (32))); typedef float vnx16sf __attribute__ ((vector_size (64))); typedef float vnx32sf __attribute__ ((vector_size (128))); typedef double vnx2df __attribute__ ((vector_size (16))); typedef double vnx4df __attribute__ ((vector_size (32))); typedef double vnx8df __attribute__ ((vector_size (64))); typedef double vnx16df __attribute__ ((vector_size (128))); #define INIT_PERMUTE(NUNITS, NUM1, NUM2, TYPE) \ TYPE v_##TYPE##_in1; \ TYPE v_##TYPE##_in2; \ TYPE v_##TYPE##_out = {0}; \ for (int i = 0; i < NUNITS; i++) \ { \ v_##TYPE##_in1[i] = i * NUM1 + NUM2; \ v_##TYPE##_in2[i] = i * NUM1 - NUM2; \ } #define CHECK_PERMUTE_SINGLE(NUNITS, VALUE, TYPE) \ for (int i = 0; i < NUNITS; i++) \ if (v_##TYPE##_out[i] != VALUE) \ __builtin_abort (); #define CHECK_PERMUTE_REVERSE(NUNITS, TYPE) \ for (int i = 0; i < NUNITS; i++) \ if (v_##TYPE##_out[i] != v_##TYPE##_in1[NUNITS - 1 - i]) \ __builtin_abort (); #define CHECK_PERMUTE_DOUBLE(NUNITS, TYPE) \ for (int i = 0; i < NUNITS; i++) \ { \ int new_index = i * 2; \ if (new_index < NUNITS \ && v_##TYPE##_out[i] != v_##TYPE##_in1[new_index]) \ __builtin_abort (); \ if (new_index >= NUNITS \ && v_##TYPE##_out[i] != v_##TYPE##_in2[new_index % NUNITS]) \ __builtin_abort (); \ }