blob: c48d52d150b3b68acee7ec15b42ee9253d785c9f [file] [log] [blame]
Matt Arsenaultbef34e22016-01-22 21:30:34 +00001; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
2; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
3
4declare float @llvm.amdgcn.ldexp.f32(float, i32) nounwind readnone
5declare double @llvm.amdgcn.ldexp.f64(double, i32) nounwind readnone
6
7declare float @llvm.AMDGPU.ldexp.f32(float, i32) nounwind readnone
8declare double @llvm.AMDGPU.ldexp.f64(double, i32) nounwind readnone
9
10; SI-LABEL: {{^}}test_ldexp_f32:
11; SI: v_ldexp_f32
12; SI: s_endpgm
13define void @test_ldexp_f32(float addrspace(1)* %out, float %a, i32 %b) nounwind {
14 %result = call float @llvm.amdgcn.ldexp.f32(float %a, i32 %b) nounwind readnone
15 store float %result, float addrspace(1)* %out, align 4
16 ret void
17}
18
19; SI-LABEL: {{^}}test_ldexp_f64:
20; SI: v_ldexp_f64
21; SI: s_endpgm
22define void @test_ldexp_f64(double addrspace(1)* %out, double %a, i32 %b) nounwind {
23 %result = call double @llvm.amdgcn.ldexp.f64(double %a, i32 %b) nounwind readnone
24 store double %result, double addrspace(1)* %out, align 8
25 ret void
26}
27
28; SI-LABEL: {{^}}test_legacy_ldexp_f32:
29; SI: v_ldexp_f32
30; SI: s_endpgm
31define void @test_legacy_ldexp_f32(float addrspace(1)* %out, float %a, i32 %b) nounwind {
32 %result = call float @llvm.AMDGPU.ldexp.f32(float %a, i32 %b) nounwind readnone
33 store float %result, float addrspace(1)* %out, align 4
34 ret void
35}
36
37; SI-LABEL: {{^}}test_legacy_ldexp_f64:
38; SI: v_ldexp_f64
39; SI: s_endpgm
40define void @test_legacy_ldexp_f64(double addrspace(1)* %out, double %a, i32 %b) nounwind {
41 %result = call double @llvm.AMDGPU.ldexp.f64(double %a, i32 %b) nounwind readnone
42 store double %result, double addrspace(1)* %out, align 8
43 ret void
44}