brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.6 KiB · 3ab077e Raw
163 lines · c
1// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon  -ffreestanding -fsyntax-only -verify %s2 3#include <arm_neon.h>4// REQUIRES: aarch64-registered-target5 6// vsetq_lane_u8, vsetq_lane_u16, vsetq_lane_u32, vsetq_lane_u64 are7// tesed under clang/test/Sema/arm-mve-immediates.c8 9void test_set_vector_lane_u8(uint8x16_t arg_u8x16, uint8_t arg_u8, uint8x8_t arg_u8x8) {10	vset_lane_u8(arg_u8, arg_u8x8, 0);11	vset_lane_u8(arg_u8, arg_u8x8, 7);12	vset_lane_u8(arg_u8, arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}13	vset_lane_u8(arg_u8, arg_u8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}14}15 16void test_set_vector_lane_u16(uint16x4_t arg_u16x4, uint16_t arg_u16, uint16x8_t arg_u16x8) {17	vset_lane_u16(arg_u16, arg_u16x4, 0);18	vset_lane_u16(arg_u16, arg_u16x4, 3);19	vset_lane_u16(arg_u16, arg_u16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}20	vset_lane_u16(arg_u16, arg_u16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}21}22 23void test_set_vector_lane_u32(uint32x2_t arg_u32x2, uint32x4_t arg_u32x4, uint32_t arg_u32) {24	vset_lane_u32(arg_u32, arg_u32x2, 0);25	vset_lane_u32(arg_u32, arg_u32x2, 1);26	vset_lane_u32(arg_u32, arg_u32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}27	vset_lane_u32(arg_u32, arg_u32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}28}29 30void test_set_vector_lane_u64(uint64x2_t arg_u64x2, uint64x1_t arg_u64x1, uint64_t arg_u64) {31	vset_lane_u64(arg_u64, arg_u64x1, 0);32	vset_lane_u64(arg_u64, arg_u64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}33	vset_lane_u64(arg_u64, arg_u64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}34}35 36void test_set_vector_lane_p64(poly64_t arg_p64, poly64x1_t arg_p64x1, poly64x2_t arg_p64x2) {37	vset_lane_p64(arg_p64, arg_p64x1, 0);38	vset_lane_p64(arg_p64, arg_p64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}39	vset_lane_p64(arg_p64, arg_p64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}40 41	vsetq_lane_p64(arg_p64, arg_p64x2, 0);42	vsetq_lane_p64(arg_p64, arg_p64x2, 1);43	vsetq_lane_p64(arg_p64, arg_p64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}44	vsetq_lane_p64(arg_p64, arg_p64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}45 46}47 48void test_set_vector_lane_s8(int8x16_t arg_i8x16, int8x8_t arg_i8x8, int8_t arg_i8) {49	vset_lane_s8(arg_i8, arg_i8x8, 0);50	vset_lane_s8(arg_i8, arg_i8x8, 7);51	vset_lane_s8(arg_i8, arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}52	vset_lane_s8(arg_i8, arg_i8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}53 54	vsetq_lane_s8(arg_i8, arg_i8x16, 0);55	vsetq_lane_s8(arg_i8, arg_i8x16, 15);56	vsetq_lane_s8(arg_i8, arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}57	vsetq_lane_s8(arg_i8, arg_i8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}58 59}60 61void test_set_vector_lane_s16(int16x4_t arg_i16x4, int16_t arg_i16, int16x8_t arg_i16x8) {62	vset_lane_s16(arg_i16, arg_i16x4, 0);63	vset_lane_s16(arg_i16, arg_i16x4, 3);64	vset_lane_s16(arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}65	vset_lane_s16(arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}66 67	vsetq_lane_s16(arg_i16, arg_i16x8, 0);68	vsetq_lane_s16(arg_i16, arg_i16x8, 7);69	vsetq_lane_s16(arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}70	vsetq_lane_s16(arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}71 72}73 74void test_set_vector_lane_s32(int32_t arg_i32, int32x2_t arg_i32x2, int32x4_t arg_i32x4) {75	vset_lane_s32(arg_i32, arg_i32x2, 0);76	vset_lane_s32(arg_i32, arg_i32x2, 1);77	vset_lane_s32(arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}78	vset_lane_s32(arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}79 80	vsetq_lane_s32(arg_i32, arg_i32x4, 0);81	vsetq_lane_s32(arg_i32, arg_i32x4, 3);82	vsetq_lane_s32(arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}83	vsetq_lane_s32(arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}84 85}86 87void test_set_vector_lane_s64(int64_t arg_i64, int64x2_t arg_i64x2, int64x1_t arg_i64x1) {88	vset_lane_s64(arg_i64, arg_i64x1, 0);89	vset_lane_s64(arg_i64, arg_i64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}90	vset_lane_s64(arg_i64, arg_i64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}91 92	vsetq_lane_s64(arg_i64, arg_i64x2, 0);93	vsetq_lane_s64(arg_i64, arg_i64x2, 1);94	vsetq_lane_s64(arg_i64, arg_i64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}95	vsetq_lane_s64(arg_i64, arg_i64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}96 97}98 99void test_set_vector_lane_p8(poly8_t arg_p8, poly8x16_t arg_p8x16, poly8x8_t arg_p8x8) {100	vset_lane_p8(arg_p8, arg_p8x8, 0);101	vset_lane_p8(arg_p8, arg_p8x8, 7);102	vset_lane_p8(arg_p8, arg_p8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}103	vset_lane_p8(arg_p8, arg_p8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}104 105	vsetq_lane_p8(arg_p8, arg_p8x16, 0);106	vsetq_lane_p8(arg_p8, arg_p8x16, 15);107	vsetq_lane_p8(arg_p8, arg_p8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}108	vsetq_lane_p8(arg_p8, arg_p8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}109 110}111 112void test_set_vector_lane_p16(poly16x4_t arg_p16x4, poly16_t arg_p16, poly16x8_t arg_p16x8) {113	vset_lane_p16(arg_p16, arg_p16x4, 0);114	vset_lane_p16(arg_p16, arg_p16x4, 3);115	vset_lane_p16(arg_p16, arg_p16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}116	vset_lane_p16(arg_p16, arg_p16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}117 118	vsetq_lane_p16(arg_p16, arg_p16x8, 0);119	vsetq_lane_p16(arg_p16, arg_p16x8, 7);120	vsetq_lane_p16(arg_p16, arg_p16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}121	vsetq_lane_p16(arg_p16, arg_p16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}122 123}124 125void test_set_vector_lane_f16(float16x8_t arg_f16x8, float16x4_t arg_f16x4, float16_t arg_f16) {126	vset_lane_f16(arg_f16, arg_f16x4, 0);127	vset_lane_f16(arg_f16, arg_f16x4, 3);128	vset_lane_f16(arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}129	vset_lane_f16(arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}130 131	vsetq_lane_f16(arg_f16, arg_f16x8, 0);132	vsetq_lane_f16(arg_f16, arg_f16x8, 7);133	vsetq_lane_f16(arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}134	vsetq_lane_f16(arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}135 136}137 138void test_set_vector_lane_f32(float32x2_t arg_f32x2, float32x4_t arg_f32x4, float32_t arg_f32) {139	vset_lane_f32(arg_f32, arg_f32x2, 0);140	vset_lane_f32(arg_f32, arg_f32x2, 1);141	vset_lane_f32(arg_f32, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}142	vset_lane_f32(arg_f32, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}143 144	vsetq_lane_f32(arg_f32, arg_f32x4, 0);145	vsetq_lane_f32(arg_f32, arg_f32x4, 3);146	vsetq_lane_f32(arg_f32, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}147	vsetq_lane_f32(arg_f32, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}148 149}150 151void test_set_vector_lane_f64(float64x1_t arg_f64x1, float64x2_t arg_f64x2, float64_t arg_f64) {152	vset_lane_f64(arg_f64, arg_f64x1, 0);153	vset_lane_f64(arg_f64, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}154	vset_lane_f64(arg_f64, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}155 156	vsetq_lane_f64(arg_f64, arg_f64x2, 0);157	vsetq_lane_f64(arg_f64, arg_f64x2, 1);158	vsetq_lane_f64(arg_f64, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}159	vsetq_lane_f64(arg_f64, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}160 161}162 163