blob: ae8b67d7157b657c8e27f023962252329c149c9b [file] [log] [blame]
Chad Rosier45c33c92012-11-27 20:49:56 +00001; RUN: llc -O0 -verify-machineinstrs -mtriple=armv7-apple-darwin < %s
JF Bastien18db1f22013-06-14 02:49:43 +00002; RUN: llc -O0 -verify-machineinstrs -mtriple=armv7-linux-gnueabi < %s
Eric Christopher174d8722011-03-12 01:09:29 +00003
4define i32 @main() nounwind ssp {
5entry:
6 %retval = alloca i32, align 4
7 %X = alloca <4 x i32>, align 16
8 %Y = alloca <4 x float>, align 16
9 store i32 0, i32* %retval
David Blaikiea79ac142015-02-27 21:17:42 +000010 %tmp = load <4 x i32>, <4 x i32>* %X, align 16
Eric Christopher174d8722011-03-12 01:09:29 +000011 call void @__aa(<4 x i32> %tmp, i8* null, i32 3, <4 x float>* %Y)
David Blaikiea79ac142015-02-27 21:17:42 +000012 %0 = load i32, i32* %retval
Eric Christopher174d8722011-03-12 01:09:29 +000013 ret i32 %0
14}
15
16define internal void @__aa(<4 x i32> %v, i8* %p, i32 %offset, <4 x float>* %constants) nounwind inlinehint ssp {
17entry:
18 %__a.addr.i = alloca <4 x i32>, align 16
19 %v.addr = alloca <4 x i32>, align 16
20 %p.addr = alloca i8*, align 4
21 %offset.addr = alloca i32, align 4
22 %constants.addr = alloca <4 x float>*, align 4
23 store <4 x i32> %v, <4 x i32>* %v.addr, align 16
24 store i8* %p, i8** %p.addr, align 4
25 store i32 %offset, i32* %offset.addr, align 4
26 store <4 x float>* %constants, <4 x float>** %constants.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000027 %tmp = load <4 x i32>, <4 x i32>* %v.addr, align 16
Eric Christopher174d8722011-03-12 01:09:29 +000028 store <4 x i32> %tmp, <4 x i32>* %__a.addr.i, align 16
David Blaikiea79ac142015-02-27 21:17:42 +000029 %tmp.i = load <4 x i32>, <4 x i32>* %__a.addr.i, align 16
Eric Christopher174d8722011-03-12 01:09:29 +000030 %0 = bitcast <4 x i32> %tmp.i to <16 x i8>
31 %1 = bitcast <16 x i8> %0 to <4 x i32>
32 %vcvt.i = sitofp <4 x i32> %1 to <4 x float>
David Blaikiea79ac142015-02-27 21:17:42 +000033 %tmp1 = load i8*, i8** %p.addr, align 4
34 %tmp2 = load i32, i32* %offset.addr, align 4
35 %tmp3 = load <4 x float>*, <4 x float>** %constants.addr, align 4
Eric Christopher174d8722011-03-12 01:09:29 +000036 call void @__bb(<4 x float> %vcvt.i, i8* %tmp1, i32 %tmp2, <4 x float>* %tmp3)
37 ret void
38}
39
40define internal void @__bb(<4 x float> %v, i8* %p, i32 %offset, <4 x float>* %constants) nounwind inlinehint ssp {
41entry:
42 %v.addr = alloca <4 x float>, align 16
43 %p.addr = alloca i8*, align 4
44 %offset.addr = alloca i32, align 4
45 %constants.addr = alloca <4 x float>*, align 4
46 %data = alloca i64, align 4
47 store <4 x float> %v, <4 x float>* %v.addr, align 16
48 store i8* %p, i8** %p.addr, align 4
49 store i32 %offset, i32* %offset.addr, align 4
50 store <4 x float>* %constants, <4 x float>** %constants.addr, align 4
David Blaikiea79ac142015-02-27 21:17:42 +000051 %tmp = load i64, i64* %data, align 4
52 %tmp1 = load i8*, i8** %p.addr, align 4
53 %tmp2 = load i32, i32* %offset.addr, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000054 %add.ptr = getelementptr i8, i8* %tmp1, i32 %tmp2
Eric Christopher174d8722011-03-12 01:09:29 +000055 %0 = bitcast i8* %add.ptr to i64*
David Blaikie79e6c742015-02-27 19:29:02 +000056 %arrayidx = getelementptr inbounds i64, i64* %0, i32 0
Eric Christopher174d8722011-03-12 01:09:29 +000057 store i64 %tmp, i64* %arrayidx
58 ret void
59}