[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
[llvm-project.git] / clang / test / CodeGen / arm-neon-vget.c
blob5bd4d245d8d3b1b67e859c5a5496149d57c4b7c2
1 // RUN: %clang_cc1 -triple thumbv7-apple-darwin \
2 // RUN: -target-abi apcs-gnu \
3 // RUN: -target-cpu cortex-a8 \
4 // RUN: -mfloat-abi soft \
5 // RUN: -target-feature +soft-float-abi \
6 // RUN: -ffreestanding \
7 // RUN: -disable-O0-optnone -emit-llvm -w -o - %s | opt -S -passes=mem2reg | FileCheck %s
9 // REQUIRES: aarch64-registered-target || arm-registered-target
11 #include <arm_neon.h>
13 // Check that the vget_low/vget_high intrinsics generate a single shuffle
14 // without any bitcasting.
15 int8x8_t low_s8(int8x16_t a) {
16 // CHECK: shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
17 return vget_low_s8(a);
20 uint8x8_t low_u8 (uint8x16_t a) {
21 // CHECK: shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
22 return vget_low_u8(a);
25 int16x4_t low_s16( int16x8_t a) {
26 // CHECK: shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
27 return vget_low_s16(a);
30 uint16x4_t low_u16(uint16x8_t a) {
31 // CHECK: shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
32 return vget_low_u16(a);
35 int32x2_t low_s32( int32x4_t a) {
36 // CHECK: shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 0, i32 1>
37 return vget_low_s32(a);
40 uint32x2_t low_u32(uint32x4_t a) {
41 // CHECK: shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 0, i32 1>
42 return vget_low_u32(a);
45 int64x1_t low_s64( int64x2_t a) {
46 // CHECK: shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> zeroinitializer
47 return vget_low_s64(a);
50 uint64x1_t low_u64(uint64x2_t a) {
51 // CHECK: shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> zeroinitializer
52 return vget_low_u64(a);
55 poly8x8_t low_p8 (poly8x16_t a) {
56 // CHECK: shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
57 return vget_low_p8(a);
60 poly16x4_t low_p16(poly16x8_t a) {
61 // CHECK: shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
62 return vget_low_p16(a);
65 float32x2_t low_f32(float32x4_t a) {
66 // CHECK: shufflevector <4 x float> %a, <4 x float> %a, <2 x i32> <i32 0, i32 1>
67 return vget_low_f32(a);
71 int8x8_t high_s8(int8x16_t a) {
72 // CHECK: shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
73 return vget_high_s8(a);
76 uint8x8_t high_u8 (uint8x16_t a) {
77 // CHECK: shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
78 return vget_high_u8(a);
81 int16x4_t high_s16( int16x8_t a) {
82 // CHECK: shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
83 return vget_high_s16(a);
86 uint16x4_t high_u16(uint16x8_t a) {
87 // CHECK: shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
88 return vget_high_u16(a);
91 int32x2_t high_s32( int32x4_t a) {
92 // CHECK: shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 2, i32 3>
93 return vget_high_s32(a);
96 uint32x2_t high_u32(uint32x4_t a) {
97 // CHECK: shufflevector <4 x i32> %a, <4 x i32> %a, <2 x i32> <i32 2, i32 3>
98 return vget_high_u32(a);
101 int64x1_t high_s64( int64x2_t a) {
102 // CHECK: shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> <i32 1>
103 return vget_high_s64(a);
106 uint64x1_t high_u64(uint64x2_t a) {
107 // CHECK: shufflevector <2 x i64> %a, <2 x i64> %a, <1 x i32> <i32 1>
108 return vget_high_u64(a);
111 poly8x8_t high_p8 (poly8x16_t a) {
112 // CHECK: shufflevector <16 x i8> %a, <16 x i8> %a, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
113 return vget_high_p8(a);
116 poly16x4_t high_p16(poly16x8_t a) {
117 // CHECK: shufflevector <8 x i16> %a, <8 x i16> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
118 return vget_high_p16(a);
121 float32x2_t high_f32(float32x4_t a) {
122 // CHECK: shufflevector <4 x float> %a, <4 x float> %a, <2 x i32> <i32 2, i32 3>
123 return vget_high_f32(a);