1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s 2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s 3 4 declare float @llvm.amdgcn.ldexp.f32(float, i32) nounwind readnone 5 declare double @llvm.amdgcn.ldexp.f64(double, i32) nounwind readnone 6 7 declare float @llvm.AMDGPU.ldexp.f32(float, i32) nounwind readnone 8 declare 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 13 define 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 22 define 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 31 define 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 40 define 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 } 45 46 ; SI-LABEL: {{^}}test_ldexp_undef_f32: 47 ; SI-NOT: v_ldexp_f32 48 define void @test_ldexp_undef_f32(float addrspace(1)* %out, i32 %b) nounwind { 49 %result = call float @llvm.amdgcn.ldexp.f32(float undef, i32 %b) nounwind readnone 50 store float %result, float addrspace(1)* %out, align 4 51 ret void 52 } 53