blob: 0e541bbb5aee7a3d47405eec84b19c20ac58de40 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
Bob Wilson9b600c62009-08-06 00:38:31 +00002
Bob Wilsonec1d81c2009-10-06 21:16:19 +00003%struct.__neon_int8x8x3_t = type { <8 x i8>, <8 x i8>, <8 x i8> }
4%struct.__neon_int16x4x3_t = type { <4 x i16>, <4 x i16>, <4 x i16> }
5%struct.__neon_int32x2x3_t = type { <2 x i32>, <2 x i32>, <2 x i32> }
6%struct.__neon_float32x2x3_t = type { <2 x float>, <2 x float>, <2 x float> }
Bob Wilsonc67160c2009-10-07 23:39:57 +00007%struct.__neon_int64x1x3_t = type { <1 x i64>, <1 x i64>, <1 x i64> }
Bob Wilson9b600c62009-08-06 00:38:31 +00008
Bob Wilsonff8952e2009-10-07 17:24:55 +00009%struct.__neon_int8x16x3_t = type { <16 x i8>, <16 x i8>, <16 x i8> }
10%struct.__neon_int16x8x3_t = type { <8 x i16>, <8 x i16>, <8 x i16> }
11%struct.__neon_int32x4x3_t = type { <4 x i32>, <4 x i32>, <4 x i32> }
12%struct.__neon_float32x4x3_t = type { <4 x float>, <4 x float>, <4 x float> }
13
Bob Wilson9b600c62009-08-06 00:38:31 +000014define <8 x i8> @vld3i8(i8* %A) nounwind {
15;CHECK: vld3i8:
Bob Wilson40ff01a2010-09-23 21:43:54 +000016;Check the alignment value. Max for this instruction is 64 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000017;CHECK: vld3.8 {d16, d17, d18}, [r0, :64]
Bob Wilson40ff01a2010-09-23 21:43:54 +000018 %tmp1 = call %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8* %A, i32 32)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000019 %tmp2 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 0
20 %tmp3 = extractvalue %struct.__neon_int8x8x3_t %tmp1, 2
Bob Wilson9b600c62009-08-06 00:38:31 +000021 %tmp4 = add <8 x i8> %tmp2, %tmp3
22 ret <8 x i8> %tmp4
23}
24
25define <4 x i16> @vld3i16(i16* %A) nounwind {
26;CHECK: vld3i16:
27;CHECK: vld3.16
Bob Wilson02170c02010-04-20 00:17:16 +000028 %tmp0 = bitcast i16* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000029 %tmp1 = call %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3.v4i16(i8* %tmp0, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000030 %tmp2 = extractvalue %struct.__neon_int16x4x3_t %tmp1, 0
31 %tmp3 = extractvalue %struct.__neon_int16x4x3_t %tmp1, 2
Bob Wilson9b600c62009-08-06 00:38:31 +000032 %tmp4 = add <4 x i16> %tmp2, %tmp3
33 ret <4 x i16> %tmp4
34}
35
36define <2 x i32> @vld3i32(i32* %A) nounwind {
37;CHECK: vld3i32:
38;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +000039 %tmp0 = bitcast i32* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000040 %tmp1 = call %struct.__neon_int32x2x3_t @llvm.arm.neon.vld3.v2i32(i8* %tmp0, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000041 %tmp2 = extractvalue %struct.__neon_int32x2x3_t %tmp1, 0
42 %tmp3 = extractvalue %struct.__neon_int32x2x3_t %tmp1, 2
Bob Wilson9b600c62009-08-06 00:38:31 +000043 %tmp4 = add <2 x i32> %tmp2, %tmp3
44 ret <2 x i32> %tmp4
45}
46
47define <2 x float> @vld3f(float* %A) nounwind {
48;CHECK: vld3f:
49;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +000050 %tmp0 = bitcast float* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000051 %tmp1 = call %struct.__neon_float32x2x3_t @llvm.arm.neon.vld3.v2f32(i8* %tmp0, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000052 %tmp2 = extractvalue %struct.__neon_float32x2x3_t %tmp1, 0
53 %tmp3 = extractvalue %struct.__neon_float32x2x3_t %tmp1, 2
Dan Gohmand4d01152010-05-03 22:36:46 +000054 %tmp4 = fadd <2 x float> %tmp2, %tmp3
Bob Wilson9b600c62009-08-06 00:38:31 +000055 ret <2 x float> %tmp4
56}
57
Bob Wilsonc67160c2009-10-07 23:39:57 +000058define <1 x i64> @vld3i64(i64* %A) nounwind {
59;CHECK: vld3i64:
Bob Wilson40ff01a2010-09-23 21:43:54 +000060;Check the alignment value. Max for this instruction is 64 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000061;CHECK: vld1.64 {d16, d17, d18}, [r0, :64]
Bob Wilson02170c02010-04-20 00:17:16 +000062 %tmp0 = bitcast i64* %A to i8*
Bob Wilson40ff01a2010-09-23 21:43:54 +000063 %tmp1 = call %struct.__neon_int64x1x3_t @llvm.arm.neon.vld3.v1i64(i8* %tmp0, i32 16)
Bob Wilsonc67160c2009-10-07 23:39:57 +000064 %tmp2 = extractvalue %struct.__neon_int64x1x3_t %tmp1, 0
65 %tmp3 = extractvalue %struct.__neon_int64x1x3_t %tmp1, 2
66 %tmp4 = add <1 x i64> %tmp2, %tmp3
67 ret <1 x i64> %tmp4
68}
69
Bob Wilsonff8952e2009-10-07 17:24:55 +000070define <16 x i8> @vld3Qi8(i8* %A) nounwind {
71;CHECK: vld3Qi8:
Bob Wilson40ff01a2010-09-23 21:43:54 +000072;Check the alignment value. Max for this instruction is 64 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000073;CHECK: vld3.8 {d16, d18, d20}, [r0, :64]!
74;CHECK: vld3.8 {d17, d19, d21}, [r0, :64]
Bob Wilson40ff01a2010-09-23 21:43:54 +000075 %tmp1 = call %struct.__neon_int8x16x3_t @llvm.arm.neon.vld3.v16i8(i8* %A, i32 32)
Bob Wilsonff8952e2009-10-07 17:24:55 +000076 %tmp2 = extractvalue %struct.__neon_int8x16x3_t %tmp1, 0
77 %tmp3 = extractvalue %struct.__neon_int8x16x3_t %tmp1, 2
78 %tmp4 = add <16 x i8> %tmp2, %tmp3
79 ret <16 x i8> %tmp4
80}
81
82define <8 x i16> @vld3Qi16(i16* %A) nounwind {
83;CHECK: vld3Qi16:
84;CHECK: vld3.16
85;CHECK: vld3.16
Bob Wilson02170c02010-04-20 00:17:16 +000086 %tmp0 = bitcast i16* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000087 %tmp1 = call %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3.v8i16(i8* %tmp0, i32 1)
Bob Wilsonff8952e2009-10-07 17:24:55 +000088 %tmp2 = extractvalue %struct.__neon_int16x8x3_t %tmp1, 0
89 %tmp3 = extractvalue %struct.__neon_int16x8x3_t %tmp1, 2
90 %tmp4 = add <8 x i16> %tmp2, %tmp3
91 ret <8 x i16> %tmp4
92}
93
94define <4 x i32> @vld3Qi32(i32* %A) nounwind {
95;CHECK: vld3Qi32:
96;CHECK: vld3.32
97;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +000098 %tmp0 = bitcast i32* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000099 %tmp1 = call %struct.__neon_int32x4x3_t @llvm.arm.neon.vld3.v4i32(i8* %tmp0, i32 1)
Bob Wilsonff8952e2009-10-07 17:24:55 +0000100 %tmp2 = extractvalue %struct.__neon_int32x4x3_t %tmp1, 0
101 %tmp3 = extractvalue %struct.__neon_int32x4x3_t %tmp1, 2
102 %tmp4 = add <4 x i32> %tmp2, %tmp3
103 ret <4 x i32> %tmp4
104}
105
106define <4 x float> @vld3Qf(float* %A) nounwind {
107;CHECK: vld3Qf:
108;CHECK: vld3.32
109;CHECK: vld3.32
Bob Wilson02170c02010-04-20 00:17:16 +0000110 %tmp0 = bitcast float* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +0000111 %tmp1 = call %struct.__neon_float32x4x3_t @llvm.arm.neon.vld3.v4f32(i8* %tmp0, i32 1)
Bob Wilsonff8952e2009-10-07 17:24:55 +0000112 %tmp2 = extractvalue %struct.__neon_float32x4x3_t %tmp1, 0
113 %tmp3 = extractvalue %struct.__neon_float32x4x3_t %tmp1, 2
Dan Gohmand4d01152010-05-03 22:36:46 +0000114 %tmp4 = fadd <4 x float> %tmp2, %tmp3
Bob Wilsonff8952e2009-10-07 17:24:55 +0000115 ret <4 x float> %tmp4
116}
117
Bob Wilson7a9ef442010-08-27 17:13:24 +0000118declare %struct.__neon_int8x8x3_t @llvm.arm.neon.vld3.v8i8(i8*, i32) nounwind readonly
119declare %struct.__neon_int16x4x3_t @llvm.arm.neon.vld3.v4i16(i8*, i32) nounwind readonly
120declare %struct.__neon_int32x2x3_t @llvm.arm.neon.vld3.v2i32(i8*, i32) nounwind readonly
121declare %struct.__neon_float32x2x3_t @llvm.arm.neon.vld3.v2f32(i8*, i32) nounwind readonly
122declare %struct.__neon_int64x1x3_t @llvm.arm.neon.vld3.v1i64(i8*, i32) nounwind readonly
Bob Wilsonff8952e2009-10-07 17:24:55 +0000123
Bob Wilson7a9ef442010-08-27 17:13:24 +0000124declare %struct.__neon_int8x16x3_t @llvm.arm.neon.vld3.v16i8(i8*, i32) nounwind readonly
125declare %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3.v8i16(i8*, i32) nounwind readonly
126declare %struct.__neon_int32x4x3_t @llvm.arm.neon.vld3.v4i32(i8*, i32) nounwind readonly
127declare %struct.__neon_float32x4x3_t @llvm.arm.neon.vld3.v4f32(i8*, i32) nounwind readonly