blob: 3fdd7b7aa88ac7329d1da6e546ec5105b936abd7 [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_int8x8x2_t = type { <8 x i8>, <8 x i8> }
4%struct.__neon_int16x4x2_t = type { <4 x i16>, <4 x i16> }
5%struct.__neon_int32x2x2_t = type { <2 x i32>, <2 x i32> }
6%struct.__neon_float32x2x2_t = type { <2 x float>, <2 x float> }
Bob Wilsona4288082009-10-07 22:57:01 +00007%struct.__neon_int64x1x2_t = type { <1 x i64>, <1 x i64> }
Bob Wilson9b600c62009-08-06 00:38:31 +00008
Bob Wilson967f8752009-10-07 17:19:13 +00009%struct.__neon_int8x16x2_t = type { <16 x i8>, <16 x i8> }
10%struct.__neon_int16x8x2_t = type { <8 x i16>, <8 x i16> }
11%struct.__neon_int32x4x2_t = type { <4 x i32>, <4 x i32> }
12%struct.__neon_float32x4x2_t = type { <4 x float>, <4 x float> }
13
Bob Wilson9b600c62009-08-06 00:38:31 +000014define <8 x i8> @vld2i8(i8* %A) nounwind {
15;CHECK: vld2i8:
Bob Wilson40ff01a2010-09-23 21:43:54 +000016;Check the alignment value. Max for this instruction is 128 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000017;CHECK: vld2.8 {d16, d17}, [r0, :64]
Bob Wilson40ff01a2010-09-23 21:43:54 +000018 %tmp1 = call %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2.v8i8(i8* %A, i32 8)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000019 %tmp2 = extractvalue %struct.__neon_int8x8x2_t %tmp1, 0
20 %tmp3 = extractvalue %struct.__neon_int8x8x2_t %tmp1, 1
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> @vld2i16(i16* %A) nounwind {
26;CHECK: vld2i16:
Bob Wilson40ff01a2010-09-23 21:43:54 +000027;Check the alignment value. Max for this instruction is 128 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000028;CHECK: vld2.16 {d16, d17}, [r0, :128]
Bob Wilson02170c02010-04-20 00:17:16 +000029 %tmp0 = bitcast i16* %A to i8*
Bob Wilson40ff01a2010-09-23 21:43:54 +000030 %tmp1 = call %struct.__neon_int16x4x2_t @llvm.arm.neon.vld2.v4i16(i8* %tmp0, i32 32)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000031 %tmp2 = extractvalue %struct.__neon_int16x4x2_t %tmp1, 0
32 %tmp3 = extractvalue %struct.__neon_int16x4x2_t %tmp1, 1
Bob Wilson9b600c62009-08-06 00:38:31 +000033 %tmp4 = add <4 x i16> %tmp2, %tmp3
34 ret <4 x i16> %tmp4
35}
36
37define <2 x i32> @vld2i32(i32* %A) nounwind {
38;CHECK: vld2i32:
39;CHECK: vld2.32
Bob Wilson02170c02010-04-20 00:17:16 +000040 %tmp0 = bitcast i32* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000041 %tmp1 = call %struct.__neon_int32x2x2_t @llvm.arm.neon.vld2.v2i32(i8* %tmp0, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000042 %tmp2 = extractvalue %struct.__neon_int32x2x2_t %tmp1, 0
43 %tmp3 = extractvalue %struct.__neon_int32x2x2_t %tmp1, 1
Bob Wilson9b600c62009-08-06 00:38:31 +000044 %tmp4 = add <2 x i32> %tmp2, %tmp3
45 ret <2 x i32> %tmp4
46}
47
48define <2 x float> @vld2f(float* %A) nounwind {
49;CHECK: vld2f:
50;CHECK: vld2.32
Bob Wilson02170c02010-04-20 00:17:16 +000051 %tmp0 = bitcast float* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000052 %tmp1 = call %struct.__neon_float32x2x2_t @llvm.arm.neon.vld2.v2f32(i8* %tmp0, i32 1)
Bob Wilsonec1d81c2009-10-06 21:16:19 +000053 %tmp2 = extractvalue %struct.__neon_float32x2x2_t %tmp1, 0
54 %tmp3 = extractvalue %struct.__neon_float32x2x2_t %tmp1, 1
Dan Gohmand4d01152010-05-03 22:36:46 +000055 %tmp4 = fadd <2 x float> %tmp2, %tmp3
Bob Wilson9b600c62009-08-06 00:38:31 +000056 ret <2 x float> %tmp4
57}
58
Bob Wilsona4288082009-10-07 22:57:01 +000059define <1 x i64> @vld2i64(i64* %A) nounwind {
60;CHECK: vld2i64:
Bob Wilson40ff01a2010-09-23 21:43:54 +000061;Check the alignment value. Max for this instruction is 128 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000062;CHECK: vld1.64 {d16, d17}, [r0, :128]
Bob Wilson02170c02010-04-20 00:17:16 +000063 %tmp0 = bitcast i64* %A to i8*
Bob Wilson40ff01a2010-09-23 21:43:54 +000064 %tmp1 = call %struct.__neon_int64x1x2_t @llvm.arm.neon.vld2.v1i64(i8* %tmp0, i32 32)
Bob Wilsona4288082009-10-07 22:57:01 +000065 %tmp2 = extractvalue %struct.__neon_int64x1x2_t %tmp1, 0
66 %tmp3 = extractvalue %struct.__neon_int64x1x2_t %tmp1, 1
67 %tmp4 = add <1 x i64> %tmp2, %tmp3
68 ret <1 x i64> %tmp4
69}
70
Bob Wilson967f8752009-10-07 17:19:13 +000071define <16 x i8> @vld2Qi8(i8* %A) nounwind {
72;CHECK: vld2Qi8:
Bob Wilson40ff01a2010-09-23 21:43:54 +000073;Check the alignment value. Max for this instruction is 256 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000074;CHECK: vld2.8 {d16, d17, d18, d19}, [r0, :64]
Bob Wilson40ff01a2010-09-23 21:43:54 +000075 %tmp1 = call %struct.__neon_int8x16x2_t @llvm.arm.neon.vld2.v16i8(i8* %A, i32 8)
Bob Wilson967f8752009-10-07 17:19:13 +000076 %tmp2 = extractvalue %struct.__neon_int8x16x2_t %tmp1, 0
77 %tmp3 = extractvalue %struct.__neon_int8x16x2_t %tmp1, 1
78 %tmp4 = add <16 x i8> %tmp2, %tmp3
79 ret <16 x i8> %tmp4
80}
81
82define <8 x i16> @vld2Qi16(i16* %A) nounwind {
83;CHECK: vld2Qi16:
Bob Wilson40ff01a2010-09-23 21:43:54 +000084;Check the alignment value. Max for this instruction is 256 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000085;CHECK: vld2.16 {d16, d17, d18, d19}, [r0, :128]
Bob Wilson02170c02010-04-20 00:17:16 +000086 %tmp0 = bitcast i16* %A to i8*
Bob Wilson40ff01a2010-09-23 21:43:54 +000087 %tmp1 = call %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2.v8i16(i8* %tmp0, i32 16)
Bob Wilson967f8752009-10-07 17:19:13 +000088 %tmp2 = extractvalue %struct.__neon_int16x8x2_t %tmp1, 0
89 %tmp3 = extractvalue %struct.__neon_int16x8x2_t %tmp1, 1
90 %tmp4 = add <8 x i16> %tmp2, %tmp3
91 ret <8 x i16> %tmp4
92}
93
94define <4 x i32> @vld2Qi32(i32* %A) nounwind {
95;CHECK: vld2Qi32:
Bob Wilson40ff01a2010-09-23 21:43:54 +000096;Check the alignment value. Max for this instruction is 256 bits:
Bob Wilson7d247052010-10-08 06:15:13 +000097;CHECK: vld2.32 {d16, d17, d18, d19}, [r0, :256]
Bob Wilson02170c02010-04-20 00:17:16 +000098 %tmp0 = bitcast i32* %A to i8*
Bob Wilson40ff01a2010-09-23 21:43:54 +000099 %tmp1 = call %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8* %tmp0, i32 64)
Bob Wilson967f8752009-10-07 17:19:13 +0000100 %tmp2 = extractvalue %struct.__neon_int32x4x2_t %tmp1, 0
101 %tmp3 = extractvalue %struct.__neon_int32x4x2_t %tmp1, 1
102 %tmp4 = add <4 x i32> %tmp2, %tmp3
103 ret <4 x i32> %tmp4
104}
105
106define <4 x float> @vld2Qf(float* %A) nounwind {
107;CHECK: vld2Qf:
108;CHECK: vld2.32
Bob Wilson02170c02010-04-20 00:17:16 +0000109 %tmp0 = bitcast float* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +0000110 %tmp1 = call %struct.__neon_float32x4x2_t @llvm.arm.neon.vld2.v4f32(i8* %tmp0, i32 1)
Bob Wilson967f8752009-10-07 17:19:13 +0000111 %tmp2 = extractvalue %struct.__neon_float32x4x2_t %tmp1, 0
112 %tmp3 = extractvalue %struct.__neon_float32x4x2_t %tmp1, 1
Dan Gohmand4d01152010-05-03 22:36:46 +0000113 %tmp4 = fadd <4 x float> %tmp2, %tmp3
Bob Wilson967f8752009-10-07 17:19:13 +0000114 ret <4 x float> %tmp4
115}
116
Bob Wilson7a9ef442010-08-27 17:13:24 +0000117declare %struct.__neon_int8x8x2_t @llvm.arm.neon.vld2.v8i8(i8*, i32) nounwind readonly
118declare %struct.__neon_int16x4x2_t @llvm.arm.neon.vld2.v4i16(i8*, i32) nounwind readonly
119declare %struct.__neon_int32x2x2_t @llvm.arm.neon.vld2.v2i32(i8*, i32) nounwind readonly
120declare %struct.__neon_float32x2x2_t @llvm.arm.neon.vld2.v2f32(i8*, i32) nounwind readonly
121declare %struct.__neon_int64x1x2_t @llvm.arm.neon.vld2.v1i64(i8*, i32) nounwind readonly
Bob Wilson967f8752009-10-07 17:19:13 +0000122
Bob Wilson7a9ef442010-08-27 17:13:24 +0000123declare %struct.__neon_int8x16x2_t @llvm.arm.neon.vld2.v16i8(i8*, i32) nounwind readonly
124declare %struct.__neon_int16x8x2_t @llvm.arm.neon.vld2.v8i16(i8*, i32) nounwind readonly
125declare %struct.__neon_int32x4x2_t @llvm.arm.neon.vld2.v4i32(i8*, i32) nounwind readonly
126declare %struct.__neon_float32x4x2_t @llvm.arm.neon.vld2.v4f32(i8*, i32) nounwind readonly