blob: 9fde31f922cd4b5a2786dcf19ba35c043c9172c1 [file] [log] [blame]
Vincent Lejeunec44fa992013-04-04 13:59:59 +00001;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
2
Vincent Lejeune92b0a642013-12-07 01:49:19 +00003; CHECK: JUMP @6
Vincent Lejeune2d5c3412013-04-17 15:17:39 +00004; CHECK: EXPORT
5; CHECK-NOT: EXPORT
Vincent Lejeunec44fa992013-04-04 13:59:59 +00006
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +00007define amdgpu_ps void @main() {
Vincent Lejeunec44fa992013-04-04 13:59:59 +00008main_body:
David Blaikief72d05b2015-03-13 18:20:45 +00009 %0 = 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 Lejeunec44fa992013-04-04 13:59:59 +000010 %1 = extractelement <4 x float> %0, i32 0
11 %2 = bitcast float %1 to i32
12 %3 = icmp eq i32 %2, 0
13 %4 = sext i1 %3 to i32
14 %5 = bitcast i32 %4 to float
15 %6 = bitcast float %5 to i32
16 %7 = icmp ne i32 %6, 0
17 br i1 %7, label %ENDIF, label %ELSE
18
19ELSE: ; preds = %main_body
David Blaikief72d05b2015-03-13 18:20:45 +000020 %8 = 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 Lejeunec44fa992013-04-04 13:59:59 +000021 %9 = extractelement <4 x float> %8, i32 0
22 %10 = bitcast float %9 to i32
23 %11 = icmp eq i32 %10, 1
24 %12 = sext i1 %11 to i32
25 %13 = bitcast i32 %12 to float
26 %14 = bitcast float %13 to i32
27 %15 = icmp ne i32 %14, 0
28 br i1 %15, label %IF13, label %ENDIF
29
30ENDIF: ; preds = %IF13, %ELSE, %main_body
31 %temp.0 = phi float [ 0xFFF8000000000000, %main_body ], [ 0.000000e+00, %ELSE ], [ 0.000000e+00, %IF13 ]
32 %temp1.0 = phi float [ 0.000000e+00, %main_body ], [ %23, %IF13 ], [ 0.000000e+00, %ELSE ]
33 %temp2.0 = phi float [ 1.000000e+00, %main_body ], [ 0.000000e+00, %ELSE ], [ 0.000000e+00, %IF13 ]
34 %temp3.0 = phi float [ 5.000000e-01, %main_body ], [ 0.000000e+00, %ELSE ], [ 0.000000e+00, %IF13 ]
35 %16 = insertelement <4 x float> undef, float %temp.0, i32 0
36 %17 = insertelement <4 x float> %16, float %temp1.0, i32 1
37 %18 = insertelement <4 x float> %17, float %temp2.0, i32 2
38 %19 = insertelement <4 x float> %18, float %temp3.0, i32 3
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000039 call void @llvm.r600.store.swizzle(<4 x float> %19, i32 0, i32 0)
Vincent Lejeunec44fa992013-04-04 13:59:59 +000040 ret void
41
42IF13: ; preds = %ELSE
David Blaikiea79ac142015-02-27 21:17:42 +000043 %20 = load <4 x float>, <4 x float> addrspace(8)* null
Vincent Lejeunec44fa992013-04-04 13:59:59 +000044 %21 = extractelement <4 x float> %20, i32 0
45 %22 = fsub float -0.000000e+00, %21
46 %23 = fadd float 0xFFF8000000000000, %22
47 br label %ENDIF
48}
49
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000050declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32)