181 changes: 181 additions & 0 deletions clang/test/Sema/aarch64-neon-immediate-ranges/fp16-vector.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +v8.2a -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
#include <arm_fp16.h>
// REQUIRES: aarch64-registered-target

// vcvtq_n_f16_u16 is tested under clang/test/Sema/arm-mve-immediates.c

void test_multiplication_f16(float16_t arg_f16, float16x8_t arg_f16x8, float16x4_t arg_f16x4) {
vmul_lane_f16(arg_f16x4, arg_f16x4, 0);
vmul_lane_f16(arg_f16x4, arg_f16x4, 3);
vmul_lane_f16(arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmul_lane_f16(arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulq_lane_f16(arg_f16x8, arg_f16x4, 0);
vmulq_lane_f16(arg_f16x8, arg_f16x4, 3);
vmulq_lane_f16(arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulq_lane_f16(arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmul_laneq_f16(arg_f16x4, arg_f16x8, 0);
vmul_laneq_f16(arg_f16x4, arg_f16x8, 7);
vmul_laneq_f16(arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmul_laneq_f16(arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulq_laneq_f16(arg_f16x8, arg_f16x8, 0);
vmulq_laneq_f16(arg_f16x8, arg_f16x8, 7);
vmulq_laneq_f16(arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulq_laneq_f16(arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulh_lane_f16(arg_f16, arg_f16x4, 0);
vmulh_lane_f16(arg_f16, arg_f16x4, 3);
vmulh_lane_f16(arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulh_lane_f16(arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulh_laneq_f16(arg_f16, arg_f16x8, 0);
vmulh_laneq_f16(arg_f16, arg_f16x8, 7);
vmulh_laneq_f16(arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulh_laneq_f16(arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_multiply_extended_f16(float16_t arg_f16, float16x8_t arg_f16x8, float16x4_t arg_f16x4) {
vmulx_lane_f16(arg_f16x4, arg_f16x4, 0);
vmulx_lane_f16(arg_f16x4, arg_f16x4, 3);
vmulx_lane_f16(arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulx_lane_f16(arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxq_lane_f16(arg_f16x8, arg_f16x4, 0);
vmulxq_lane_f16(arg_f16x8, arg_f16x4, 3);
vmulxq_lane_f16(arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxq_lane_f16(arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulx_laneq_f16(arg_f16x4, arg_f16x8, 0);
vmulx_laneq_f16(arg_f16x4, arg_f16x8, 7);
vmulx_laneq_f16(arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulx_laneq_f16(arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxq_laneq_f16(arg_f16x8, arg_f16x8, 0);
vmulxq_laneq_f16(arg_f16x8, arg_f16x8, 7);
vmulxq_laneq_f16(arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxq_laneq_f16(arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxh_lane_f16(arg_f16, arg_f16x4, 0);
vmulxh_lane_f16(arg_f16, arg_f16x4, 3);
vmulxh_lane_f16(arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxh_lane_f16(arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxh_laneq_f16(arg_f16, arg_f16x8, 0);
vmulxh_laneq_f16(arg_f16, arg_f16x8, 7);
vmulxh_laneq_f16(arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxh_laneq_f16(arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_fused_multiply_accumulate_f16(float16_t arg_f16, float16x8_t arg_f16x8, float16x4_t arg_f16x4) {
vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 0);
vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 3);
vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 0);
vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 3);
vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 0);
vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 7);
vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 0);
vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 7);
vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, 0);
vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, 3);
vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, 0);
vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, 7);
vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 0);
vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 3);
vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 0);
vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 3);
vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 0);
vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 7);
vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 0);
vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 7);
vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, 0);
vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, 3);
vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, 0);
vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, 7);
vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_conversions_s16(int16x8_t arg_i16x8, int16x4_t arg_i16x4) {
vcvt_n_f16_s16(arg_i16x4, 1);
vcvt_n_f16_s16(arg_i16x4, 16);
vcvt_n_f16_s16(arg_i16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcvt_n_f16_s16(arg_i16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vcvtq_n_f16_s16(arg_i16x8, 1);
vcvtq_n_f16_s16(arg_i16x8, 16);
vcvtq_n_f16_s16(arg_i16x8, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcvtq_n_f16_s16(arg_i16x8, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_conversions_u16(uint16x8_t arg_u16x8, uint16x4_t arg_u16x4) {
vcvt_n_f16_u16(arg_u16x4, 1);
vcvt_n_f16_u16(arg_u16x4, 16);
vcvt_n_f16_u16(arg_u16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcvt_n_f16_u16(arg_u16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_conversions_f16(float16x8_t arg_f16x8, float16x4_t arg_f16x4) {
vcvt_n_s16_f16(arg_f16x4, 1);
vcvt_n_s16_f16(arg_f16x4, 16);
vcvt_n_s16_f16(arg_f16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcvt_n_s16_f16(arg_f16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vcvtq_n_s16_f16(arg_f16x8, 1);
vcvtq_n_s16_f16(arg_f16x8, 16);
vcvtq_n_s16_f16(arg_f16x8, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcvtq_n_s16_f16(arg_f16x8, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vcvt_n_u16_f16(arg_f16x4, 1);
vcvt_n_u16_f16(arg_f16x4, 16);
vcvt_n_u16_f16(arg_f16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcvt_n_u16_f16(arg_f16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vcvtq_n_u16_f16(arg_f16x8, 1);
vcvtq_n_u16_f16(arg_f16x8, 16);
vcvtq_n_u16_f16(arg_f16x8, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcvtq_n_u16_f16(arg_f16x8, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target


void test_fused_multiply_accumulate_f32(float32x2_t arg_f32x2, float32_t arg_f32, float32x4_t arg_f32x4) {
vfma_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, 0);
vfma_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, 1);
vfma_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfma_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmaq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, 0);
vfmaq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, 1);
vfmaq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmaq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmas_lane_f32(arg_f32, arg_f32, arg_f32x2, 0);
vfmas_lane_f32(arg_f32, arg_f32, arg_f32x2, 1);
vfmas_lane_f32(arg_f32, arg_f32, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmas_lane_f32(arg_f32, arg_f32, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfma_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, 0);
vfma_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, 3);
vfma_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfma_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmaq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, 0);
vfmaq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, 3);
vfmaq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmaq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmas_laneq_f32(arg_f32, arg_f32, arg_f32x4, 0);
vfmas_laneq_f32(arg_f32, arg_f32, arg_f32x4, 3);
vfmas_laneq_f32(arg_f32, arg_f32, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmas_laneq_f32(arg_f32, arg_f32, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfms_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, 0);
vfms_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, 1);
vfms_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfms_lane_f32(arg_f32x2, arg_f32x2, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, 0);
vfmsq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, 1);
vfmsq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsq_lane_f32(arg_f32x4, arg_f32x4, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmss_lane_f32(arg_f32, arg_f32, arg_f32x2, 0);
vfmss_lane_f32(arg_f32, arg_f32, arg_f32x2, 1);
vfmss_lane_f32(arg_f32, arg_f32, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmss_lane_f32(arg_f32, arg_f32, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfms_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, 0);
vfms_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, 3);
vfms_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfms_laneq_f32(arg_f32x2, arg_f32x2, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, 0);
vfmsq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, 3);
vfmsq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsq_laneq_f32(arg_f32x4, arg_f32x4, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmss_laneq_f32(arg_f32, arg_f32, arg_f32x4, 0);
vfmss_laneq_f32(arg_f32, arg_f32, arg_f32x4, 3);
vfmss_laneq_f32(arg_f32, arg_f32, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmss_laneq_f32(arg_f32, arg_f32, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_fused_multiply_accumulate_f64(float64x2_t arg_f64x2, float64_t arg_f64, float64x1_t arg_f64x1) {
vfma_lane_f64(arg_f64x1, arg_f64x1, arg_f64x1, 0);
vfma_lane_f64(arg_f64x1, arg_f64x1, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfma_lane_f64(arg_f64x1, arg_f64x1, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmaq_lane_f64(arg_f64x2, arg_f64x2, arg_f64x1, 0);
vfmaq_lane_f64(arg_f64x2, arg_f64x2, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmaq_lane_f64(arg_f64x2, arg_f64x2, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmad_lane_f64(arg_f64, arg_f64, arg_f64x1, 0);
vfmad_lane_f64(arg_f64, arg_f64, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmad_lane_f64(arg_f64, arg_f64, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfma_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, 0);
vfma_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, 1);
vfma_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfma_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmaq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, 0);
vfmaq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, 1);
vfmaq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmaq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmad_laneq_f64(arg_f64, arg_f64, arg_f64x2, 0);
vfmad_laneq_f64(arg_f64, arg_f64, arg_f64x2, 1);
vfmad_laneq_f64(arg_f64, arg_f64, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmad_laneq_f64(arg_f64, arg_f64, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfms_lane_f64(arg_f64x1, arg_f64x1, arg_f64x1, 0);
vfms_lane_f64(arg_f64x1, arg_f64x1, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfms_lane_f64(arg_f64x1, arg_f64x1, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsq_lane_f64(arg_f64x2, arg_f64x2, arg_f64x1, 0);
vfmsq_lane_f64(arg_f64x2, arg_f64x2, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsq_lane_f64(arg_f64x2, arg_f64x2, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsd_lane_f64(arg_f64, arg_f64, arg_f64x1, 0);
vfmsd_lane_f64(arg_f64, arg_f64, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsd_lane_f64(arg_f64, arg_f64, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfms_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, 0);
vfms_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, 1);
vfms_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfms_laneq_f64(arg_f64x1, arg_f64x1, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, 0);
vfmsq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, 1);
vfmsq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsq_laneq_f64(arg_f64x2, arg_f64x2, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vfmsd_laneq_f64(arg_f64, arg_f64, arg_f64x2, 0);
vfmsd_laneq_f64(arg_f64, arg_f64, arg_f64x2, 1);
vfmsd_laneq_f64(arg_f64, arg_f64, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vfmsd_laneq_f64(arg_f64, arg_f64, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

283 changes: 283 additions & 0 deletions clang/test/Sema/aarch64-neon-immediate-ranges/luti.c

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +v8.6a -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target


void test_dot_product_s32(int8x8_t arg_i8x8, int32x2_t arg_i32x2, uint8x16_t arg_u8x16, uint8x8_t arg_u8x8,
int32x4_t arg_i32x4, int8x16_t arg_i8x16) {
vusdot_lane_s32(arg_i32x2, arg_u8x8, arg_i8x8, 0);
vusdot_lane_s32(arg_i32x2, arg_u8x8, arg_i8x8, 1);
vusdot_lane_s32(arg_i32x2, arg_u8x8, arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vusdot_lane_s32(arg_i32x2, arg_u8x8, arg_i8x8, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsudot_lane_s32(arg_i32x2, arg_i8x8, arg_u8x8, 0);
vsudot_lane_s32(arg_i32x2, arg_i8x8, arg_u8x8, 1);
vsudot_lane_s32(arg_i32x2, arg_i8x8, arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsudot_lane_s32(arg_i32x2, arg_i8x8, arg_u8x8, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vusdot_laneq_s32(arg_i32x2, arg_u8x8, arg_i8x16, 0);
vusdot_laneq_s32(arg_i32x2, arg_u8x8, arg_i8x16, 3);
vusdot_laneq_s32(arg_i32x2, arg_u8x8, arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vusdot_laneq_s32(arg_i32x2, arg_u8x8, arg_i8x16, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsudot_laneq_s32(arg_i32x2, arg_i8x8, arg_u8x16, 0);
vsudot_laneq_s32(arg_i32x2, arg_i8x8, arg_u8x16, 3);
vsudot_laneq_s32(arg_i32x2, arg_i8x8, arg_u8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsudot_laneq_s32(arg_i32x2, arg_i8x8, arg_u8x16, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vusdotq_lane_s32(arg_i32x4, arg_u8x16, arg_i8x8, 0);
vusdotq_lane_s32(arg_i32x4, arg_u8x16, arg_i8x8, 1);
vusdotq_lane_s32(arg_i32x4, arg_u8x16, arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vusdotq_lane_s32(arg_i32x4, arg_u8x16, arg_i8x8, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsudotq_lane_s32(arg_i32x4, arg_i8x16, arg_u8x8, 0);
vsudotq_lane_s32(arg_i32x4, arg_i8x16, arg_u8x8, 1);
vsudotq_lane_s32(arg_i32x4, arg_i8x16, arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsudotq_lane_s32(arg_i32x4, arg_i8x16, arg_u8x8, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vusdotq_laneq_s32(arg_i32x4, arg_u8x16, arg_i8x16, 0);
vusdotq_laneq_s32(arg_i32x4, arg_u8x16, arg_i8x16, 3);
vusdotq_laneq_s32(arg_i32x4, arg_u8x16, arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vusdotq_laneq_s32(arg_i32x4, arg_u8x16, arg_i8x16, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsudotq_laneq_s32(arg_i32x4, arg_i8x16, arg_u8x16, 0);
vsudotq_laneq_s32(arg_i32x4, arg_i8x16, arg_u8x16, 3);
vsudotq_laneq_s32(arg_i32x4, arg_i8x16, arg_u8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsudotq_laneq_s32(arg_i32x4, arg_i8x16, arg_u8x16, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

69 changes: 69 additions & 0 deletions clang/test/Sema/aarch64-neon-immediate-ranges/multiply-extended.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target


void test_multiply_extended_f32(float32_t arg_f32, float32x2_t arg_f32x2, float32x4_t arg_f32x4) {
vmulx_lane_f32(arg_f32x2, arg_f32x2, 0);
vmulx_lane_f32(arg_f32x2, arg_f32x2, 1);
vmulx_lane_f32(arg_f32x2, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulx_lane_f32(arg_f32x2, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxq_lane_f32(arg_f32x4, arg_f32x2, 0);
vmulxq_lane_f32(arg_f32x4, arg_f32x2, 1);
vmulxq_lane_f32(arg_f32x4, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxq_lane_f32(arg_f32x4, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxs_lane_f32(arg_f32, arg_f32x2, 0);
vmulxs_lane_f32(arg_f32, arg_f32x2, 1);
vmulxs_lane_f32(arg_f32, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxs_lane_f32(arg_f32, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulx_laneq_f32(arg_f32x2, arg_f32x4, 0);
vmulx_laneq_f32(arg_f32x2, arg_f32x4, 3);
vmulx_laneq_f32(arg_f32x2, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulx_laneq_f32(arg_f32x2, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxq_laneq_f32(arg_f32x4, arg_f32x4, 0);
vmulxq_laneq_f32(arg_f32x4, arg_f32x4, 3);
vmulxq_laneq_f32(arg_f32x4, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxq_laneq_f32(arg_f32x4, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxs_laneq_f32(arg_f32, arg_f32x4, 0);
vmulxs_laneq_f32(arg_f32, arg_f32x4, 3);
vmulxs_laneq_f32(arg_f32, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxs_laneq_f32(arg_f32, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_multiply_extended_f64(float64_t arg_f64, float64x2_t arg_f64x2, float64x1_t arg_f64x1) {
vmulx_lane_f64(arg_f64x1, arg_f64x1, 0);
vmulx_lane_f64(arg_f64x1, arg_f64x1, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vmulx_lane_f64(arg_f64x1, arg_f64x1, 1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}

vmulxq_lane_f64(arg_f64x2, arg_f64x1, 0);
vmulxq_lane_f64(arg_f64x2, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxq_lane_f64(arg_f64x2, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxd_lane_f64(arg_f64, arg_f64x1, 0);
vmulxd_lane_f64(arg_f64, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxd_lane_f64(arg_f64, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulx_laneq_f64(arg_f64x1, arg_f64x2, 0);
vmulx_laneq_f64(arg_f64x1, arg_f64x2, 1);
vmulx_laneq_f64(arg_f64x1, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulx_laneq_f64(arg_f64x1, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxq_laneq_f64(arg_f64x2, arg_f64x2, 0);
vmulxq_laneq_f64(arg_f64x2, arg_f64x2, 1);
vmulxq_laneq_f64(arg_f64x2, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxq_laneq_f64(arg_f64x2, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vmulxd_laneq_f64(arg_f64, arg_f64x2, 0);
vmulxd_laneq_f64(arg_f64, arg_f64x2, 1);
vmulxd_laneq_f64(arg_f64, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vmulxd_laneq_f64(arg_f64, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target


void test_saturating_multiply_accumulate_s16(int16x4_t arg_i16x4, int32_t arg_i32, int16_t arg_i16,
int32x4_t arg_i32x4, int16x8_t arg_i16x8) {
vqdmlal_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, 0);
vqdmlal_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, 3);
vqdmlal_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlalh_lane_s16(arg_i32, arg_i16, arg_i16x4, 0);
vqdmlalh_lane_s16(arg_i32, arg_i16, arg_i16x4, 3);
vqdmlalh_lane_s16(arg_i32, arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlalh_lane_s16(arg_i32, arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlal_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, 0);
vqdmlal_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, 3);
vqdmlal_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlal_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, 0);
vqdmlal_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, 7);
vqdmlal_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlalh_laneq_s16(arg_i32, arg_i16, arg_i16x8, 0);
vqdmlalh_laneq_s16(arg_i32, arg_i16, arg_i16x8, 7);
vqdmlalh_laneq_s16(arg_i32, arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlalh_laneq_s16(arg_i32, arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlal_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, 0);
vqdmlal_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, 7);
vqdmlal_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, 0);
vqdmlsl_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, 3);
vqdmlsl_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_lane_s16(arg_i32x4, arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlslh_lane_s16(arg_i32, arg_i16, arg_i16x4, 0);
vqdmlslh_lane_s16(arg_i32, arg_i16, arg_i16x4, 3);
vqdmlslh_lane_s16(arg_i32, arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlslh_lane_s16(arg_i32, arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, 0);
vqdmlsl_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, 3);
vqdmlsl_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_high_lane_s16(arg_i32x4, arg_i16x8, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, 0);
vqdmlsl_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, 7);
vqdmlsl_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_laneq_s16(arg_i32x4, arg_i16x4, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlslh_laneq_s16(arg_i32, arg_i16, arg_i16x8, 0);
vqdmlslh_laneq_s16(arg_i32, arg_i16, arg_i16x8, 7);
vqdmlslh_laneq_s16(arg_i32, arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlslh_laneq_s16(arg_i32, arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, 0);
vqdmlsl_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, 7);
vqdmlsl_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_high_laneq_s16(arg_i32x4, arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_saturating_multiply_accumulate_s32(int32_t arg_i32, int32x4_t arg_i32x4, int64_t arg_i64, int64x2_t arg_i64x2, int32x2_t arg_i32x2) {
vqdmlal_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, 0);
vqdmlal_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, 1);
vqdmlal_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlals_lane_s32(arg_i64, arg_i32, arg_i32x2, 0);
vqdmlals_lane_s32(arg_i64, arg_i32, arg_i32x2, 1);
vqdmlals_lane_s32(arg_i64, arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlals_lane_s32(arg_i64, arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlal_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, 0);
vqdmlal_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, 1);
vqdmlal_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlal_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, 0);
vqdmlal_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, 3);
vqdmlal_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlals_laneq_s32(arg_i64, arg_i32, arg_i32x4, 0);
vqdmlals_laneq_s32(arg_i64, arg_i32, arg_i32x4, 3);
vqdmlals_laneq_s32(arg_i64, arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlals_laneq_s32(arg_i64, arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlal_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, 0);
vqdmlal_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, 3);
vqdmlal_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlal_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, 0);
vqdmlsl_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, 1);
vqdmlsl_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_lane_s32(arg_i64x2, arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsls_lane_s32(arg_i64, arg_i32, arg_i32x2, 0);
vqdmlsls_lane_s32(arg_i64, arg_i32, arg_i32x2, 1);
vqdmlsls_lane_s32(arg_i64, arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsls_lane_s32(arg_i64, arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, 0);
vqdmlsl_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, 1);
vqdmlsl_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_high_lane_s32(arg_i64x2, arg_i32x4, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, 0);
vqdmlsl_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, 3);
vqdmlsl_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_laneq_s32(arg_i64x2, arg_i32x2, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsls_laneq_s32(arg_i64, arg_i32, arg_i32x4, 0);
vqdmlsls_laneq_s32(arg_i64, arg_i32, arg_i32x4, 3);
vqdmlsls_laneq_s32(arg_i64, arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsls_laneq_s32(arg_i64, arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmlsl_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, 0);
vqdmlsl_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, 3);
vqdmlsl_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmlsl_high_laneq_s32(arg_i64x2, arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target


void test_saturating_multiply_by_scalar_and_widen_s16(int16x4_t arg_i16x4, int16x8_t arg_i16x8, int16_t arg_i16) {
vqdmull_lane_s16(arg_i16x4, arg_i16x4, 0);
vqdmull_lane_s16(arg_i16x4, arg_i16x4, 3);
vqdmull_lane_s16(arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_lane_s16(arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmullh_lane_s16(arg_i16, arg_i16x4, 0);
vqdmullh_lane_s16(arg_i16, arg_i16x4, 3);
vqdmullh_lane_s16(arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmullh_lane_s16(arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmull_high_lane_s16(arg_i16x8, arg_i16x4, 0);
vqdmull_high_lane_s16(arg_i16x8, arg_i16x4, 3);
vqdmull_high_lane_s16(arg_i16x8, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_high_lane_s16(arg_i16x8, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmull_laneq_s16(arg_i16x4, arg_i16x8, 0);
vqdmull_laneq_s16(arg_i16x4, arg_i16x8, 7);
vqdmull_laneq_s16(arg_i16x4, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_laneq_s16(arg_i16x4, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmullh_laneq_s16(arg_i16, arg_i16x8, 0);
vqdmullh_laneq_s16(arg_i16, arg_i16x8, 7);
vqdmullh_laneq_s16(arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmullh_laneq_s16(arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmull_high_laneq_s16(arg_i16x8, arg_i16x8, 0);
vqdmull_high_laneq_s16(arg_i16x8, arg_i16x8, 7);
vqdmull_high_laneq_s16(arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_high_laneq_s16(arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulh_lane_s16(arg_i16x4, arg_i16x4, 0);
vqdmulh_lane_s16(arg_i16x4, arg_i16x4, 3);
vqdmulh_lane_s16(arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulh_lane_s16(arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhq_lane_s16(arg_i16x8, arg_i16x4, 0);
vqdmulhq_lane_s16(arg_i16x8, arg_i16x4, 3);
vqdmulhq_lane_s16(arg_i16x8, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhq_lane_s16(arg_i16x8, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhh_lane_s16(arg_i16, arg_i16x4, 0);
vqdmulhh_lane_s16(arg_i16, arg_i16x4, 3);
vqdmulhh_lane_s16(arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhh_lane_s16(arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulh_laneq_s16(arg_i16x4, arg_i16x8, 0);
vqdmulh_laneq_s16(arg_i16x4, arg_i16x8, 7);
vqdmulh_laneq_s16(arg_i16x4, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulh_laneq_s16(arg_i16x4, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhq_laneq_s16(arg_i16x8, arg_i16x8, 0);
vqdmulhq_laneq_s16(arg_i16x8, arg_i16x8, 7);
vqdmulhq_laneq_s16(arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhq_laneq_s16(arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhh_laneq_s16(arg_i16, arg_i16x8, 0);
vqdmulhh_laneq_s16(arg_i16, arg_i16x8, 7);
vqdmulhh_laneq_s16(arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhh_laneq_s16(arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulh_lane_s16(arg_i16x4, arg_i16x4, 0);
vqrdmulh_lane_s16(arg_i16x4, arg_i16x4, 3);
vqrdmulh_lane_s16(arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulh_lane_s16(arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhq_lane_s16(arg_i16x8, arg_i16x4, 0);
vqrdmulhq_lane_s16(arg_i16x8, arg_i16x4, 3);
vqrdmulhq_lane_s16(arg_i16x8, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhq_lane_s16(arg_i16x8, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhh_lane_s16(arg_i16, arg_i16x4, 0);
vqrdmulhh_lane_s16(arg_i16, arg_i16x4, 3);
vqrdmulhh_lane_s16(arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhh_lane_s16(arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulh_laneq_s16(arg_i16x4, arg_i16x8, 0);
vqrdmulh_laneq_s16(arg_i16x4, arg_i16x8, 7);
vqrdmulh_laneq_s16(arg_i16x4, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulh_laneq_s16(arg_i16x4, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhq_laneq_s16(arg_i16x8, arg_i16x8, 0);
vqrdmulhq_laneq_s16(arg_i16x8, arg_i16x8, 7);
vqrdmulhq_laneq_s16(arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhq_laneq_s16(arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhh_laneq_s16(arg_i16, arg_i16x8, 0);
vqrdmulhh_laneq_s16(arg_i16, arg_i16x8, 7);
vqrdmulhh_laneq_s16(arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhh_laneq_s16(arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}


void test_saturating_multiply_by_scalar_and_widen_s32(int32x2_t arg_i32x2, int32_t arg_i32, int32x4_t arg_i32x4) {
vqdmull_lane_s32(arg_i32x2, arg_i32x2, 0);
vqdmull_lane_s32(arg_i32x2, arg_i32x2, 1);
vqdmull_lane_s32(arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_lane_s32(arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulls_lane_s32(arg_i32, arg_i32x2, 0);
vqdmulls_lane_s32(arg_i32, arg_i32x2, 1);
vqdmulls_lane_s32(arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulls_lane_s32(arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmull_high_lane_s32(arg_i32x4, arg_i32x2, 0);
vqdmull_high_lane_s32(arg_i32x4, arg_i32x2, 1);
vqdmull_high_lane_s32(arg_i32x4, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_high_lane_s32(arg_i32x4, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmull_laneq_s32(arg_i32x2, arg_i32x4, 0);
vqdmull_laneq_s32(arg_i32x2, arg_i32x4, 3);
vqdmull_laneq_s32(arg_i32x2, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_laneq_s32(arg_i32x2, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulls_laneq_s32(arg_i32, arg_i32x4, 0);
vqdmulls_laneq_s32(arg_i32, arg_i32x4, 3);
vqdmulls_laneq_s32(arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulls_laneq_s32(arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmull_high_laneq_s32(arg_i32x4, arg_i32x4, 0);
vqdmull_high_laneq_s32(arg_i32x4, arg_i32x4, 3);
vqdmull_high_laneq_s32(arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmull_high_laneq_s32(arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulh_lane_s32(arg_i32x2, arg_i32x2, 0);
vqdmulh_lane_s32(arg_i32x2, arg_i32x2, 1);
vqdmulh_lane_s32(arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulh_lane_s32(arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhq_lane_s32(arg_i32x4, arg_i32x2, 0);
vqdmulhq_lane_s32(arg_i32x4, arg_i32x2, 1);
vqdmulhq_lane_s32(arg_i32x4, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhq_lane_s32(arg_i32x4, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhs_lane_s32(arg_i32, arg_i32x2, 0);
vqdmulhs_lane_s32(arg_i32, arg_i32x2, 1);
vqdmulhs_lane_s32(arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhs_lane_s32(arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulh_laneq_s32(arg_i32x2, arg_i32x4, 0);
vqdmulh_laneq_s32(arg_i32x2, arg_i32x4, 3);
vqdmulh_laneq_s32(arg_i32x2, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulh_laneq_s32(arg_i32x2, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhq_laneq_s32(arg_i32x4, arg_i32x4, 0);
vqdmulhq_laneq_s32(arg_i32x4, arg_i32x4, 3);
vqdmulhq_laneq_s32(arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhq_laneq_s32(arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqdmulhs_laneq_s32(arg_i32, arg_i32x4, 0);
vqdmulhs_laneq_s32(arg_i32, arg_i32x4, 3);
vqdmulhs_laneq_s32(arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqdmulhs_laneq_s32(arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulh_lane_s32(arg_i32x2, arg_i32x2, 0);
vqrdmulh_lane_s32(arg_i32x2, arg_i32x2, 1);
vqrdmulh_lane_s32(arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulh_lane_s32(arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhq_lane_s32(arg_i32x4, arg_i32x2, 0);
vqrdmulhq_lane_s32(arg_i32x4, arg_i32x2, 1);
vqrdmulhq_lane_s32(arg_i32x4, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhq_lane_s32(arg_i32x4, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhs_lane_s32(arg_i32, arg_i32x2, 0);
vqrdmulhs_lane_s32(arg_i32, arg_i32x2, 1);
vqrdmulhs_lane_s32(arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhs_lane_s32(arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulh_laneq_s32(arg_i32x2, arg_i32x4, 0);
vqrdmulh_laneq_s32(arg_i32x2, arg_i32x4, 3);
vqrdmulh_laneq_s32(arg_i32x2, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulh_laneq_s32(arg_i32x2, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhq_laneq_s32(arg_i32x4, arg_i32x4, 0);
vqrdmulhq_laneq_s32(arg_i32x4, arg_i32x4, 3);
vqrdmulhq_laneq_s32(arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhq_laneq_s32(arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmulhs_laneq_s32(arg_i32, arg_i32x4, 0);
vqrdmulhs_laneq_s32(arg_i32, arg_i32x4, 3);
vqrdmulhs_laneq_s32(arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmulhs_laneq_s32(arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

297 changes: 297 additions & 0 deletions clang/test/Sema/aarch64-neon-immediate-ranges/set-lanes-to-value.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target


void test_set_all_lanes_to_the_same_value_s8(int8x8_t arg_i8x8, int8x16_t arg_i8x16) {
vdup_lane_s8(arg_i8x8, 0);
vdup_lane_s8(arg_i8x8, 7);
vdup_lane_s8(arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_s8(arg_i8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_s8(arg_i8x8, 0);
vdupq_lane_s8(arg_i8x8, 7);
vdupq_lane_s8(arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_s8(arg_i8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_s8(arg_i8x16, 0);
vdup_laneq_s8(arg_i8x16, 15);
vdup_laneq_s8(arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_s8(arg_i8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_s8(arg_i8x16, 0);
vdupq_laneq_s8(arg_i8x16, 15);
vdupq_laneq_s8(arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_s8(arg_i8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_s16(int16x4_t arg_i16x4, int16x8_t arg_i16x8) {
vdup_lane_s16(arg_i16x4, 0);
vdup_lane_s16(arg_i16x4, 3);
vdup_lane_s16(arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_s16(arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_s16(arg_i16x4, 0);
vdupq_lane_s16(arg_i16x4, 3);
vdupq_lane_s16(arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_s16(arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_s16(arg_i16x8, 0);
vdup_laneq_s16(arg_i16x8, 7);
vdup_laneq_s16(arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_s16(arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_s16(arg_i16x8, 0);
vdupq_laneq_s16(arg_i16x8, 7);
vdupq_laneq_s16(arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_s16(arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_s32(int32x4_t arg_i32x4, int32x2_t arg_i32x2) {
vdup_lane_s32(arg_i32x2, 0);
vdup_lane_s32(arg_i32x2, 1);
vdup_lane_s32(arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_s32(arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_s32(arg_i32x2, 0);
vdupq_lane_s32(arg_i32x2, 1);
vdupq_lane_s32(arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_s32(arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_s32(arg_i32x4, 0);
vdup_laneq_s32(arg_i32x4, 3);
vdup_laneq_s32(arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_s32(arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_s32(arg_i32x4, 0);
vdupq_laneq_s32(arg_i32x4, 3);
vdupq_laneq_s32(arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_s32(arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_s64(int64x1_t arg_i64x1, int64x2_t arg_i64x2) {
vdup_lane_s64(arg_i64x1, 0);
vdup_lane_s64(arg_i64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_s64(arg_i64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_s64(arg_i64x1, 0);
vdupq_lane_s64(arg_i64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_s64(arg_i64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_s64(arg_i64x2, 0);
vdup_laneq_s64(arg_i64x2, 1);
vdup_laneq_s64(arg_i64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_s64(arg_i64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_s64(arg_i64x2, 0);
vdupq_laneq_s64(arg_i64x2, 1);
vdupq_laneq_s64(arg_i64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_s64(arg_i64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_u8(uint8x8_t arg_u8x8, uint8x16_t arg_u8x16) {
vdup_lane_u8(arg_u8x8, 0);
vdup_lane_u8(arg_u8x8, 7);
vdup_lane_u8(arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_u8(arg_u8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_u8(arg_u8x8, 0);
vdupq_lane_u8(arg_u8x8, 7);
vdupq_lane_u8(arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_u8(arg_u8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_u8(arg_u8x16, 0);
vdup_laneq_u8(arg_u8x16, 15);
vdup_laneq_u8(arg_u8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_u8(arg_u8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_u8(arg_u8x16, 0);
vdupq_laneq_u8(arg_u8x16, 15);
vdupq_laneq_u8(arg_u8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_u8(arg_u8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_u16(uint16x4_t arg_u16x4, uint16x8_t arg_u16x8) {
vdup_lane_u16(arg_u16x4, 0);
vdup_lane_u16(arg_u16x4, 3);
vdup_lane_u16(arg_u16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_u16(arg_u16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_u16(arg_u16x4, 0);
vdupq_lane_u16(arg_u16x4, 3);
vdupq_lane_u16(arg_u16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_u16(arg_u16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_u16(arg_u16x8, 0);
vdup_laneq_u16(arg_u16x8, 7);
vdup_laneq_u16(arg_u16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_u16(arg_u16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_u16(arg_u16x8, 0);
vdupq_laneq_u16(arg_u16x8, 7);
vdupq_laneq_u16(arg_u16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_u16(arg_u16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_u32(uint32x4_t arg_u32x4, uint32x2_t arg_u32x2) {
vdup_lane_u32(arg_u32x2, 0);
vdup_lane_u32(arg_u32x2, 1);
vdup_lane_u32(arg_u32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_u32(arg_u32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_u32(arg_u32x2, 0);
vdupq_lane_u32(arg_u32x2, 1);
vdupq_lane_u32(arg_u32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_u32(arg_u32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_u32(arg_u32x4, 0);
vdup_laneq_u32(arg_u32x4, 3);
vdup_laneq_u32(arg_u32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_u32(arg_u32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_u32(arg_u32x4, 0);
vdupq_laneq_u32(arg_u32x4, 3);
vdupq_laneq_u32(arg_u32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_u32(arg_u32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_u64(uint64x1_t arg_u64x1, uint64x2_t arg_u64x2) {
vdup_lane_u64(arg_u64x1, 0);
vdup_lane_u64(arg_u64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_u64(arg_u64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_u64(arg_u64x1, 0);
vdupq_lane_u64(arg_u64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_u64(arg_u64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_u64(arg_u64x2, 0);
vdup_laneq_u64(arg_u64x2, 1);
vdup_laneq_u64(arg_u64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_u64(arg_u64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_u64(arg_u64x2, 0);
vdupq_laneq_u64(arg_u64x2, 1);
vdupq_laneq_u64(arg_u64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_u64(arg_u64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_p64(poly64x1_t arg_p64x1, poly64x2_t arg_p64x2) {
vdup_lane_p64(arg_p64x1, 0);
vdup_lane_p64(arg_p64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_p64(arg_p64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_p64(arg_p64x1, 0);
vdupq_lane_p64(arg_p64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_p64(arg_p64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_p64(arg_p64x2, 0);
vdup_laneq_p64(arg_p64x2, 1);
vdup_laneq_p64(arg_p64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_p64(arg_p64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_p64(arg_p64x2, 0);
vdupq_laneq_p64(arg_p64x2, 1);
vdupq_laneq_p64(arg_p64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_p64(arg_p64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_f32(float32x2_t arg_f32x2, float32x4_t arg_f32x4) {
vdup_lane_f32(arg_f32x2, 0);
vdup_lane_f32(arg_f32x2, 1);
vdup_lane_f32(arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_f32(arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_f32(arg_f32x2, 0);
vdupq_lane_f32(arg_f32x2, 1);
vdupq_lane_f32(arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_f32(arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_f32(arg_f32x4, 0);
vdup_laneq_f32(arg_f32x4, 3);
vdup_laneq_f32(arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_f32(arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_f32(arg_f32x4, 0);
vdupq_laneq_f32(arg_f32x4, 3);
vdupq_laneq_f32(arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_f32(arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_p8(poly8x16_t arg_p8x16, poly8x8_t arg_p8x8) {
vdup_lane_p8(arg_p8x8, 0);
vdup_lane_p8(arg_p8x8, 7);
vdup_lane_p8(arg_p8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_p8(arg_p8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_p8(arg_p8x8, 0);
vdupq_lane_p8(arg_p8x8, 7);
vdupq_lane_p8(arg_p8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_p8(arg_p8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_p8(arg_p8x16, 0);
vdup_laneq_p8(arg_p8x16, 15);
vdup_laneq_p8(arg_p8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_p8(arg_p8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_p8(arg_p8x16, 0);
vdupq_laneq_p8(arg_p8x16, 15);
vdupq_laneq_p8(arg_p8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_p8(arg_p8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_p16(poly16x4_t arg_p16x4, poly16x8_t arg_p16x8) {
vdup_lane_p16(arg_p16x4, 0);
vdup_lane_p16(arg_p16x4, 3);
vdup_lane_p16(arg_p16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_p16(arg_p16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_p16(arg_p16x4, 0);
vdupq_lane_p16(arg_p16x4, 3);
vdupq_lane_p16(arg_p16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_p16(arg_p16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_p16(arg_p16x8, 0);
vdup_laneq_p16(arg_p16x8, 7);
vdup_laneq_p16(arg_p16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_p16(arg_p16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_p16(arg_p16x8, 0);
vdupq_laneq_p16(arg_p16x8, 7);
vdupq_laneq_p16(arg_p16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_p16(arg_p16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_all_lanes_to_the_same_value_f64(float64x2_t arg_f64x2, float64x1_t arg_f64x1) {
vdup_lane_f64(arg_f64x1, 0);
vdup_lane_f64(arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_lane_f64(arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_lane_f64(arg_f64x1, 0);
vdupq_lane_f64(arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_lane_f64(arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdup_laneq_f64(arg_f64x2, 0);
vdup_laneq_f64(arg_f64x2, 1);
vdup_laneq_f64(arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdup_laneq_f64(arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vdupq_laneq_f64(arg_f64x2, 0);
vdupq_laneq_f64(arg_f64x2, 1);
vdupq_laneq_f64(arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vdupq_laneq_f64(arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

162 changes: 162 additions & 0 deletions clang/test/Sema/aarch64-neon-immediate-ranges/set-vector-lane.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target

// vsetq_lane_u8, vsetq_lane_u16, vsetq_lane_u32, vsetq_lane_u64 are
// tesed under clang/test/Sema/arm-mve-immediates.c

void test_set_vector_lane_u8(uint8x16_t arg_u8x16, uint8_t arg_u8, uint8x8_t arg_u8x8) {
vset_lane_u8(arg_u8, arg_u8x8, 0);
vset_lane_u8(arg_u8, arg_u8x8, 7);
vset_lane_u8(arg_u8, arg_u8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_u8(arg_u8, arg_u8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_set_vector_lane_u16(uint16x4_t arg_u16x4, uint16_t arg_u16, uint16x8_t arg_u16x8) {
vset_lane_u16(arg_u16, arg_u16x4, 0);
vset_lane_u16(arg_u16, arg_u16x4, 3);
vset_lane_u16(arg_u16, arg_u16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_u16(arg_u16, arg_u16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_set_vector_lane_u32(uint32x2_t arg_u32x2, uint32x4_t arg_u32x4, uint32_t arg_u32) {
vset_lane_u32(arg_u32, arg_u32x2, 0);
vset_lane_u32(arg_u32, arg_u32x2, 1);
vset_lane_u32(arg_u32, arg_u32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_u32(arg_u32, arg_u32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_set_vector_lane_u64(uint64x2_t arg_u64x2, uint64x1_t arg_u64x1, uint64_t arg_u64) {
vset_lane_u64(arg_u64, arg_u64x1, 0);
vset_lane_u64(arg_u64, arg_u64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_u64(arg_u64, arg_u64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_set_vector_lane_p64(poly64_t arg_p64, poly64x1_t arg_p64x1, poly64x2_t arg_p64x2) {
vset_lane_p64(arg_p64, arg_p64x1, 0);
vset_lane_p64(arg_p64, arg_p64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_p64(arg_p64, arg_p64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_p64(arg_p64, arg_p64x2, 0);
vsetq_lane_p64(arg_p64, arg_p64x2, 1);
vsetq_lane_p64(arg_p64, arg_p64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_p64(arg_p64, arg_p64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_s8(int8x16_t arg_i8x16, int8x8_t arg_i8x8, int8_t arg_i8) {
vset_lane_s8(arg_i8, arg_i8x8, 0);
vset_lane_s8(arg_i8, arg_i8x8, 7);
vset_lane_s8(arg_i8, arg_i8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_s8(arg_i8, arg_i8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_s8(arg_i8, arg_i8x16, 0);
vsetq_lane_s8(arg_i8, arg_i8x16, 15);
vsetq_lane_s8(arg_i8, arg_i8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_s8(arg_i8, arg_i8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_s16(int16x4_t arg_i16x4, int16_t arg_i16, int16x8_t arg_i16x8) {
vset_lane_s16(arg_i16, arg_i16x4, 0);
vset_lane_s16(arg_i16, arg_i16x4, 3);
vset_lane_s16(arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_s16(arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_s16(arg_i16, arg_i16x8, 0);
vsetq_lane_s16(arg_i16, arg_i16x8, 7);
vsetq_lane_s16(arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_s16(arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_s32(int32_t arg_i32, int32x2_t arg_i32x2, int32x4_t arg_i32x4) {
vset_lane_s32(arg_i32, arg_i32x2, 0);
vset_lane_s32(arg_i32, arg_i32x2, 1);
vset_lane_s32(arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_s32(arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_s32(arg_i32, arg_i32x4, 0);
vsetq_lane_s32(arg_i32, arg_i32x4, 3);
vsetq_lane_s32(arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_s32(arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_s64(int64_t arg_i64, int64x2_t arg_i64x2, int64x1_t arg_i64x1) {
vset_lane_s64(arg_i64, arg_i64x1, 0);
vset_lane_s64(arg_i64, arg_i64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_s64(arg_i64, arg_i64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_s64(arg_i64, arg_i64x2, 0);
vsetq_lane_s64(arg_i64, arg_i64x2, 1);
vsetq_lane_s64(arg_i64, arg_i64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_s64(arg_i64, arg_i64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_p8(poly8_t arg_p8, poly8x16_t arg_p8x16, poly8x8_t arg_p8x8) {
vset_lane_p8(arg_p8, arg_p8x8, 0);
vset_lane_p8(arg_p8, arg_p8x8, 7);
vset_lane_p8(arg_p8, arg_p8x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_p8(arg_p8, arg_p8x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_p8(arg_p8, arg_p8x16, 0);
vsetq_lane_p8(arg_p8, arg_p8x16, 15);
vsetq_lane_p8(arg_p8, arg_p8x16, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_p8(arg_p8, arg_p8x16, 16); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_p16(poly16x4_t arg_p16x4, poly16_t arg_p16, poly16x8_t arg_p16x8) {
vset_lane_p16(arg_p16, arg_p16x4, 0);
vset_lane_p16(arg_p16, arg_p16x4, 3);
vset_lane_p16(arg_p16, arg_p16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_p16(arg_p16, arg_p16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_p16(arg_p16, arg_p16x8, 0);
vsetq_lane_p16(arg_p16, arg_p16x8, 7);
vsetq_lane_p16(arg_p16, arg_p16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_p16(arg_p16, arg_p16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_f16(float16x8_t arg_f16x8, float16x4_t arg_f16x4, float16_t arg_f16) {
vset_lane_f16(arg_f16, arg_f16x4, 0);
vset_lane_f16(arg_f16, arg_f16x4, 3);
vset_lane_f16(arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_f16(arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_f16(arg_f16, arg_f16x8, 0);
vsetq_lane_f16(arg_f16, arg_f16x8, 7);
vsetq_lane_f16(arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_f16(arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_f32(float32x2_t arg_f32x2, float32x4_t arg_f32x4, float32_t arg_f32) {
vset_lane_f32(arg_f32, arg_f32x2, 0);
vset_lane_f32(arg_f32, arg_f32x2, 1);
vset_lane_f32(arg_f32, arg_f32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_f32(arg_f32, arg_f32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_f32(arg_f32, arg_f32x4, 0);
vsetq_lane_f32(arg_f32, arg_f32x4, 3);
vsetq_lane_f32(arg_f32, arg_f32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_f32(arg_f32, arg_f32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_set_vector_lane_f64(float64x1_t arg_f64x1, float64x2_t arg_f64x2, float64_t arg_f64) {
vset_lane_f64(arg_f64, arg_f64x1, 0);
vset_lane_f64(arg_f64, arg_f64x1, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vset_lane_f64(arg_f64, arg_f64x1, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vsetq_lane_f64(arg_f64, arg_f64x2, 0);
vsetq_lane_f64(arg_f64, arg_f64x2, 1);
vsetq_lane_f64(arg_f64, arg_f64x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vsetq_lane_f64(arg_f64, arg_f64x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

130 changes: 130 additions & 0 deletions clang/test/Sema/aarch64-neon-immediate-ranges/sqrdmlah-ranges.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +v8.1a -ffreestanding -fsyntax-only -verify %s

#include <arm_neon.h>
// REQUIRES: aarch64-registered-target

void test_saturating_multiply_accumulate_by_element_s16(int16x8_t arg_i16x8, int16_t arg_i16, int16x4_t arg_i16x4) {
vqrdmlah_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, 0);
vqrdmlah_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, 3);
vqrdmlah_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlah_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, 0);
vqrdmlahq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, 3);
vqrdmlahq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlah_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, 0);
vqrdmlah_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, 7);
vqrdmlah_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlah_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, 0);
vqrdmlahq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, 7);
vqrdmlahq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlsh_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, 0);
vqrdmlsh_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, 3);
vqrdmlsh_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlsh_lane_s16(arg_i16x4, arg_i16x4, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, 0);
vqrdmlshq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, 3);
vqrdmlshq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshq_lane_s16(arg_i16x8, arg_i16x8, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlsh_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, 0);
vqrdmlsh_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, 7);
vqrdmlsh_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlsh_laneq_s16(arg_i16x4, arg_i16x4, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, 0);
vqrdmlshq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, 7);
vqrdmlshq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshq_laneq_s16(arg_i16x8, arg_i16x8, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahh_lane_s16(arg_i16, arg_i16, arg_i16x4, 0);
vqrdmlahh_lane_s16(arg_i16, arg_i16, arg_i16x4, 3);
vqrdmlahh_lane_s16(arg_i16, arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahh_lane_s16(arg_i16, arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahh_laneq_s16(arg_i16, arg_i16, arg_i16x8, 0);
vqrdmlahh_laneq_s16(arg_i16, arg_i16, arg_i16x8, 7);
vqrdmlahh_laneq_s16(arg_i16, arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahh_laneq_s16(arg_i16, arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshh_lane_s16(arg_i16, arg_i16, arg_i16x4, 0);
vqrdmlshh_lane_s16(arg_i16, arg_i16, arg_i16x4, 3);
vqrdmlshh_lane_s16(arg_i16, arg_i16, arg_i16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshh_lane_s16(arg_i16, arg_i16, arg_i16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshh_laneq_s16(arg_i16, arg_i16, arg_i16x8, 0);
vqrdmlshh_laneq_s16(arg_i16, arg_i16, arg_i16x8, 7);
vqrdmlshh_laneq_s16(arg_i16, arg_i16, arg_i16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshh_laneq_s16(arg_i16, arg_i16, arg_i16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}

void test_saturating_multiply_accumulate_by_element_s32(int32x2_t arg_i32x2, int32x4_t arg_i32x4, int32_t arg_i32) {
vqrdmlah_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, 0);
vqrdmlah_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, 1);
vqrdmlah_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlah_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, 0);
vqrdmlahq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, 1);
vqrdmlahq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlah_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, 0);
vqrdmlah_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, 3);
vqrdmlah_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlah_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, 0);
vqrdmlahq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, 3);
vqrdmlahq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlsh_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, 0);
vqrdmlsh_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, 1);
vqrdmlsh_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlsh_lane_s32(arg_i32x2, arg_i32x2, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, 0);
vqrdmlshq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, 1);
vqrdmlshq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshq_lane_s32(arg_i32x4, arg_i32x4, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlsh_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, 0);
vqrdmlsh_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, 3);
vqrdmlsh_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlsh_laneq_s32(arg_i32x2, arg_i32x2, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, 0);
vqrdmlshq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, 3);
vqrdmlshq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshq_laneq_s32(arg_i32x4, arg_i32x4, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahs_lane_s32(arg_i32, arg_i32, arg_i32x2, 0);
vqrdmlahs_lane_s32(arg_i32, arg_i32, arg_i32x2, 1);
vqrdmlahs_lane_s32(arg_i32, arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahs_lane_s32(arg_i32, arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlahs_laneq_s32(arg_i32, arg_i32, arg_i32x4, 0);
vqrdmlahs_laneq_s32(arg_i32, arg_i32, arg_i32x4, 3);
vqrdmlahs_laneq_s32(arg_i32, arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlahs_laneq_s32(arg_i32, arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshs_lane_s32(arg_i32, arg_i32, arg_i32x2, 0);
vqrdmlshs_lane_s32(arg_i32, arg_i32, arg_i32x2, 1);
vqrdmlshs_lane_s32(arg_i32, arg_i32, arg_i32x2, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshs_lane_s32(arg_i32, arg_i32, arg_i32x2, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}

vqrdmlshs_laneq_s32(arg_i32, arg_i32, arg_i32x4, 0);
vqrdmlshs_laneq_s32(arg_i32, arg_i32, arg_i32x4, 3);
vqrdmlshs_laneq_s32(arg_i32, arg_i32, arg_i32x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vqrdmlshs_laneq_s32(arg_i32, arg_i32, arg_i32x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}

}
203 changes: 203 additions & 0 deletions clang/test/Sema/aarch64-neon-immediate-ranges/vcmla.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +v8.3a -ffreestanding -fsyntax-only -verify %s
// REQUIRES: aarch64-registered-target

#include <arm_neon.h>
#include <arm_fp16.h>

void test_vcmla_lane_f16(float16x4_t a, float16x4_t b, float16x4_t c){
vcmla_lane_f16(a, b, c, 0);
vcmla_lane_f16(a, b, c, 1);

vcmla_lane_f16(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_lane_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_laneq_f16(float16x4_t a, float16x4_t b, float16x8_t c){
vcmla_laneq_f16(a, b, c, 0);
vcmla_laneq_f16(a, b, c, 1);
vcmla_laneq_f16(a, b, c, 3);

vcmla_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_lane_f16(float16x8_t a, float16x8_t b, float16x4_t c){
vcmlaq_lane_f16(a, b, c, 0);
vcmlaq_lane_f16(a, b, c, 1);

vcmlaq_lane_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_lane_f16(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_laneq_f16(float16x8_t a, float16x8_t b, float16x8_t c){
vcmlaq_laneq_f16(a, b, c, 0);
vcmlaq_laneq_f16(a, b, c, 1);
vcmlaq_laneq_f16(a, b, c, 3);

vcmlaq_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_lane_f32(float32x2_t a, float32x2_t b, float32x2_t c){
vcmla_lane_f32(a, b, c, 0);

vcmla_lane_f32(a, b, c, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_lane_f32(a, b, c, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_lane_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t c){
vcmla_laneq_f32(a, b, c, 0);

vcmla_laneq_f32(a, b, c, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_laneq_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t c){
vcmlaq_laneq_f32(a, b, c, 0);
vcmlaq_laneq_f32(a, b, c, 1);

vcmlaq_laneq_f32(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_laneq_f32(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot90_lane_f16(float16x4_t a, float16x4_t b, float16x4_t c){
vcmla_rot90_lane_f16(a, b, c, 0);
vcmla_rot90_lane_f16(a, b, c, 1);

vcmla_rot90_lane_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_rot90_lane_f16(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot90_laneq_f16(float16x4_t a, float16x4_t b, float16x8_t c){
vcmla_rot90_laneq_f16(a, b, c, 0);
vcmla_rot90_laneq_f16(a, b, c, 3);

vcmla_rot90_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_rot90_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_rot90_laneq_f16(float16x8_t a, float16x8_t b, float16x8_t c){
vcmlaq_rot90_laneq_f16(a, b, c, 0);
vcmlaq_rot90_laneq_f16(a, b, c, 3);

vcmlaq_rot90_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_rot90_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot180_lane_f16(float16x4_t a, float16x4_t b, float16x4_t c){
vcmla_rot180_lane_f16(a, b, c, 0);
vcmla_rot180_lane_f16(a, b, c, 1);

vcmla_rot180_lane_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_rot180_lane_f16(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot180_laneq_f16(float16x4_t a, float16x4_t b, float16x8_t c){
vcmla_rot180_laneq_f16(a, b, c, 0);
vcmla_rot180_laneq_f16(a, b, c, 3);

vcmla_rot180_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_rot180_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_rot180_laneq_f16(float16x8_t a, float16x8_t b, float16x8_t c){
vcmlaq_rot180_laneq_f16(a, b, c, 0);
vcmlaq_rot180_laneq_f16(a, b, c, 3);

vcmlaq_rot180_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_rot180_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot270_lane_f16(float16x4_t a, float16x4_t b, float16x4_t c){
vcmla_rot270_lane_f16(a, b, c, 0);
vcmla_rot270_lane_f16(a, b, c, 1);

vcmla_rot270_lane_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_rot270_lane_f16(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot270_laneq_f16(float16x4_t a, float16x4_t b, float16x8_t c){
vcmla_rot270_laneq_f16(a, b, c, 0);
vcmla_rot270_laneq_f16(a, b, c, 3);

vcmla_rot270_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmla_rot270_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_rot270_laneq_f16(float16x8_t a, float16x8_t b, float16x8_t c){
vcmlaq_rot270_laneq_f16(a, b, c, 0);
vcmlaq_rot270_laneq_f16(a, b, c, 3);

vcmlaq_rot270_laneq_f16(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_rot270_laneq_f16(a, b, c, 4); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot90_lane_f32(float32x2_t a, float32x2_t b, float32x2_t c){
vcmla_rot90_lane_f32(a, b, c, 0);

vcmla_rot90_lane_f32(a, b, c, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_rot90_lane_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot90_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t c){
vcmla_rot90_laneq_f32(a, b, c, 0);
vcmla_rot90_laneq_f32(a, b, c, 1);

vcmla_rot90_laneq_f32(a, b, c, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_rot90_laneq_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_rot90_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t c){
vcmlaq_rot90_laneq_f32(a, b, c, 0);
vcmlaq_rot90_laneq_f32(a, b, c, 1);

vcmlaq_rot90_laneq_f32(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_rot90_laneq_f32(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot180_lane_f32(float32x2_t a, float32x2_t b, float32x2_t c){
vcmla_rot180_lane_f32(a, b, c, 0);

vcmla_rot180_lane_f32(a, b, c, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_rot180_lane_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot180_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t c){
vcmla_rot180_laneq_f32(a, b, c, 0);
vcmla_rot180_laneq_f32(a, b, c, 1);

vcmla_rot180_laneq_f32(a, b, c, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_rot180_laneq_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_rot180_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t c){
vcmlaq_rot90_laneq_f32(a, b, c, 0);
vcmlaq_rot90_laneq_f32(a, b, c, 1);

vcmlaq_rot90_laneq_f32(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_rot90_laneq_f32(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot270_lane_f32(float32x2_t a, float32x2_t b, float32x2_t c){
vcmla_rot270_lane_f32(a, b, c, 0);

vcmla_rot270_lane_f32(a, b, c, 1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_rot270_lane_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmla_rot270_laneq_f32(float32x2_t a, float32x2_t b, float32x4_t c){
vcmla_rot270_laneq_f32(a, b, c, 0);
vcmla_rot270_laneq_f32(a, b, c, 1);

vcmla_rot270_laneq_f32(a, b, c, 2); // expected-error-re {{argument value {{.*}} is outside the valid range}}
vcmla_rot270_laneq_f32(a, b, c, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
}

void test_vcmlaq_rot270_laneq_f32(float32x4_t a, float32x4_t b, float32x4_t c){
vcmlaq_rot270_laneq_f32(a, b, c, 0);
vcmlaq_rot270_laneq_f32(a, b, c, 1);

vcmlaq_rot270_laneq_f32(a, b, c, 2); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
vcmlaq_rot270_laneq_f32(a, b, c, -1); // expected-error-re +{{argument value {{.*}} is outside the valid range}}
}
Loading