182 lines · c
1// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +v8.2a -ffreestanding -fsyntax-only -verify %s2 3#include <arm_neon.h>4#include <arm_fp16.h>5// REQUIRES: aarch64-registered-target6 7// vcvtq_n_f16_u16 is tested under clang/test/Sema/arm-mve-immediates.c8 9void test_multiplication_f16(float16_t arg_f16, float16x8_t arg_f16x8, float16x4_t arg_f16x4) {10 vmul_lane_f16(arg_f16x4, arg_f16x4, 0);11 vmul_lane_f16(arg_f16x4, arg_f16x4, 3);12 vmul_lane_f16(arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}13 vmul_lane_f16(arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}14 15 vmulq_lane_f16(arg_f16x8, arg_f16x4, 0);16 vmulq_lane_f16(arg_f16x8, arg_f16x4, 3);17 vmulq_lane_f16(arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}18 vmulq_lane_f16(arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}19 20 vmul_laneq_f16(arg_f16x4, arg_f16x8, 0);21 vmul_laneq_f16(arg_f16x4, arg_f16x8, 7);22 vmul_laneq_f16(arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}23 vmul_laneq_f16(arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}24 25 vmulq_laneq_f16(arg_f16x8, arg_f16x8, 0);26 vmulq_laneq_f16(arg_f16x8, arg_f16x8, 7);27 vmulq_laneq_f16(arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}28 vmulq_laneq_f16(arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}29 30 vmulh_lane_f16(arg_f16, arg_f16x4, 0);31 vmulh_lane_f16(arg_f16, arg_f16x4, 3);32 vmulh_lane_f16(arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}33 vmulh_lane_f16(arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}34 35 vmulh_laneq_f16(arg_f16, arg_f16x8, 0);36 vmulh_laneq_f16(arg_f16, arg_f16x8, 7);37 vmulh_laneq_f16(arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}38 vmulh_laneq_f16(arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}39 40}41 42void test_multiply_extended_f16(float16_t arg_f16, float16x8_t arg_f16x8, float16x4_t arg_f16x4) {43 vmulx_lane_f16(arg_f16x4, arg_f16x4, 0);44 vmulx_lane_f16(arg_f16x4, arg_f16x4, 3);45 vmulx_lane_f16(arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}46 vmulx_lane_f16(arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}47 48 vmulxq_lane_f16(arg_f16x8, arg_f16x4, 0);49 vmulxq_lane_f16(arg_f16x8, arg_f16x4, 3);50 vmulxq_lane_f16(arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}51 vmulxq_lane_f16(arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}52 53 vmulx_laneq_f16(arg_f16x4, arg_f16x8, 0);54 vmulx_laneq_f16(arg_f16x4, arg_f16x8, 7);55 vmulx_laneq_f16(arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}56 vmulx_laneq_f16(arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}57 58 vmulxq_laneq_f16(arg_f16x8, arg_f16x8, 0);59 vmulxq_laneq_f16(arg_f16x8, arg_f16x8, 7);60 vmulxq_laneq_f16(arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}61 vmulxq_laneq_f16(arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}62 63 vmulxh_lane_f16(arg_f16, arg_f16x4, 0);64 vmulxh_lane_f16(arg_f16, arg_f16x4, 3);65 vmulxh_lane_f16(arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}66 vmulxh_lane_f16(arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}67 68 vmulxh_laneq_f16(arg_f16, arg_f16x8, 0);69 vmulxh_laneq_f16(arg_f16, arg_f16x8, 7);70 vmulxh_laneq_f16(arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}71 vmulxh_laneq_f16(arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}72 73}74 75void test_fused_multiply_accumulate_f16(float16_t arg_f16, float16x8_t arg_f16x8, float16x4_t arg_f16x4) {76 vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 0);77 vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 3);78 vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}79 vfma_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}80 81 vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 0);82 vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 3);83 vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}84 vfmaq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}85 86 vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 0);87 vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 7);88 vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}89 vfma_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}90 91 vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 0);92 vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 7);93 vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}94 vfmaq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}95 96 vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, 0);97 vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, 3);98 vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}99 vfmah_lane_f16(arg_f16, arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}100 101 vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, 0);102 vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, 7);103 vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}104 vfmah_laneq_f16(arg_f16, arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}105 106 vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 0);107 vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 3);108 vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}109 vfms_lane_f16(arg_f16x4, arg_f16x4, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}110 111 vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 0);112 vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 3);113 vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}114 vfmsq_lane_f16(arg_f16x8, arg_f16x8, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}115 116 vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 0);117 vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 7);118 vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}119 vfms_laneq_f16(arg_f16x4, arg_f16x4, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}120 121 vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 0);122 vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 7);123 vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}124 vfmsq_laneq_f16(arg_f16x8, arg_f16x8, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}125 126 vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, 0);127 vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, 3);128 vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}129 vfmsh_lane_f16(arg_f16, arg_f16, arg_f16x4, 4); // expected-error-re {{argument value {{.*}} is outside the valid range}}130 131 vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, 0);132 vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, 7);133 vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}}134 vfmsh_laneq_f16(arg_f16, arg_f16, arg_f16x8, 8); // expected-error-re {{argument value {{.*}} is outside the valid range}}135 136}137 138void test_conversions_s16(int16x8_t arg_i16x8, int16x4_t arg_i16x4) {139 vcvt_n_f16_s16(arg_i16x4, 1);140 vcvt_n_f16_s16(arg_i16x4, 16);141 vcvt_n_f16_s16(arg_i16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}142 vcvt_n_f16_s16(arg_i16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}143 144 vcvtq_n_f16_s16(arg_i16x8, 1);145 vcvtq_n_f16_s16(arg_i16x8, 16);146 vcvtq_n_f16_s16(arg_i16x8, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}147 vcvtq_n_f16_s16(arg_i16x8, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}148 149}150 151void test_conversions_u16(uint16x8_t arg_u16x8, uint16x4_t arg_u16x4) {152 vcvt_n_f16_u16(arg_u16x4, 1);153 vcvt_n_f16_u16(arg_u16x4, 16);154 vcvt_n_f16_u16(arg_u16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}155 vcvt_n_f16_u16(arg_u16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}156 157}158 159void test_conversions_f16(float16x8_t arg_f16x8, float16x4_t arg_f16x4) {160 vcvt_n_s16_f16(arg_f16x4, 1);161 vcvt_n_s16_f16(arg_f16x4, 16);162 vcvt_n_s16_f16(arg_f16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}163 vcvt_n_s16_f16(arg_f16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}164 165 vcvtq_n_s16_f16(arg_f16x8, 1);166 vcvtq_n_s16_f16(arg_f16x8, 16);167 vcvtq_n_s16_f16(arg_f16x8, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}168 vcvtq_n_s16_f16(arg_f16x8, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}169 170 vcvt_n_u16_f16(arg_f16x4, 1);171 vcvt_n_u16_f16(arg_f16x4, 16);172 vcvt_n_u16_f16(arg_f16x4, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}173 vcvt_n_u16_f16(arg_f16x4, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}174 175 vcvtq_n_u16_f16(arg_f16x8, 1);176 vcvtq_n_u16_f16(arg_f16x8, 16);177 vcvtq_n_u16_f16(arg_f16x8, 0); // expected-error-re {{argument value {{.*}} is outside the valid range}}178 vcvtq_n_u16_f16(arg_f16x8, 17); // expected-error-re {{argument value {{.*}} is outside the valid range}}179 180}181 182