blob: 0724e09d7ad09189ae1c004a524dec530deb979c [file] [log] [blame]
Vincent Lejeuned3fcb502013-05-17 16:51:06 +00001;RUN: llc < %s -march=r600 -mcpu=cayman
Vincent Lejeuned3fcb502013-05-17 16:51:06 +00002
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +00003define amdgpu_vs void @main(<4 x float> inreg %reg0, <4 x float> inreg %reg1, <4 x float> inreg %reg2, <4 x float> inreg %reg3) {
Vincent Lejeuned3fcb502013-05-17 16:51:06 +00004main_body:
Vincent Lejeunef143af32013-11-11 22:10:24 +00005 %0 = extractelement <4 x float> %reg1, i32 0
6 %1 = extractelement <4 x float> %reg1, i32 1
7 %2 = extractelement <4 x float> %reg1, i32 2
8 %3 = extractelement <4 x float> %reg1, i32 3
9 %4 = extractelement <4 x float> %reg2, i32 0
10 %5 = extractelement <4 x float> %reg2, i32 1
11 %6 = extractelement <4 x float> %reg2, i32 2
12 %7 = extractelement <4 x float> %reg2, i32 3
13 %8 = extractelement <4 x float> %reg3, i32 0
14 %9 = extractelement <4 x float> %reg3, i32 1
15 %10 = extractelement <4 x float> %reg3, i32 2
16 %11 = extractelement <4 x float> %reg3, i32 3
David Blaikiea79ac142015-02-27 21:17:42 +000017 %12 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000018 %13 = extractelement <4 x float> %12, i32 0
19 %14 = fmul float %0, %13
David Blaikiea79ac142015-02-27 21:17:42 +000020 %15 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000021 %16 = extractelement <4 x float> %15, i32 1
22 %17 = fmul float %0, %16
David Blaikiea79ac142015-02-27 21:17:42 +000023 %18 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000024 %19 = extractelement <4 x float> %18, i32 2
25 %20 = fmul float %0, %19
David Blaikiea79ac142015-02-27 21:17:42 +000026 %21 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000027 %22 = extractelement <4 x float> %21, i32 3
28 %23 = fmul float %0, %22
David Blaikief72d05b2015-03-13 18:20:45 +000029 %24 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000030 %25 = extractelement <4 x float> %24, i32 0
31 %26 = fmul float %1, %25
32 %27 = fadd float %26, %14
David Blaikief72d05b2015-03-13 18:20:45 +000033 %28 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000034 %29 = extractelement <4 x float> %28, i32 1
35 %30 = fmul float %1, %29
36 %31 = fadd float %30, %17
David Blaikief72d05b2015-03-13 18:20:45 +000037 %32 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000038 %33 = extractelement <4 x float> %32, i32 2
39 %34 = fmul float %1, %33
40 %35 = fadd float %34, %20
David Blaikief72d05b2015-03-13 18:20:45 +000041 %36 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000042 %37 = extractelement <4 x float> %36, i32 3
43 %38 = fmul float %1, %37
44 %39 = fadd float %38, %23
David Blaikief72d05b2015-03-13 18:20:45 +000045 %40 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000046 %41 = extractelement <4 x float> %40, i32 0
47 %42 = fmul float %2, %41
48 %43 = fadd float %42, %27
David Blaikief72d05b2015-03-13 18:20:45 +000049 %44 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000050 %45 = extractelement <4 x float> %44, i32 1
51 %46 = fmul float %2, %45
52 %47 = fadd float %46, %31
David Blaikief72d05b2015-03-13 18:20:45 +000053 %48 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000054 %49 = extractelement <4 x float> %48, i32 2
55 %50 = fmul float %2, %49
56 %51 = fadd float %50, %35
David Blaikief72d05b2015-03-13 18:20:45 +000057 %52 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000058 %53 = extractelement <4 x float> %52, i32 3
59 %54 = fmul float %2, %53
60 %55 = fadd float %54, %39
David Blaikief72d05b2015-03-13 18:20:45 +000061 %56 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 3)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000062 %57 = extractelement <4 x float> %56, i32 0
63 %58 = fmul float %3, %57
64 %59 = fadd float %58, %43
David Blaikief72d05b2015-03-13 18:20:45 +000065 %60 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 3)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000066 %61 = extractelement <4 x float> %60, i32 1
67 %62 = fmul float %3, %61
68 %63 = fadd float %62, %47
David Blaikief72d05b2015-03-13 18:20:45 +000069 %64 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 3)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000070 %65 = extractelement <4 x float> %64, i32 2
71 %66 = fmul float %3, %65
72 %67 = fadd float %66, %51
David Blaikief72d05b2015-03-13 18:20:45 +000073 %68 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 3)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000074 %69 = extractelement <4 x float> %68, i32 3
75 %70 = fmul float %3, %69
76 %71 = fadd float %70, %55
David Blaikief72d05b2015-03-13 18:20:45 +000077 %72 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 4)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000078 %73 = extractelement <4 x float> %72, i32 0
David Blaikief72d05b2015-03-13 18:20:45 +000079 %74 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 4)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000080 %75 = extractelement <4 x float> %74, i32 1
David Blaikief72d05b2015-03-13 18:20:45 +000081 %76 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 4)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000082 %77 = extractelement <4 x float> %76, i32 2
83 %78 = insertelement <4 x float> undef, float %4, i32 0
84 %79 = insertelement <4 x float> %78, float %5, i32 1
85 %80 = insertelement <4 x float> %79, float %6, i32 2
86 %81 = insertelement <4 x float> %80, float 0.000000e+00, i32 3
87 %82 = insertelement <4 x float> undef, float %73, i32 0
88 %83 = insertelement <4 x float> %82, float %75, i32 1
89 %84 = insertelement <4 x float> %83, float %77, i32 2
90 %85 = insertelement <4 x float> %84, float 0.000000e+00, i32 3
Matt Arsenaultca7f5702016-07-14 05:47:17 +000091 %86 = call float @llvm.r600.dot4(<4 x float> %81, <4 x float> %85)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000092 %87 = insertelement <4 x float> undef, float %86, i32 0
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000093 call void @llvm.r600.store.swizzle(<4 x float> %87, i32 2, i32 2)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000094 ret void
95}
96
97; Function Attrs: readnone
Matt Arsenaultca7f5702016-07-14 05:47:17 +000098declare float @llvm.r600.dot4(<4 x float>, <4 x float>) #1
Vincent Lejeuned3fcb502013-05-17 16:51:06 +000099
Vincent Lejeuned3fcb502013-05-17 16:51:06 +0000100; Function Attrs: nounwind readonly
101declare float @llvm.pow.f32(float, float) #3
102
Matt Arsenault82e5e1e2016-07-15 21:27:08 +0000103declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32)
Vincent Lejeuned3fcb502013-05-17 16:51:06 +0000104
Vincent Lejeuned3fcb502013-05-17 16:51:06 +0000105attributes #1 = { readnone }
106attributes #2 = { readonly }
107attributes #3 = { nounwind readonly }