blob: fd789b0c603e711decbe920e8cdbcdafea024a05 [file] [log] [blame]
Vincent Lejeune301beb82013-10-13 17:56:04 +00001; RUN: llc < %s -march=r600 -mcpu=cedar | FileCheck %s
2
3;CHECK: EXPORT T{{[0-9]}}.XYZW
4;CHECK: EXPORT T{{[0-9]}}.0000
5;CHECK: EXPORT T{{[0-9]}}.0000
Chandler Carruth9a0051c2014-07-23 07:08:53 +00006;CHECK: EXPORT T{{[0-9]}}.0XYZ
Vincent Lejeune301beb82013-10-13 17:56:04 +00007;CHECK: EXPORT T{{[0-9]}}.XYZW
Chandler Carruth9a0051c2014-07-23 07:08:53 +00008;CHECK: EXPORT T{{[0-9]}}.YZ00
Vincent Lejeune301beb82013-10-13 17:56:04 +00009;CHECK: EXPORT T{{[0-9]}}.0000
10;CHECK: EXPORT T{{[0-9]}}.0000
11
12
Vincent Lejeunef143af32013-11-11 22:10:24 +000013define void @main(<4 x float> inreg %reg0, <4 x float> inreg %reg1) #0 {
Vincent Lejeune301beb82013-10-13 17:56:04 +000014main_body:
Vincent Lejeunef143af32013-11-11 22:10:24 +000015 %0 = extractelement <4 x float> %reg1, i32 0
16 %1 = extractelement <4 x float> %reg1, i32 1
17 %2 = extractelement <4 x float> %reg1, i32 2
18 %3 = extractelement <4 x float> %reg1, i32 3
David Blaikiea79ac142015-02-27 21:17:42 +000019 %4 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 4)
Vincent Lejeune301beb82013-10-13 17:56:04 +000020 %5 = extractelement <4 x float> %4, i32 0
21 %6 = fmul float %5, %0
David Blaikiea79ac142015-02-27 21:17:42 +000022 %7 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 4)
Vincent Lejeune301beb82013-10-13 17:56:04 +000023 %8 = extractelement <4 x float> %7, i32 1
24 %9 = fmul float %8, %0
David Blaikiea79ac142015-02-27 21:17:42 +000025 %10 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 4)
Vincent Lejeune301beb82013-10-13 17:56:04 +000026 %11 = extractelement <4 x float> %10, i32 2
27 %12 = fmul float %11, %0
David Blaikiea79ac142015-02-27 21:17:42 +000028 %13 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 4)
Vincent Lejeune301beb82013-10-13 17:56:04 +000029 %14 = extractelement <4 x float> %13, i32 3
30 %15 = fmul float %14, %0
David Blaikiea79ac142015-02-27 21:17:42 +000031 %16 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 5)
Vincent Lejeune301beb82013-10-13 17:56:04 +000032 %17 = extractelement <4 x float> %16, i32 0
33 %18 = fmul float %17, %1
34 %19 = fadd float %18, %6
David Blaikiea79ac142015-02-27 21:17:42 +000035 %20 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 5)
Vincent Lejeune301beb82013-10-13 17:56:04 +000036 %21 = extractelement <4 x float> %20, i32 1
37 %22 = fmul float %21, %1
38 %23 = fadd float %22, %9
David Blaikiea79ac142015-02-27 21:17:42 +000039 %24 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 5)
Vincent Lejeune301beb82013-10-13 17:56:04 +000040 %25 = extractelement <4 x float> %24, i32 2
41 %26 = fmul float %25, %1
42 %27 = fadd float %26, %12
David Blaikiea79ac142015-02-27 21:17:42 +000043 %28 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 5)
Vincent Lejeune301beb82013-10-13 17:56:04 +000044 %29 = extractelement <4 x float> %28, i32 3
45 %30 = fmul float %29, %1
46 %31 = fadd float %30, %15
David Blaikiea79ac142015-02-27 21:17:42 +000047 %32 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 6)
Vincent Lejeune301beb82013-10-13 17:56:04 +000048 %33 = extractelement <4 x float> %32, i32 0
49 %34 = fmul float %33, %2
50 %35 = fadd float %34, %19
David Blaikiea79ac142015-02-27 21:17:42 +000051 %36 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 6)
Vincent Lejeune301beb82013-10-13 17:56:04 +000052 %37 = extractelement <4 x float> %36, i32 1
53 %38 = fmul float %37, %2
54 %39 = fadd float %38, %23
David Blaikiea79ac142015-02-27 21:17:42 +000055 %40 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 6)
Vincent Lejeune301beb82013-10-13 17:56:04 +000056 %41 = extractelement <4 x float> %40, i32 2
57 %42 = fmul float %41, %2
58 %43 = fadd float %42, %27
David Blaikiea79ac142015-02-27 21:17:42 +000059 %44 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 6)
Vincent Lejeune301beb82013-10-13 17:56:04 +000060 %45 = extractelement <4 x float> %44, i32 3
61 %46 = fmul float %45, %2
62 %47 = fadd float %46, %31
David Blaikiea79ac142015-02-27 21:17:42 +000063 %48 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 7)
Vincent Lejeune301beb82013-10-13 17:56:04 +000064 %49 = extractelement <4 x float> %48, i32 0
65 %50 = fmul float %49, %3
66 %51 = fadd float %50, %35
David Blaikiea79ac142015-02-27 21:17:42 +000067 %52 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 7)
Vincent Lejeune301beb82013-10-13 17:56:04 +000068 %53 = extractelement <4 x float> %52, i32 1
69 %54 = fmul float %53, %3
70 %55 = fadd float %54, %39
David Blaikiea79ac142015-02-27 21:17:42 +000071 %56 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 7)
Vincent Lejeune301beb82013-10-13 17:56:04 +000072 %57 = extractelement <4 x float> %56, i32 2
73 %58 = fmul float %57, %3
74 %59 = fadd float %58, %43
David Blaikiea79ac142015-02-27 21:17:42 +000075 %60 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 7)
Vincent Lejeune301beb82013-10-13 17:56:04 +000076 %61 = extractelement <4 x float> %60, i32 3
77 %62 = fmul float %61, %3
78 %63 = fadd float %62, %47
David Blaikiea79ac142015-02-27 21:17:42 +000079 %64 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeune301beb82013-10-13 17:56:04 +000080 %65 = extractelement <4 x float> %64, i32 0
David Blaikiea79ac142015-02-27 21:17:42 +000081 %66 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeune301beb82013-10-13 17:56:04 +000082 %67 = extractelement <4 x float> %66, i32 1
David Blaikiea79ac142015-02-27 21:17:42 +000083 %68 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeune301beb82013-10-13 17:56:04 +000084 %69 = extractelement <4 x float> %68, i32 2
David Blaikiea79ac142015-02-27 21:17:42 +000085 %70 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
Vincent Lejeune301beb82013-10-13 17:56:04 +000086 %71 = extractelement <4 x float> %70, i32 0
David Blaikiea79ac142015-02-27 21:17:42 +000087 %72 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
Vincent Lejeune301beb82013-10-13 17:56:04 +000088 %73 = extractelement <4 x float> %72, i32 1
David Blaikiea79ac142015-02-27 21:17:42 +000089 %74 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
Vincent Lejeune301beb82013-10-13 17:56:04 +000090 %75 = extractelement <4 x float> %74, i32 2
David Blaikiea79ac142015-02-27 21:17:42 +000091 %76 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 3)
Vincent Lejeune301beb82013-10-13 17:56:04 +000092 %77 = extractelement <4 x float> %76, i32 0
David Blaikiea79ac142015-02-27 21:17:42 +000093 %78 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 3)
Vincent Lejeune301beb82013-10-13 17:56:04 +000094 %79 = extractelement <4 x float> %78, i32 1
David Blaikiea79ac142015-02-27 21:17:42 +000095 %80 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>] addrspace(8)* null, i64 0, i32 3)
Vincent Lejeune301beb82013-10-13 17:56:04 +000096 %81 = extractelement <4 x float> %80, i32 2
97 %82 = insertelement <4 x float> undef, float %51, i32 0
98 %83 = insertelement <4 x float> %82, float %55, i32 1
99 %84 = insertelement <4 x float> %83, float %59, i32 2
100 %85 = insertelement <4 x float> %84, float %63, i32 3
101 call void @llvm.R600.store.swizzle(<4 x float> %85, i32 60, i32 1)
102 %86 = insertelement <4 x float> undef, float 0.000000e+00, i32 0
103 %87 = insertelement <4 x float> %86, float 0.000000e+00, i32 1
104 %88 = insertelement <4 x float> %87, float 0.000000e+00, i32 2
105 %89 = insertelement <4 x float> %88, float 0.000000e+00, i32 3
106 call void @llvm.R600.store.swizzle(<4 x float> %89, i32 0, i32 2)
107 %90 = insertelement <4 x float> undef, float 0.000000e+00, i32 0
108 %91 = insertelement <4 x float> %90, float 0.000000e+00, i32 1
109 %92 = insertelement <4 x float> %91, float 0.000000e+00, i32 2
110 %93 = insertelement <4 x float> %92, float 0.000000e+00, i32 3
111 call void @llvm.R600.store.swizzle(<4 x float> %93, i32 1, i32 2)
112 %94 = insertelement <4 x float> undef, float 0.000000e+00, i32 0
113 %95 = insertelement <4 x float> %94, float %65, i32 1
114 %96 = insertelement <4 x float> %95, float %67, i32 2
115 %97 = insertelement <4 x float> %96, float %69, i32 3
116 call void @llvm.R600.store.swizzle(<4 x float> %97, i32 2, i32 2)
117 %98 = insertelement <4 x float> undef, float %77, i32 0
118 %99 = insertelement <4 x float> %98, float %79, i32 1
119 %100 = insertelement <4 x float> %99, float %81, i32 2
120 %101 = insertelement <4 x float> %100, float %71, i32 3
121 call void @llvm.R600.store.swizzle(<4 x float> %101, i32 3, i32 2)
122 %102 = insertelement <4 x float> undef, float %73, i32 0
123 %103 = insertelement <4 x float> %102, float %75, i32 1
124 %104 = insertelement <4 x float> %103, float 0.000000e+00, i32 2
125 %105 = insertelement <4 x float> %104, float 0.000000e+00, i32 3
126 call void @llvm.R600.store.swizzle(<4 x float> %105, i32 4, i32 2)
127 %106 = insertelement <4 x float> undef, float 0.000000e+00, i32 0
128 %107 = insertelement <4 x float> %106, float 0.000000e+00, i32 1
129 %108 = insertelement <4 x float> %107, float 0.000000e+00, i32 2
130 %109 = insertelement <4 x float> %108, float 0.000000e+00, i32 3
131 call void @llvm.R600.store.swizzle(<4 x float> %109, i32 5, i32 2)
132 %110 = insertelement <4 x float> undef, float 0.000000e+00, i32 0
133 %111 = insertelement <4 x float> %110, float 0.000000e+00, i32 1
134 %112 = insertelement <4 x float> %111, float 0.000000e+00, i32 2
135 %113 = insertelement <4 x float> %112, float 0.000000e+00, i32 3
136 call void @llvm.R600.store.swizzle(<4 x float> %113, i32 6, i32 2)
137 ret void
138}
139
Vincent Lejeune301beb82013-10-13 17:56:04 +0000140declare void @llvm.R600.store.swizzle(<4 x float>, i32, i32)
141
142attributes #0 = { "ShaderType"="1" }