// REQUIRES: arm-registered-target // RUN: %clang_cc1 -S -emit-llvm -triple armv7a-apple-darwin %s -o /dev/null typedef unsigned short uint16_t; typedef __attribute__((neon_vector_type(8))) uint16_t uint16x8_t; void b(uint16x8_t sat, uint16x8_t luma) { __asm__("vmov.16 %1, %0 \n\t" "vtrn.16 %0, %1 \n\t" :"=w"(luma), "=w"(sat) :"0"(luma) ); }
// REQUIRES: arm-registered-target // RUN: %clang_cc1 -triple armv7 %s -emit-llvm -o /dev/null // <rdar://problem/12284092> typedef __attribute__((neon_vector_type(2))) long long int64x2_t; typedef struct int64x2x4_t { int64x2_t val[4]; } int64x2x4_t; int64x2x4_t t2(const long long a[]) { int64x2x4_t r; __asm__("vldm %[a], { %q[r0], %q[r1], %q[r2], %q[r3] }" : [r0] "=r"(r.val[0]), // expected-warning {{the size being stored is truncated, use a modifier to specify the size}} [r1] "=r"(r.val[1]), // expected-warning {{the size being stored is truncated, use a modifier to specify the size}} [r2] "=r"(r.val[2]), // expected-warning {{the size being stored is truncated, use a modifier to specify the size}} [r3] "=r"(r.val[3]) // expected-warning {{the size being stored is truncated, use a modifier to specify the size}} : [a] "r"(a)); return r; }
// RUN: %clang_cc1 %s -fsyntax-only -verify typedef float float32_t; typedef signed char poly8_t; typedef short poly16_t; typedef unsigned long long uint64_t; // Define some valid Neon types. typedef __attribute__((neon_vector_type(2))) int int32x2_t; typedef __attribute__((neon_vector_type(4))) int int32x4_t; typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t; typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t; typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t; typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t; typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t; typedef __attribute__((neon_polyvector_type(8))) poly16_t poly16x8_t; // The attributes must have a single argument. typedef __attribute__((neon_vector_type(2, 4))) int only_one_arg; // expected-error{{attribute requires 1 argument(s)}} // The number of elements must be an ICE. typedef __attribute__((neon_vector_type(2.0))) int non_int_width; // expected-error{{attribute requires integer constant}} // Only certain element types are allowed. typedef __attribute__((neon_vector_type(2))) double double_elt; // expected-error{{invalid vector element type}} typedef __attribute__((neon_vector_type(4))) void* ptr_elt; // expected-error{{invalid vector element type}} typedef __attribute__((neon_polyvector_type(4))) float32_t bad_poly_elt; // expected-error{{invalid vector element type}} struct aggr { signed char c; }; typedef __attribute__((neon_vector_type(8))) struct aggr aggregate_elt; // expected-error{{invalid vector element type}} // The total vector size must be 64 or 128 bits.
// REQUIRES: arm64-registered-target // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon %s -emit-llvm -o - | FileCheck %s typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef signed char int8_t; typedef signed short int16_t; typedef signed long int64_t; typedef unsigned long uint64_t; typedef unsigned char poly8_t; typedef unsigned short poly16_t; typedef __fp16 float16_t; typedef float float32_t; typedef double float64_t; typedef __attribute__((neon_vector_type(8))) int8_t int8x8_t; typedef __attribute__((neon_vector_type(16))) int8_t int8x16_t; typedef __attribute__((neon_vector_type(4))) int16_t int16x4_t; typedef __attribute__((neon_vector_type(8))) int16_t int16x8_t; typedef __attribute__((neon_vector_type(2))) int int32x2_t; typedef __attribute__((neon_vector_type(4))) int int32x4_t; typedef __attribute__((neon_vector_type(2))) int64_t int64x2_t; typedef __attribute__((neon_vector_type(8))) uint8_t uint8x8_t; typedef __attribute__((neon_vector_type(16))) uint8_t uint8x16_t; typedef __attribute__((neon_vector_type(4))) uint16_t uint16x4_t; typedef __attribute__((neon_vector_type(8))) uint16_t uint16x8_t; typedef __attribute__((neon_vector_type(2))) unsigned int uint32x2_t; typedef __attribute__((neon_vector_type(4))) unsigned int uint32x4_t; typedef __attribute__((neon_vector_type(2))) uint64_t uint64x2_t; typedef __attribute__((neon_vector_type(4))) float16_t float16x4_t; typedef __attribute__((neon_vector_type(8))) float16_t float16x8_t;
// RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs \ // RUN: -mfloat-abi soft -target-feature +neon -emit-llvm -o - -O1 %s \ // RUN: | FileCheck %s --check-prefix=CHECK-SOFT // RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs \ // RUN: -mfloat-abi hard -target-feature +neon -emit-llvm -o - -O1 %s \ // RUN: | FileCheck %s --check-prefix=CHECK-HARD // RUN: %clang_cc1 -triple armv7a--none-eabi -target-abi aapcs \ // RUN: -mfloat-abi hard -target-feature +neon -target-feature +fullfp16 \ // RUN: -emit-llvm -o - -O1 %s \ // RUN: | FileCheck %s --check-prefix=CHECK-FULL typedef __attribute__((neon_vector_type(4))) __fp16 float16x4_t; typedef __attribute__((neon_vector_type(8))) __fp16 float16x8_t; typedef struct { float16x4_t x[2]; } hfa_t; // CHECK-FULL: %struct.hfa_t = type { [2 x <4 x half>] } float16x4_t g4; float16x8_t g8; void st4(float16x4_t a) { g4 = a; } // CHECK-SOFT: define void @st4(<2 x i32> %a.coerce) // CHECK-SOFT: store <2 x i32> %a.coerce, <2 x i32>* bitcast (<4 x half>* @g4 to <2 x i32>*) // // CHECK-HARD: define arm_aapcs_vfpcc void @st4(<2 x i32> %a.coerce) // CHECK-HARD: store <2 x i32> %a.coerce, <2 x i32>* bitcast (<4 x half>* @g4 to <2 x i32>*) // // CHECK-FULL: define arm_aapcs_vfpcc void @st4(<4 x half> %a) // CHECK-FULL: store <4 x half> %a, <4 x half>* @g4 float16x4_t ld4(void) { return g4; }