; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py ; RUN: llc -global-isel -new-reg-bank-select -mtriple=amdgcn -mcpu=gfx900 < %s | FileCheck -check-prefix=GFX9 %s declare half @llvm.amdgcn.frexp.mant.f16(half) declare float @llvm.amdgcn.frexp.mant.f32(float) declare double @llvm.amdgcn.frexp.mant.f64(double) define amdgpu_ps half @s_frexp_mant_f16(half inreg %src) { ; GFX9-LABEL: s_frexp_mant_f16: ; GFX9: ; %bb.0: ; GFX9-NEXT: v_frexp_mant_f16_e32 v0, s0 ; GFX9-NEXT: v_add_f16_e32 v0, v0, v0 ; GFX9-NEXT: ; return to shader part epilog %mant = call half @llvm.amdgcn.frexp.mant.f16(half %src) %res = fadd half %mant, %mant ret half %res } define amdgpu_ps half @v_frexp_mant_f16(half %src) { ; GFX9-LABEL: v_frexp_mant_f16: ; GFX9: ; %bb.0: ; GFX9-NEXT: v_frexp_mant_f16_e32 v0, v0 ; GFX9-NEXT: v_add_f16_e32 v0, v0, v0 ; GFX9-NEXT: ; return to shader part epilog %mant = call half @llvm.amdgcn.frexp.mant.f16(half %src) %res = fadd half %mant, %mant ret half %res } define amdgpu_ps float @s_frexp_mant_f32(float inreg %src) { ; GFX9-LABEL: s_frexp_mant_f32: ; GFX9: ; %bb.0: ; GFX9-NEXT: v_frexp_mant_f32_e32 v0, s0 ; GFX9-NEXT: v_add_f32_e32 v0, v0, v0 ; GFX9-NEXT: ; return to shader part epilog %mant = call float @llvm.amdgcn.frexp.mant.f32(float %src) %res = fadd float %mant, %mant ret float %res } define amdgpu_ps float @v_frexp_mant_f32(float %src) { ; GFX9-LABEL: v_frexp_mant_f32: ; GFX9: ; %bb.0: ; GFX9-NEXT: v_frexp_mant_f32_e32 v0, v0 ; GFX9-NEXT: v_add_f32_e32 v0, v0, v0 ; GFX9-NEXT: ; return to shader part epilog %mant = call float @llvm.amdgcn.frexp.mant.f32(float %src) %res = fadd float %mant, %mant ret float %res } define amdgpu_ps double @s_frexp_mant_f64(double inreg %src) { ; GFX9-LABEL: s_frexp_mant_f64: ; GFX9: ; %bb.0: ; GFX9-NEXT: v_frexp_mant_f64_e32 v[0:1], s[0:1] ; GFX9-NEXT: v_add_f64 v[0:1], v[0:1], v[0:1] ; GFX9-NEXT: v_readfirstlane_b32 s0, v0 ; GFX9-NEXT: v_readfirstlane_b32 s1, v1 ; GFX9-NEXT: ; return to shader part epilog %mant = call double @llvm.amdgcn.frexp.mant.f64(double %src) %res = fadd double %mant, %mant ret double %res } define amdgpu_ps double @v_frexp_mant_f64(double %src) { ; GFX9-LABEL: v_frexp_mant_f64: ; GFX9: ; %bb.0: ; GFX9-NEXT: v_frexp_mant_f64_e32 v[0:1], v[0:1] ; GFX9-NEXT: v_add_f64 v[0:1], v[0:1], v[0:1] ; GFX9-NEXT: v_readfirstlane_b32 s0, v0 ; GFX9-NEXT: v_readfirstlane_b32 s1, v1 ; GFX9-NEXT: ; return to shader part epilog %mant = call double @llvm.amdgcn.frexp.mant.f64(double %src) %res = fadd double %mant, %mant ret double %res }