blob: 26543261c1860e388154bed6a784cbfa64226e9b [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
Bob Wilson205a5ca2009-07-08 18:11:30 +00002
3define <8 x i8> @vld1i8(i8* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +00004;CHECK: vld1i8:
Bob Wilson40ff01a2010-09-23 21:43:54 +00005;Check the alignment value. Max for this instruction is 64 bits:
6;CHECK: vld1.8 {d0}, [r0, :64]
7 %tmp1 = call <8 x i8> @llvm.arm.neon.vld1.v8i8(i8* %A, i32 16)
Bob Wilson205a5ca2009-07-08 18:11:30 +00008 ret <8 x i8> %tmp1
9}
10
11define <4 x i16> @vld1i16(i16* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000012;CHECK: vld1i16:
13;CHECK: vld1.16
Bob Wilson02170c02010-04-20 00:17:16 +000014 %tmp0 = bitcast i16* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000015 %tmp1 = call <4 x i16> @llvm.arm.neon.vld1.v4i16(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000016 ret <4 x i16> %tmp1
17}
18
19define <2 x i32> @vld1i32(i32* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000020;CHECK: vld1i32:
21;CHECK: vld1.32
Bob Wilson02170c02010-04-20 00:17:16 +000022 %tmp0 = bitcast i32* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000023 %tmp1 = call <2 x i32> @llvm.arm.neon.vld1.v2i32(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000024 ret <2 x i32> %tmp1
25}
26
27define <2 x float> @vld1f(float* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000028;CHECK: vld1f:
29;CHECK: vld1.32
Bob Wilson02170c02010-04-20 00:17:16 +000030 %tmp0 = bitcast float* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000031 %tmp1 = call <2 x float> @llvm.arm.neon.vld1.v2f32(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000032 ret <2 x float> %tmp1
33}
34
35define <1 x i64> @vld1i64(i64* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000036;CHECK: vld1i64:
37;CHECK: vld1.64
Bob Wilson02170c02010-04-20 00:17:16 +000038 %tmp0 = bitcast i64* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000039 %tmp1 = call <1 x i64> @llvm.arm.neon.vld1.v1i64(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000040 ret <1 x i64> %tmp1
41}
42
43define <16 x i8> @vld1Qi8(i8* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000044;CHECK: vld1Qi8:
Bob Wilson40ff01a2010-09-23 21:43:54 +000045;Check the alignment value. Max for this instruction is 128 bits:
46;CHECK: vld1.8 {d0, d1}, [r0, :128]
47 %tmp1 = call <16 x i8> @llvm.arm.neon.vld1.v16i8(i8* %A, i32 32)
Bob Wilson205a5ca2009-07-08 18:11:30 +000048 ret <16 x i8> %tmp1
49}
50
51define <8 x i16> @vld1Qi16(i16* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000052;CHECK: vld1Qi16:
53;CHECK: vld1.16
Bob Wilson02170c02010-04-20 00:17:16 +000054 %tmp0 = bitcast i16* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000055 %tmp1 = call <8 x i16> @llvm.arm.neon.vld1.v8i16(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000056 ret <8 x i16> %tmp1
57}
58
59define <4 x i32> @vld1Qi32(i32* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000060;CHECK: vld1Qi32:
61;CHECK: vld1.32
Bob Wilson02170c02010-04-20 00:17:16 +000062 %tmp0 = bitcast i32* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000063 %tmp1 = call <4 x i32> @llvm.arm.neon.vld1.v4i32(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000064 ret <4 x i32> %tmp1
65}
66
67define <4 x float> @vld1Qf(float* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000068;CHECK: vld1Qf:
69;CHECK: vld1.32
Bob Wilson02170c02010-04-20 00:17:16 +000070 %tmp0 = bitcast float* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000071 %tmp1 = call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000072 ret <4 x float> %tmp1
73}
74
75define <2 x i64> @vld1Qi64(i64* %A) nounwind {
Bob Wilson3765d0f2009-08-05 23:51:20 +000076;CHECK: vld1Qi64:
77;CHECK: vld1.64
Bob Wilson02170c02010-04-20 00:17:16 +000078 %tmp0 = bitcast i64* %A to i8*
Bob Wilson7a9ef442010-08-27 17:13:24 +000079 %tmp1 = call <2 x i64> @llvm.arm.neon.vld1.v2i64(i8* %tmp0, i32 1)
Bob Wilson205a5ca2009-07-08 18:11:30 +000080 ret <2 x i64> %tmp1
81}
82
Bob Wilson7a9ef442010-08-27 17:13:24 +000083declare <8 x i8> @llvm.arm.neon.vld1.v8i8(i8*, i32) nounwind readonly
84declare <4 x i16> @llvm.arm.neon.vld1.v4i16(i8*, i32) nounwind readonly
85declare <2 x i32> @llvm.arm.neon.vld1.v2i32(i8*, i32) nounwind readonly
86declare <2 x float> @llvm.arm.neon.vld1.v2f32(i8*, i32) nounwind readonly
87declare <1 x i64> @llvm.arm.neon.vld1.v1i64(i8*, i32) nounwind readonly
Bob Wilson205a5ca2009-07-08 18:11:30 +000088
Bob Wilson7a9ef442010-08-27 17:13:24 +000089declare <16 x i8> @llvm.arm.neon.vld1.v16i8(i8*, i32) nounwind readonly
90declare <8 x i16> @llvm.arm.neon.vld1.v8i16(i8*, i32) nounwind readonly
91declare <4 x i32> @llvm.arm.neon.vld1.v4i32(i8*, i32) nounwind readonly
92declare <4 x float> @llvm.arm.neon.vld1.v4f32(i8*, i32) nounwind readonly
93declare <2 x i64> @llvm.arm.neon.vld1.v2i64(i8*, i32) nounwind readonly
Bob Wilson2ac124c2010-08-26 00:13:36 +000094
95; Radar 8355607
96; Do not crash if the vld1 result is not used.
97define void @unused_vld1_result() {
98entry:
99;CHECK: unused_vld1_result
100;CHECK: vld1.32
Bob Wilson7a9ef442010-08-27 17:13:24 +0000101 %0 = call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* undef, i32 1)
Bob Wilson2ac124c2010-08-26 00:13:36 +0000102 call void @llvm.trap()
103 unreachable
104}
105
106declare void @llvm.trap() nounwind