blob: 3f203ddf93b80cee8c89563cc1018c160188f9dc [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
2
Tom Stellardbfebd1f2014-02-04 17:18:37 +00003;CHECK-LABEL: test1:
4;CHECK: LOG_IEEE * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}},
5;CHECK-NEXT: MUL NON-IEEE * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], PS}},
6;CHECK-NEXT: EXP_IEEE * T{{[0-9]+\.[XYZW], PV\.[XYZW]}},
Tom Stellard75aadc22012-12-11 21:25:42 +00007
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +00008define amdgpu_ps void @test1(<4 x float> inreg %reg0) {
Vincent Lejeunef143af32013-11-11 22:10:24 +00009 %r0 = extractelement <4 x float> %reg0, i32 0
10 %r1 = extractelement <4 x float> %reg0, i32 1
Tom Stellard75aadc22012-12-11 21:25:42 +000011 %r2 = call float @llvm.pow.f32( float %r0, float %r1)
Vincent Lejeunef143af32013-11-11 22:10:24 +000012 %vec = insertelement <4 x float> undef, float %r2, i32 0
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000013 call void @llvm.r600.store.swizzle(<4 x float> %vec, i32 0, i32 0)
Tom Stellard75aadc22012-12-11 21:25:42 +000014 ret void
15}
16
Tom Stellardbfebd1f2014-02-04 17:18:37 +000017;CHECK-LABEL: test2:
18;CHECK: LOG_IEEE * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}},
19;CHECK-NEXT: MUL NON-IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], PS}},
20;CHECK-NEXT: LOG_IEEE * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}},
21;CHECK-NEXT: MUL NON-IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], PS}},
22;CHECK-NEXT: EXP_IEEE * T{{[0-9]+\.[XYZW], PV\.[XYZW]}},
23;CHECK-NEXT: EXP_IEEE * T{{[0-9]+\.[XYZW], PV\.[XYZW]}},
24;CHECK-NEXT: LOG_IEEE * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}},
25;CHECK-NEXT: MUL NON-IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], PS}},
26;CHECK-NEXT: LOG_IEEE * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}},
27;CHECK-NEXT: MUL NON-IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], PS}},
28;CHECK-NEXT: EXP_IEEE * T{{[0-9]+\.[XYZW], PV\.[XYZW]}},
29;CHECK-NEXT: EXP_IEEE * T{{[0-9]+\.[XYZW], PV\.[XYZW]}},
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +000030define amdgpu_ps void @test2(<4 x float> inreg %reg0, <4 x float> inreg %reg1) {
Tom Stellardbfebd1f2014-02-04 17:18:37 +000031 %vec = call <4 x float> @llvm.pow.v4f32( <4 x float> %reg0, <4 x float> %reg1)
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000032 call void @llvm.r600.store.swizzle(<4 x float> %vec, i32 0, i32 0)
Tom Stellardbfebd1f2014-02-04 17:18:37 +000033 ret void
34}
35
Tom Stellard75aadc22012-12-11 21:25:42 +000036declare float @llvm.pow.f32(float ,float ) readonly
Tom Stellardbfebd1f2014-02-04 17:18:37 +000037declare <4 x float> @llvm.pow.v4f32(<4 x float> ,<4 x float> ) readonly
Matt Arsenault82e5e1e2016-07-15 21:27:08 +000038declare void @llvm.r600.store.swizzle(<4 x float>, i32, i32)