blob: 939aaaa045872c4ca02797845c2b4b58179fd3ae [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
; RUN: llc -global-isel=0 -mtriple=amdgpu8.02 < %s | FileCheck -check-prefixes=GCN,GCN-SDAG,VI,VI-SDAG %s
; RUN: llc -global-isel=1 -mtriple=amdgpu8.02 < %s | FileCheck -check-prefixes=GCN,GCN-GISEL,VI,VI-GISEL %s
; RUN: llc -global-isel=0 -mtriple=amdgpu9.00 < %s | FileCheck -check-prefixes=GCN,GCN-SDAG,GFX900,GFX900-SDAG %s
; RUN: llc -global-isel=1 -mtriple=amdgpu9.00 < %s | FileCheck -check-prefixes=GCN,GCN-GISEL,GFX900,GFX900-GISEL %s
; RUN: llc -global-isel=0 -mtriple=amdgpu6.00 < %s | FileCheck -check-prefixes=SI,SI-SDAG %s
; RUN: llc -global-isel=1 -mtriple=amdgpu6.00 < %s | FileCheck -check-prefixes=SI,SI-GISEL %s
; FIXME: Fallback enabled due to bfloat extensions
define amdgpu_kernel void @s_exp10_f32(ptr addrspace(1) %out, float %in) {
; VI-SDAG-LABEL: s_exp10_f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_load_dword s2, s[4:5], 0x2c
; VI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; VI-SDAG-NEXT: s_and_b32 s0, s2, 0xfffff000
; VI-SDAG-NEXT: v_mov_b32_e32 v1, s0
; VI-SDAG-NEXT: v_sub_f32_e32 v1, s2, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v3, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v0, s0, v0
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_mov_b32_e32 v3, 0x3a2784bc
; VI-SDAG-NEXT: v_rndne_f32_e32 v2, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v3, s0, v3
; VI-SDAG-NEXT: v_sub_f32_e32 v0, v0, v2
; VI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; VI-SDAG-NEXT: v_add_f32_e32 v0, v0, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v2
; VI-SDAG-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x24
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_ldexp_f32 v0, v0, v1
; VI-SDAG-NEXT: v_mov_b32_e32 v1, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v1
; VI-SDAG-NEXT: v_mov_b32_e32 v1, 0x421a209b
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v1
; VI-SDAG-NEXT: v_cndmask_b32_e32 v2, v2, v0, vcc
; VI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; VI-SDAG-NEXT: v_mov_b32_e32 v0, s0
; VI-SDAG-NEXT: v_mov_b32_e32 v1, s1
; VI-SDAG-NEXT: flat_store_dword v[0:1], v2
; VI-SDAG-NEXT: s_endpgm
;
; VI-GISEL-LABEL: s_exp10_f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_load_dword s2, s[4:5], 0x2c
; VI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x3a2784bc
; VI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; VI-GISEL-NEXT: s_and_b32 s0, s2, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, s2, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v0, s0, v0
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v3
; VI-GISEL-NEXT: v_mul_f32_e32 v1, s0, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v0, v0, v2
; VI-GISEL-NEXT: v_add_f32_e32 v0, v0, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x24
; VI-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; VI-GISEL-NEXT: v_readfirstlane_b32 s3, v0
; VI-GISEL-NEXT: v_mov_b32_e32 v0, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v0
; VI-GISEL-NEXT: v_mov_b32_e32 v0, 0x421a209b
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v0
; VI-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s3
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s2
; VI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; VI-GISEL-NEXT: v_mov_b32_e32 v0, s0
; VI-GISEL-NEXT: v_mov_b32_e32 v1, s1
; VI-GISEL-NEXT: flat_store_dword v[0:1], v2
; VI-GISEL-NEXT: s_endpgm
;
; GFX900-SDAG-LABEL: s_exp10_f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_load_dword s2, s[4:5], 0x2c
; GFX900-SDAG-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x24
; GFX900-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v2, s2, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-SDAG-NEXT: v_fma_f32 v0, s2, v0, -v2
; GFX900-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-SDAG-NEXT: v_fma_f32 v0, s2, v1, v0
; GFX900-SDAG-NEXT: v_add_f32_e32 v0, v2, v0
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0
; GFX900-SDAG-NEXT: v_ldexp_f32 v0, v0, v1
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v1
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0x421a209b
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v1
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v3, v0, vcc
; GFX900-SDAG-NEXT: global_store_dword v2, v0, s[0:1]
; GFX900-SDAG-NEXT: s_endpgm
;
; GFX900-GISEL-LABEL: s_exp10_f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_load_dword s2, s[4:5], 0x2c
; GFX900-GISEL-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x24
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, s2, v0
; GFX900-GISEL-NEXT: v_fma_f32 v0, s2, v0, -v2
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_fma_f32 v0, s2, v1, v0
; GFX900-GISEL-NEXT: v_sub_f32_e32 v1, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v2
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s3, v0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0x421a209b
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v0
; GFX900-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s3
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, s2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0
; GFX900-GISEL-NEXT: global_store_dword v1, v0, s[0:1]
; GFX900-GISEL-NEXT: s_endpgm
;
; SI-SDAG-LABEL: s_exp10_f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_load_dword s6, s[4:5], 0xb
; SI-SDAG-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9
; SI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
; SI-SDAG-NEXT: s_mov_b32 s3, 0xf000
; SI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v2, s6, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; SI-SDAG-NEXT: v_fma_f32 v0, s6, v0, -v2
; SI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-SDAG-NEXT: v_fma_f32 v0, s6, v1, v0
; SI-SDAG-NEXT: v_add_f32_e32 v0, v2, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: s_mov_b32 s2, -1
; SI-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s6, v1
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0x421a209b
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s6, v1
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v0, vcc
; SI-SDAG-NEXT: buffer_store_dword v0, off, s[0:3], 0
; SI-SDAG-NEXT: s_endpgm
;
; SI-GISEL-LABEL: s_exp10_f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_load_dword s6, s[4:5], 0xb
; SI-GISEL-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; SI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; SI-GISEL-NEXT: v_mul_f32_e32 v2, s6, v0
; SI-GISEL-NEXT: v_fma_f32 v0, s6, v0, -v2
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_fma_f32 v0, s6, v1, v0
; SI-GISEL-NEXT: v_sub_f32_e32 v1, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s6, v2
; SI-GISEL-NEXT: s_or_b64 s[2:3], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_readfirstlane_b32 s4, v0
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0x421a209b
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s6, v0
; SI-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; SI-GISEL-NEXT: s_or_b64 s[2:3], vcc, vcc
; SI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s4
; SI-GISEL-NEXT: v_mov_b32_e32 v0, s2
; SI-GISEL-NEXT: s_mov_b32 s2, -1
; SI-GISEL-NEXT: s_mov_b32 s3, 0xf000
; SI-GISEL-NEXT: buffer_store_dword v0, off, s[0:3], 0
; SI-GISEL-NEXT: s_endpgm
%result = call float @llvm.exp10.f32(float %in)
store float %result, ptr addrspace(1) %out
ret void
}
define amdgpu_kernel void @s_exp10_v2f32(ptr addrspace(1) %out, <2 x float> %in) {
; VI-SDAG-LABEL: s_exp10_v2f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x24
; VI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; VI-SDAG-NEXT: s_and_b32 s4, s3, 0xfffff000
; VI-SDAG-NEXT: v_mov_b32_e32 v2, s4
; VI-SDAG-NEXT: v_sub_f32_e32 v2, s3, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; VI-SDAG-NEXT: v_mov_b32_e32 v4, 0x3a2784bc
; VI-SDAG-NEXT: v_mul_f32_e32 v1, s4, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v5, s4, v4
; VI-SDAG-NEXT: s_and_b32 s4, s2, 0xfffff000
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; VI-SDAG-NEXT: v_mov_b32_e32 v6, s4
; VI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_add_f32_e32 v2, v5, v2
; VI-SDAG-NEXT: v_sub_f32_e32 v6, s2, v6
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v0, s4, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v7, 0x3a2784bc, v6
; VI-SDAG-NEXT: v_mul_f32_e32 v6, 0x40549000, v6
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: v_rndne_f32_e32 v5, v0
; VI-SDAG-NEXT: v_add_f32_e32 v6, v6, v7
; VI-SDAG-NEXT: v_mul_f32_e32 v4, s4, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v0, v0, v5
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v6
; VI-SDAG-NEXT: v_add_f32_e32 v0, v0, v4
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v4, v5
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s3, v2
; VI-SDAG-NEXT: v_mov_b32_e32 v3, 0x421a209b
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v5, 0x7f800000
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s3, v3
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, v5, v1, vcc
; VI-SDAG-NEXT: v_ldexp_f32 v0, v0, v4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v3
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v5, v0, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v3, s1
; VI-SDAG-NEXT: v_mov_b32_e32 v2, s0
; VI-SDAG-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
; VI-SDAG-NEXT: s_endpgm
;
; VI-GISEL-LABEL: s_exp10_v2f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x24
; VI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x3a2784bc
; VI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; VI-GISEL-NEXT: s_and_b32 s4, s2, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s4
; VI-GISEL-NEXT: v_sub_f32_e32 v2, s2, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, s4, v0
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, s4, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v4, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v4, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v4
; VI-GISEL-NEXT: v_add_f32_e32 v2, v3, v2
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; VI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; VI-GISEL-NEXT: v_ldexp_f32 v2, v2, v3
; VI-GISEL-NEXT: v_readfirstlane_b32 s4, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x421a209b
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v3
; VI-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s4
; VI-GISEL-NEXT: s_and_b32 s4, s3, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s4
; VI-GISEL-NEXT: v_sub_f32_e32 v4, s3, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v0, s4, v0
; VI-GISEL-NEXT: v_add_f32_e32 v4, v4, v5
; VI-GISEL-NEXT: v_mul_f32_e32 v1, s4, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v4
; VI-GISEL-NEXT: v_rndne_f32_e32 v4, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v0, v0, v4
; VI-GISEL-NEXT: v_add_f32_e32 v0, v0, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v4
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s3, v2
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s3, v3
; VI-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; VI-GISEL-NEXT: v_readfirstlane_b32 s4, v0
; VI-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s3, 0x7f800000, s4
; VI-GISEL-NEXT: v_mov_b32_e32 v0, s2
; VI-GISEL-NEXT: v_mov_b32_e32 v1, s3
; VI-GISEL-NEXT: v_mov_b32_e32 v3, s1
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s0
; VI-GISEL-NEXT: flat_store_dwordx2 v[2:3], v[0:1]
; VI-GISEL-NEXT: s_endpgm
;
; GFX900-SDAG-LABEL: s_exp10_v2f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x24
; GFX900-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-SDAG-NEXT: v_mov_b32_e32 v5, 0xc23369f4
; GFX900-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v2, s3, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-SDAG-NEXT: v_fma_f32 v4, s3, v0, -v2
; GFX900-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-SDAG-NEXT: v_fma_f32 v4, s3, v1, v4
; GFX900-SDAG-NEXT: v_mul_f32_e32 v6, s2, v0
; GFX900-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v7, v6
; GFX900-SDAG-NEXT: v_fma_f32 v0, s2, v0, -v6
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v2, v2
; GFX900-SDAG-NEXT: v_sub_f32_e32 v8, v6, v7
; GFX900-SDAG-NEXT: v_fma_f32 v0, s2, v1, v0
; GFX900-SDAG-NEXT: v_add_f32_e32 v0, v8, v0
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v6, v7
; GFX900-SDAG-NEXT: v_ldexp_f32 v2, v2, v3
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s3, v5
; GFX900-SDAG-NEXT: v_mov_b32_e32 v3, 0x421a209b
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v7, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s3, v3
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, v7, v2, vcc
; GFX900-SDAG-NEXT: v_ldexp_f32 v0, v0, v6
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v5
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v3
; GFX900-SDAG-NEXT: v_mov_b32_e32 v4, 0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v7, v0, vcc
; GFX900-SDAG-NEXT: global_store_dwordx2 v4, v[0:1], s[0:1]
; GFX900-SDAG-NEXT: s_endpgm
;
; GFX900-GISEL-LABEL: s_exp10_v2f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x24
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, s2, v0
; GFX900-GISEL-NEXT: v_fma_f32 v3, s2, v0, -v2
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v4, v2
; GFX900-GISEL-NEXT: v_fma_f32 v3, s2, v1, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v4
; GFX900-GISEL-NEXT: v_add_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; GFX900-GISEL-NEXT: v_exp_f32_e32 v2, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v4, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v2, v2, v3
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, s3, v0
; GFX900-GISEL-NEXT: v_fma_f32 v0, s3, v0, -v3
; GFX900-GISEL-NEXT: v_fma_f32 v0, s3, v1, v0
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v1, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v1
; GFX900-GISEL-NEXT: v_add_f32_e32 v0, v3, v0
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s4, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s3, v4
; GFX900-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s4
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s4, v0
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s3, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: s_cselect_b32 s3, 0x7f800000, s4
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, s2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, s3
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0
; GFX900-GISEL-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
; GFX900-GISEL-NEXT: s_endpgm
;
; SI-SDAG-LABEL: s_exp10_v2f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x9
; SI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
; SI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; SI-SDAG-NEXT: s_mov_b64 s[4:5], s[2:3]
; SI-SDAG-NEXT: v_mul_f32_e32 v2, s5, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; SI-SDAG-NEXT: v_fma_f32 v4, s5, v0, -v2
; SI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-SDAG-NEXT: v_fma_f32 v4, s5, v1, v4
; SI-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; SI-SDAG-NEXT: v_mul_f32_e32 v5, s4, v0
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; SI-SDAG-NEXT: v_exp_f32_e32 v2, v2
; SI-SDAG-NEXT: v_rndne_f32_e32 v6, v5
; SI-SDAG-NEXT: v_fma_f32 v0, s4, v0, -v5
; SI-SDAG-NEXT: v_sub_f32_e32 v7, v5, v6
; SI-SDAG-NEXT: v_fma_f32 v0, s4, v1, v0
; SI-SDAG-NEXT: v_add_f32_e32 v0, v7, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v5, v6
; SI-SDAG-NEXT: v_ldexp_f32_e32 v2, v2, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v3, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s5, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v4, 0x421a209b
; SI-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v6, 0x7f800000
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s5, v4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, v6, v2, vcc
; SI-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v5
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v3
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v4
; SI-SDAG-NEXT: s_mov_b32 s3, 0xf000
; SI-SDAG-NEXT: s_mov_b32 s2, -1
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v6, v0, vcc
; SI-SDAG-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
; SI-SDAG-NEXT: s_endpgm
;
; SI-GISEL-LABEL: s_exp10_v2f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x9
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; SI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; SI-GISEL-NEXT: v_mul_f32_e32 v2, s2, v0
; SI-GISEL-NEXT: v_fma_f32 v3, s2, v0, -v2
; SI-GISEL-NEXT: v_rndne_f32_e32 v4, v2
; SI-GISEL-NEXT: v_fma_f32 v3, s2, v1, v3
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v4
; SI-GISEL-NEXT: v_add_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; SI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v4, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v4
; SI-GISEL-NEXT: s_or_b64 s[4:5], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v3, s3, v0
; SI-GISEL-NEXT: v_fma_f32 v0, s3, v0, -v3
; SI-GISEL-NEXT: v_fma_f32 v0, s3, v1, v0
; SI-GISEL-NEXT: v_rndne_f32_e32 v1, v3
; SI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v1
; SI-GISEL-NEXT: v_add_f32_e32 v0, v3, v0
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_readfirstlane_b32 s6, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v2
; SI-GISEL-NEXT: s_cselect_b32 s6, 0, s6
; SI-GISEL-NEXT: s_or_b64 s[4:5], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s3, v4
; SI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s6
; SI-GISEL-NEXT: v_readfirstlane_b32 s6, v0
; SI-GISEL-NEXT: s_or_b64 s[4:5], vcc, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s3, v2
; SI-GISEL-NEXT: s_cselect_b32 s6, 0, s6
; SI-GISEL-NEXT: s_or_b64 s[4:5], vcc, vcc
; SI-GISEL-NEXT: s_cselect_b32 s3, 0x7f800000, s6
; SI-GISEL-NEXT: v_mov_b32_e32 v0, s2
; SI-GISEL-NEXT: v_mov_b32_e32 v1, s3
; SI-GISEL-NEXT: s_mov_b32 s2, -1
; SI-GISEL-NEXT: s_mov_b32 s3, 0xf000
; SI-GISEL-NEXT: buffer_store_dwordx2 v[0:1], off, s[0:3], 0
; SI-GISEL-NEXT: s_endpgm
%result = call <2 x float> @llvm.exp10.v2f32(<2 x float> %in)
store <2 x float> %result, ptr addrspace(1) %out
ret void
}
define amdgpu_kernel void @s_exp10_v3f32(ptr addrspace(1) %out, <3 x float> %in) {
; VI-SDAG-LABEL: s_exp10_v3f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; VI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-SDAG-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x24
; VI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; VI-SDAG-NEXT: s_and_b32 s3, s2, 0xfffff000
; VI-SDAG-NEXT: v_mov_b32_e32 v2, s3
; VI-SDAG-NEXT: v_sub_f32_e32 v2, s2, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v1, s3, v0
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; VI-SDAG-NEXT: v_mov_b32_e32 v4, 0x3a2784bc
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, s3, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_add_f32_e32 v2, v5, v2
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_and_b32 s3, s1, 0xfffff000
; VI-SDAG-NEXT: v_mov_b32_e32 v7, s3
; VI-SDAG-NEXT: v_sub_f32_e32 v7, s1, v7
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v2, s3, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v8, 0x3a2784bc, v7
; VI-SDAG-NEXT: v_mul_f32_e32 v7, 0x40549000, v7
; VI-SDAG-NEXT: v_rndne_f32_e32 v6, v2
; VI-SDAG-NEXT: v_add_f32_e32 v7, v7, v8
; VI-SDAG-NEXT: v_mul_f32_e32 v8, s3, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v6
; VI-SDAG-NEXT: v_add_f32_e32 v7, v8, v7
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v7
; VI-SDAG-NEXT: v_exp_f32_e32 v7, v2
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v6, v6
; VI-SDAG-NEXT: v_mov_b32_e32 v3, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v3
; VI-SDAG-NEXT: v_mov_b32_e32 v5, 0x421a209b
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v8, 0x7f800000
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v5
; VI-SDAG-NEXT: s_and_b32 s2, s0, 0xfffff000
; VI-SDAG-NEXT: v_cndmask_b32_e32 v2, v8, v1, vcc
; VI-SDAG-NEXT: v_ldexp_f32 v1, v7, v6
; VI-SDAG-NEXT: v_mov_b32_e32 v7, s2
; VI-SDAG-NEXT: v_sub_f32_e32 v7, s0, v7
; VI-SDAG-NEXT: v_mul_f32_e32 v0, s2, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v9, 0x3a2784bc, v7
; VI-SDAG-NEXT: v_mul_f32_e32 v7, 0x40549000, v7
; VI-SDAG-NEXT: v_rndne_f32_e32 v6, v0
; VI-SDAG-NEXT: v_add_f32_e32 v7, v7, v9
; VI-SDAG-NEXT: v_mul_f32_e32 v4, s2, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v0, v0, v6
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v7
; VI-SDAG-NEXT: v_add_f32_e32 v0, v0, v4
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v4, v6
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s1, v3
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s1, v5
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, v8, v1, vcc
; VI-SDAG-NEXT: v_ldexp_f32 v0, v0, v4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s0, v3
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s0, v5
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v3, s4
; VI-SDAG-NEXT: v_mov_b32_e32 v4, s5
; VI-SDAG-NEXT: flat_store_dwordx3 v[3:4], v[0:2]
; VI-SDAG-NEXT: s_endpgm
;
; VI-GISEL-LABEL: s_exp10_v3f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; VI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x3a2784bc
; VI-GISEL-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x24
; VI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; VI-GISEL-NEXT: s_and_b32 s3, s0, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s3
; VI-GISEL-NEXT: v_sub_f32_e32 v2, s0, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, s3, v0
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, s3, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v4, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v4, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v4
; VI-GISEL-NEXT: v_add_f32_e32 v2, v3, v2
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; VI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; VI-GISEL-NEXT: v_ldexp_f32 v2, v2, v3
; VI-GISEL-NEXT: v_readfirstlane_b32 s3, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x421a209b
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s0, v3
; VI-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s0, 0x7f800000, s3
; VI-GISEL-NEXT: s_and_b32 s3, s1, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s3
; VI-GISEL-NEXT: v_sub_f32_e32 v4, s1, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v6, 0x3a2784bc, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v5, s3, v0
; VI-GISEL-NEXT: v_add_f32_e32 v4, v4, v6
; VI-GISEL-NEXT: v_mul_f32_e32 v6, s3, v1
; VI-GISEL-NEXT: v_add_f32_e32 v4, v6, v4
; VI-GISEL-NEXT: v_rndne_f32_e32 v6, v5
; VI-GISEL-NEXT: v_sub_f32_e32 v5, v5, v6
; VI-GISEL-NEXT: v_add_f32_e32 v4, v5, v4
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; VI-GISEL-NEXT: v_exp_f32_e32 v4, v4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s1, v2
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s1, v3
; VI-GISEL-NEXT: v_ldexp_f32 v4, v4, v5
; VI-GISEL-NEXT: v_readfirstlane_b32 s3, v4
; VI-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s1, 0x7f800000, s3
; VI-GISEL-NEXT: s_and_b32 s3, s2, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s3
; VI-GISEL-NEXT: v_sub_f32_e32 v4, s2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v0, s3, v0
; VI-GISEL-NEXT: v_add_f32_e32 v4, v4, v5
; VI-GISEL-NEXT: v_mul_f32_e32 v1, s3, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v4
; VI-GISEL-NEXT: v_rndne_f32_e32 v4, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v0, v0, v4
; VI-GISEL-NEXT: v_add_f32_e32 v0, v0, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v4
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v2
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v3
; VI-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; VI-GISEL-NEXT: v_readfirstlane_b32 s3, v0
; VI-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s3
; VI-GISEL-NEXT: v_mov_b32_e32 v0, s0
; VI-GISEL-NEXT: v_mov_b32_e32 v1, s1
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s2
; VI-GISEL-NEXT: v_mov_b32_e32 v3, s4
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s5
; VI-GISEL-NEXT: flat_store_dwordx3 v[3:4], v[0:2]
; VI-GISEL-NEXT: s_endpgm
;
; GFX900-SDAG-LABEL: s_exp10_v3f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; GFX900-SDAG-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x24
; GFX900-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-SDAG-NEXT: v_mov_b32_e32 v5, 0x421a209b
; GFX900-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v6, s1, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v7, v6
; GFX900-SDAG-NEXT: v_sub_f32_e32 v8, v6, v7
; GFX900-SDAG-NEXT: v_fma_f32 v6, s1, v0, -v6
; GFX900-SDAG-NEXT: v_fma_f32 v6, s1, v1, v6
; GFX900-SDAG-NEXT: v_mul_f32_e32 v2, s2, v0
; GFX900-SDAG-NEXT: v_add_f32_e32 v6, v8, v6
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-SDAG-NEXT: v_fma_f32 v4, s2, v0, -v2
; GFX900-SDAG-NEXT: v_exp_f32_e32 v6, v6
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v7, v7
; GFX900-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-SDAG-NEXT: v_fma_f32 v4, s2, v1, v4
; GFX900-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v2, v2
; GFX900-SDAG-NEXT: v_ldexp_f32 v6, v6, v7
; GFX900-SDAG-NEXT: v_mul_f32_e32 v7, s0, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v9, v7
; GFX900-SDAG-NEXT: v_fma_f32 v0, s0, v0, -v7
; GFX900-SDAG-NEXT: v_sub_f32_e32 v10, v7, v9
; GFX900-SDAG-NEXT: v_fma_f32 v0, s0, v1, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v2, v2, v3
; GFX900-SDAG-NEXT: v_mov_b32_e32 v3, 0xc23369f4
; GFX900-SDAG-NEXT: v_add_f32_e32 v0, v10, v0
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v7, v9
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v8, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v5
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v2, v8, v2, vcc
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s1, v3
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v6, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s1, v5
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, v8, v1, vcc
; GFX900-SDAG-NEXT: v_ldexp_f32 v0, v0, v7
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s0, v3
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s0, v5
; GFX900-SDAG-NEXT: v_mov_b32_e32 v4, 0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc
; GFX900-SDAG-NEXT: global_store_dwordx3 v4, v[0:2], s[6:7]
; GFX900-SDAG-NEXT: s_endpgm
;
; GFX900-GISEL-LABEL: s_exp10_v3f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; GFX900-GISEL-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x24
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, s0, v0
; GFX900-GISEL-NEXT: v_fma_f32 v3, s0, v0, -v2
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v4, v2
; GFX900-GISEL-NEXT: v_fma_f32 v3, s0, v1, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v4
; GFX900-GISEL-NEXT: v_add_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; GFX900-GISEL-NEXT: v_exp_f32_e32 v2, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v4, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s0, v4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v2, v2, v3
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, s1, v0
; GFX900-GISEL-NEXT: v_fma_f32 v5, s1, v0, -v3
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v6, v3
; GFX900-GISEL-NEXT: v_fma_f32 v5, s1, v1, v5
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v6
; GFX900-GISEL-NEXT: v_add_f32_e32 v3, v3, v5
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; GFX900-GISEL-NEXT: v_exp_f32_e32 v3, v3
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s3, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s0, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v3, v3, v5
; GFX900-GISEL-NEXT: s_cselect_b32 s0, 0x7f800000, s3
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s3, v3
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, s2, v0
; GFX900-GISEL-NEXT: v_fma_f32 v0, s2, v0, -v3
; GFX900-GISEL-NEXT: v_fma_f32 v0, s2, v1, v0
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v1, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v1
; GFX900-GISEL-NEXT: v_add_f32_e32 v0, v3, v0
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s1, v4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s1, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v4
; GFX900-GISEL-NEXT: s_cselect_b32 s1, 0x7f800000, s3
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s3, v0
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s3
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, s0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, s1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, s2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0
; GFX900-GISEL-NEXT: global_store_dwordx3 v3, v[0:2], s[6:7]
; GFX900-GISEL-NEXT: s_endpgm
;
; SI-SDAG-LABEL: s_exp10_v3f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0xd
; SI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x33979a37
; SI-SDAG-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x9
; SI-SDAG-NEXT: s_mov_b32 s7, 0xf000
; SI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v5, s0, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v6, v5
; SI-SDAG-NEXT: v_sub_f32_e32 v7, v5, v6
; SI-SDAG-NEXT: v_fma_f32 v5, s0, v0, -v5
; SI-SDAG-NEXT: v_fma_f32 v5, s0, v2, v5
; SI-SDAG-NEXT: v_mul_f32_e32 v1, s1, v0
; SI-SDAG-NEXT: v_add_f32_e32 v5, v7, v5
; SI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; SI-SDAG-NEXT: v_fma_f32 v4, s1, v0, -v1
; SI-SDAG-NEXT: v_exp_f32_e32 v5, v5
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v6, v6
; SI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_fma_f32 v4, s1, v2, v4
; SI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; SI-SDAG-NEXT: v_ldexp_f32_e32 v5, v5, v6
; SI-SDAG-NEXT: v_mul_f32_e32 v6, s2, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v8, v6
; SI-SDAG-NEXT: v_fma_f32 v0, s2, v0, -v6
; SI-SDAG-NEXT: v_sub_f32_e32 v9, v6, v8
; SI-SDAG-NEXT: v_fma_f32 v0, s2, v2, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v3, 0xc23369f4
; SI-SDAG-NEXT: v_add_f32_e32 v0, v9, v0
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s1, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v4, 0x421a209b
; SI-SDAG-NEXT: v_exp_f32_e32 v2, v0
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v6, v8
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v7, 0x7f800000
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s1, v4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, v7, v1, vcc
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s0, v3
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v5, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s0, v4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v7, v0, vcc
; SI-SDAG-NEXT: v_ldexp_f32_e32 v2, v2, v6
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v3
; SI-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v4
; SI-SDAG-NEXT: s_mov_b32 s6, -1
; SI-SDAG-NEXT: v_cndmask_b32_e32 v2, v7, v2, vcc
; SI-SDAG-NEXT: buffer_store_dword v2, off, s[4:7], 0 offset:8
; SI-SDAG-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
; SI-SDAG-NEXT: s_endpgm
;
; SI-GISEL-LABEL: s_exp10_v3f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0xd
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; SI-GISEL-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x9
; SI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; SI-GISEL-NEXT: v_mul_f32_e32 v2, s0, v0
; SI-GISEL-NEXT: v_fma_f32 v3, s0, v0, -v2
; SI-GISEL-NEXT: v_rndne_f32_e32 v4, v2
; SI-GISEL-NEXT: v_fma_f32 v3, s0, v1, v3
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v4
; SI-GISEL-NEXT: v_add_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; SI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v4, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s0, v4
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v3, s1, v0
; SI-GISEL-NEXT: v_fma_f32 v5, s1, v0, -v3
; SI-GISEL-NEXT: v_rndne_f32_e32 v6, v3
; SI-GISEL-NEXT: v_fma_f32 v5, s1, v1, v5
; SI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v6
; SI-GISEL-NEXT: v_add_f32_e32 v3, v3, v5
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; SI-GISEL-NEXT: v_exp_f32_e32 v3, v3
; SI-GISEL-NEXT: v_readfirstlane_b32 s3, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s0, v2
; SI-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v3, v3, v5
; SI-GISEL-NEXT: s_cselect_b32 s0, 0x7f800000, s3
; SI-GISEL-NEXT: v_readfirstlane_b32 s3, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v3, s2, v0
; SI-GISEL-NEXT: v_fma_f32 v0, s2, v0, -v3
; SI-GISEL-NEXT: v_fma_f32 v0, s2, v1, v0
; SI-GISEL-NEXT: v_rndne_f32_e32 v1, v3
; SI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v1
; SI-GISEL-NEXT: v_add_f32_e32 v0, v3, v0
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s1, v4
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s1, v2
; SI-GISEL-NEXT: s_cselect_b32 s3, 0, s3
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v4
; SI-GISEL-NEXT: s_cselect_b32 s1, 0x7f800000, s3
; SI-GISEL-NEXT: v_readfirstlane_b32 s3, v0
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v2
; SI-GISEL-NEXT: s_cselect_b32 s6, 0, s3
; SI-GISEL-NEXT: s_or_b64 s[2:3], vcc, vcc
; SI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s6
; SI-GISEL-NEXT: v_mov_b32_e32 v0, s0
; SI-GISEL-NEXT: v_mov_b32_e32 v1, s1
; SI-GISEL-NEXT: s_mov_b32 s6, -1
; SI-GISEL-NEXT: s_mov_b32 s7, 0xf000
; SI-GISEL-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
; SI-GISEL-NEXT: s_waitcnt expcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v0, s2
; SI-GISEL-NEXT: buffer_store_dword v0, off, s[4:7], 0 offset:8
; SI-GISEL-NEXT: s_endpgm
%result = call <3 x float> @llvm.exp10.v3f32(<3 x float> %in)
store <3 x float> %result, ptr addrspace(1) %out
ret void
}
define amdgpu_kernel void @s_exp10_v4f32(ptr addrspace(1) %out, <4 x float> %in) {
; VI-SDAG-LABEL: s_exp10_v4f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; VI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-SDAG-NEXT: v_mov_b32_e32 v6, 0x421a209b
; VI-SDAG-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x24
; VI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; VI-SDAG-NEXT: s_and_b32 s6, s3, 0xfffff000
; VI-SDAG-NEXT: v_mov_b32_e32 v2, s6
; VI-SDAG-NEXT: v_sub_f32_e32 v2, s3, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v1, s6, v0
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; VI-SDAG-NEXT: v_mov_b32_e32 v4, 0x3a2784bc
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, s6, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_add_f32_e32 v2, v5, v2
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_and_b32 s6, s2, 0xfffff000
; VI-SDAG-NEXT: v_mov_b32_e32 v7, s6
; VI-SDAG-NEXT: v_sub_f32_e32 v7, s2, v7
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v2, s6, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v8, 0x3a2784bc, v7
; VI-SDAG-NEXT: v_mul_f32_e32 v7, 0x40549000, v7
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v7, v7, v8
; VI-SDAG-NEXT: v_mul_f32_e32 v8, s6, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v7, v8, v7
; VI-SDAG-NEXT: v_mov_b32_e32 v5, 0xc23369f4
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v7
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s3, v5
; VI-SDAG-NEXT: v_exp_f32_e32 v2, v2
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v7, v3
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s3, v6
; VI-SDAG-NEXT: s_and_b32 s3, s1, 0xfffff000
; VI-SDAG-NEXT: v_mov_b32_e32 v9, s3
; VI-SDAG-NEXT: v_mov_b32_e32 v8, 0x7f800000
; VI-SDAG-NEXT: v_sub_f32_e32 v9, s1, v9
; VI-SDAG-NEXT: v_cndmask_b32_e32 v3, v8, v1, vcc
; VI-SDAG-NEXT: v_ldexp_f32 v1, v2, v7
; VI-SDAG-NEXT: v_mul_f32_e32 v2, s3, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v10, 0x3a2784bc, v9
; VI-SDAG-NEXT: v_mul_f32_e32 v9, 0x40549000, v9
; VI-SDAG-NEXT: v_rndne_f32_e32 v7, v2
; VI-SDAG-NEXT: v_add_f32_e32 v9, v9, v10
; VI-SDAG-NEXT: v_mul_f32_e32 v10, s3, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v7
; VI-SDAG-NEXT: v_add_f32_e32 v9, v10, v9
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v9
; VI-SDAG-NEXT: v_exp_f32_e32 v9, v2
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v7, v7
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v5
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v6
; VI-SDAG-NEXT: s_and_b32 s2, s0, 0xfffff000
; VI-SDAG-NEXT: v_cndmask_b32_e32 v2, v8, v1, vcc
; VI-SDAG-NEXT: v_ldexp_f32 v1, v9, v7
; VI-SDAG-NEXT: v_mov_b32_e32 v9, s2
; VI-SDAG-NEXT: v_sub_f32_e32 v9, s0, v9
; VI-SDAG-NEXT: v_mul_f32_e32 v0, s2, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v10, 0x3a2784bc, v9
; VI-SDAG-NEXT: v_mul_f32_e32 v9, 0x40549000, v9
; VI-SDAG-NEXT: v_rndne_f32_e32 v7, v0
; VI-SDAG-NEXT: v_add_f32_e32 v9, v9, v10
; VI-SDAG-NEXT: v_mul_f32_e32 v4, s2, v4
; VI-SDAG-NEXT: v_sub_f32_e32 v0, v0, v7
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v9
; VI-SDAG-NEXT: v_add_f32_e32 v0, v0, v4
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v4, v7
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s1, v5
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s1, v6
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, v8, v1, vcc
; VI-SDAG-NEXT: v_ldexp_f32 v0, v0, v4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s0, v5
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s0, v6
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v4, s4
; VI-SDAG-NEXT: v_mov_b32_e32 v5, s5
; VI-SDAG-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
; VI-SDAG-NEXT: s_endpgm
;
; VI-GISEL-LABEL: s_exp10_v4f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; VI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549000
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x3a2784bc
; VI-GISEL-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x24
; VI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; VI-GISEL-NEXT: s_and_b32 s6, s0, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s6
; VI-GISEL-NEXT: v_sub_f32_e32 v2, s0, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, s6, v0
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, s6, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v4, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v4, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v4
; VI-GISEL-NEXT: v_add_f32_e32 v2, v3, v2
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; VI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; VI-GISEL-NEXT: v_ldexp_f32 v2, v2, v3
; VI-GISEL-NEXT: v_readfirstlane_b32 s6, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x421a209b
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s0, v3
; VI-GISEL-NEXT: s_cselect_b32 s6, 0, s6
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s0, 0x7f800000, s6
; VI-GISEL-NEXT: s_and_b32 s6, s1, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s6
; VI-GISEL-NEXT: v_sub_f32_e32 v4, s1, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v6, 0x3a2784bc, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v5, s6, v0
; VI-GISEL-NEXT: v_add_f32_e32 v4, v4, v6
; VI-GISEL-NEXT: v_mul_f32_e32 v6, s6, v1
; VI-GISEL-NEXT: v_add_f32_e32 v4, v6, v4
; VI-GISEL-NEXT: v_rndne_f32_e32 v6, v5
; VI-GISEL-NEXT: v_sub_f32_e32 v5, v5, v6
; VI-GISEL-NEXT: v_add_f32_e32 v4, v5, v4
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; VI-GISEL-NEXT: v_exp_f32_e32 v4, v4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s1, v2
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s1, v3
; VI-GISEL-NEXT: v_ldexp_f32 v4, v4, v5
; VI-GISEL-NEXT: v_readfirstlane_b32 s6, v4
; VI-GISEL-NEXT: s_cselect_b32 s6, 0, s6
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s1, 0x7f800000, s6
; VI-GISEL-NEXT: s_and_b32 s6, s2, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s6
; VI-GISEL-NEXT: v_sub_f32_e32 v4, s2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v6, 0x3a2784bc, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v5, s6, v0
; VI-GISEL-NEXT: v_add_f32_e32 v4, v4, v6
; VI-GISEL-NEXT: v_mul_f32_e32 v6, s6, v1
; VI-GISEL-NEXT: v_add_f32_e32 v4, v6, v4
; VI-GISEL-NEXT: v_rndne_f32_e32 v6, v5
; VI-GISEL-NEXT: v_sub_f32_e32 v5, v5, v6
; VI-GISEL-NEXT: v_add_f32_e32 v4, v5, v4
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; VI-GISEL-NEXT: v_exp_f32_e32 v4, v4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v2
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v3
; VI-GISEL-NEXT: v_ldexp_f32 v4, v4, v5
; VI-GISEL-NEXT: v_readfirstlane_b32 s6, v4
; VI-GISEL-NEXT: s_cselect_b32 s6, 0, s6
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s6
; VI-GISEL-NEXT: s_and_b32 s6, s3, 0xfffff000
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s6
; VI-GISEL-NEXT: v_sub_f32_e32 v4, s3, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v0, s6, v0
; VI-GISEL-NEXT: v_add_f32_e32 v4, v4, v5
; VI-GISEL-NEXT: v_mul_f32_e32 v1, s6, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v4
; VI-GISEL-NEXT: v_rndne_f32_e32 v4, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v0, v0, v4
; VI-GISEL-NEXT: v_add_f32_e32 v0, v0, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v4
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s3, v2
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s3, v3
; VI-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; VI-GISEL-NEXT: v_readfirstlane_b32 s6, v0
; VI-GISEL-NEXT: s_cselect_b32 s6, 0, s6
; VI-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; VI-GISEL-NEXT: s_cselect_b32 s3, 0x7f800000, s6
; VI-GISEL-NEXT: v_mov_b32_e32 v0, s0
; VI-GISEL-NEXT: v_mov_b32_e32 v1, s1
; VI-GISEL-NEXT: v_mov_b32_e32 v2, s2
; VI-GISEL-NEXT: v_mov_b32_e32 v3, s3
; VI-GISEL-NEXT: v_mov_b32_e32 v4, s4
; VI-GISEL-NEXT: v_mov_b32_e32 v5, s5
; VI-GISEL-NEXT: flat_store_dwordx4 v[4:5], v[0:3]
; VI-GISEL-NEXT: s_endpgm
;
; GFX900-SDAG-LABEL: s_exp10_v4f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; GFX900-SDAG-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x24
; GFX900-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-SDAG-NEXT: v_mov_b32_e32 v5, 0xc23369f4
; GFX900-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v2, s3, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-SDAG-NEXT: v_fma_f32 v4, s3, v0, -v2
; GFX900-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-SDAG-NEXT: v_fma_f32 v4, s3, v1, v4
; GFX900-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v2, v2
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s3, v5
; GFX900-SDAG-NEXT: v_mov_b32_e32 v6, 0x421a209b
; GFX900-SDAG-NEXT: v_mov_b32_e32 v9, 0x7f800000
; GFX900-SDAG-NEXT: v_ldexp_f32 v2, v2, v3
; GFX900-SDAG-NEXT: v_mul_f32_e32 v3, s2, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v7, v3
; GFX900-SDAG-NEXT: v_sub_f32_e32 v8, v3, v7
; GFX900-SDAG-NEXT: v_fma_f32 v3, s2, v0, -v3
; GFX900-SDAG-NEXT: v_fma_f32 v3, s2, v1, v3
; GFX900-SDAG-NEXT: v_add_f32_e32 v3, v8, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v8, v3
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v7, v7
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s3, v6
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v3, v9, v2, vcc
; GFX900-SDAG-NEXT: v_ldexp_f32 v2, v8, v7
; GFX900-SDAG-NEXT: v_mul_f32_e32 v7, s1, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v8, v7
; GFX900-SDAG-NEXT: v_sub_f32_e32 v10, v7, v8
; GFX900-SDAG-NEXT: v_fma_f32 v7, s1, v0, -v7
; GFX900-SDAG-NEXT: v_fma_f32 v7, s1, v1, v7
; GFX900-SDAG-NEXT: v_add_f32_e32 v7, v10, v7
; GFX900-SDAG-NEXT: v_exp_f32_e32 v7, v7
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v8, v8
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v5
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v6
; GFX900-SDAG-NEXT: v_ldexp_f32 v7, v7, v8
; GFX900-SDAG-NEXT: v_mul_f32_e32 v8, s0, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v10, v8
; GFX900-SDAG-NEXT: v_fma_f32 v0, s0, v0, -v8
; GFX900-SDAG-NEXT: v_sub_f32_e32 v11, v8, v10
; GFX900-SDAG-NEXT: v_fma_f32 v0, s0, v1, v0
; GFX900-SDAG-NEXT: v_add_f32_e32 v0, v11, v0
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v8, v10
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v2, v9, v2, vcc
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s1, v5
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v7, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s1, v6
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, v9, v1, vcc
; GFX900-SDAG-NEXT: v_ldexp_f32 v0, v0, v8
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s0, v5
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s0, v6
; GFX900-SDAG-NEXT: v_mov_b32_e32 v4, 0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v9, v0, vcc
; GFX900-SDAG-NEXT: global_store_dwordx4 v4, v[0:3], s[6:7]
; GFX900-SDAG-NEXT: s_endpgm
;
; GFX900-GISEL-LABEL: s_exp10_v4f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x34
; GFX900-GISEL-NEXT: s_load_dwordx2 s[6:7], s[4:5], 0x24
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; GFX900-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, s0, v0
; GFX900-GISEL-NEXT: v_fma_f32 v3, s0, v0, -v2
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v4, v2
; GFX900-GISEL-NEXT: v_fma_f32 v3, s0, v1, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v4
; GFX900-GISEL-NEXT: v_add_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; GFX900-GISEL-NEXT: v_exp_f32_e32 v2, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v4, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s0, v4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v2, v2, v3
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, s1, v0
; GFX900-GISEL-NEXT: v_fma_f32 v5, s1, v0, -v3
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v6, v3
; GFX900-GISEL-NEXT: v_fma_f32 v5, s1, v1, v5
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v6
; GFX900-GISEL-NEXT: v_add_f32_e32 v3, v3, v5
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; GFX900-GISEL-NEXT: v_exp_f32_e32 v3, v3
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s4, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s0, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v3, v3, v5
; GFX900-GISEL-NEXT: s_cselect_b32 s0, 0x7f800000, s4
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s4, v3
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, s2, v0
; GFX900-GISEL-NEXT: v_fma_f32 v5, s2, v0, -v3
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v6, v3
; GFX900-GISEL-NEXT: v_fma_f32 v5, s2, v1, v5
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v6
; GFX900-GISEL-NEXT: v_add_f32_e32 v3, v3, v5
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; GFX900-GISEL-NEXT: v_exp_f32_e32 v3, v3
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s1, v4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s1, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v3, v3, v5
; GFX900-GISEL-NEXT: s_cselect_b32 s1, 0x7f800000, s4
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s4, v3
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, s3, v0
; GFX900-GISEL-NEXT: v_fma_f32 v0, s3, v0, -v3
; GFX900-GISEL-NEXT: v_fma_f32 v0, s3, v1, v0
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v1, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v1
; GFX900-GISEL-NEXT: v_add_f32_e32 v0, v3, v0
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s3, v4
; GFX900-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s4
; GFX900-GISEL-NEXT: v_readfirstlane_b32 s4, v0
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s3, v2
; GFX900-GISEL-NEXT: s_cselect_b32 s4, 0, s4
; GFX900-GISEL-NEXT: s_cmp_lg_u64 vcc, 0
; GFX900-GISEL-NEXT: s_cselect_b32 s3, 0x7f800000, s4
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, s0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, s1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, s2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, s3
; GFX900-GISEL-NEXT: v_mov_b32_e32 v4, 0
; GFX900-GISEL-NEXT: global_store_dwordx4 v4, v[0:3], s[6:7]
; GFX900-GISEL-NEXT: s_endpgm
;
; SI-SDAG-LABEL: s_exp10_v4f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0xd
; SI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
; SI-SDAG-NEXT: v_mov_b32_e32 v5, 0x421a209b
; SI-SDAG-NEXT: v_mov_b32_e32 v8, 0x7f800000
; SI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v2, s3, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; SI-SDAG-NEXT: v_fma_f32 v4, s3, v0, -v2
; SI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-SDAG-NEXT: v_fma_f32 v4, s3, v1, v4
; SI-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; SI-SDAG-NEXT: v_exp_f32_e32 v2, v2
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s3, v4
; SI-SDAG-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x9
; SI-SDAG-NEXT: v_ldexp_f32_e32 v2, v2, v3
; SI-SDAG-NEXT: v_mul_f32_e32 v3, s2, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v6, v3
; SI-SDAG-NEXT: v_sub_f32_e32 v7, v3, v6
; SI-SDAG-NEXT: v_fma_f32 v3, s2, v0, -v3
; SI-SDAG-NEXT: v_fma_f32 v3, s2, v1, v3
; SI-SDAG-NEXT: v_add_f32_e32 v3, v7, v3
; SI-SDAG-NEXT: v_exp_f32_e32 v7, v3
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v6, v6
; SI-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s3, v5
; SI-SDAG-NEXT: v_cndmask_b32_e32 v3, v8, v2, vcc
; SI-SDAG-NEXT: v_ldexp_f32_e32 v2, v7, v6
; SI-SDAG-NEXT: v_mul_f32_e32 v6, s1, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v7, v6
; SI-SDAG-NEXT: v_sub_f32_e32 v9, v6, v7
; SI-SDAG-NEXT: v_fma_f32 v6, s1, v0, -v6
; SI-SDAG-NEXT: v_fma_f32 v6, s1, v1, v6
; SI-SDAG-NEXT: v_add_f32_e32 v6, v9, v6
; SI-SDAG-NEXT: v_exp_f32_e32 v6, v6
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v7, v7
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s2, v4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v2, 0, v2, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s2, v5
; SI-SDAG-NEXT: v_ldexp_f32_e32 v6, v6, v7
; SI-SDAG-NEXT: v_mul_f32_e32 v7, s0, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v9, v7
; SI-SDAG-NEXT: v_fma_f32 v0, s0, v0, -v7
; SI-SDAG-NEXT: v_sub_f32_e32 v10, v7, v9
; SI-SDAG-NEXT: v_fma_f32 v0, s0, v1, v0
; SI-SDAG-NEXT: v_add_f32_e32 v0, v10, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v7, v9
; SI-SDAG-NEXT: v_cndmask_b32_e32 v2, v8, v2, vcc
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s1, v4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v6, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s1, v5
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, v8, v1, vcc
; SI-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v7
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s0, v4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s0, v5
; SI-SDAG-NEXT: s_mov_b32 s7, 0xf000
; SI-SDAG-NEXT: s_mov_b32 s6, -1
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v8, v0, vcc
; SI-SDAG-NEXT: s_waitcnt lgkmcnt(0)
; SI-SDAG-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
; SI-SDAG-NEXT: s_endpgm
;
; SI-GISEL-LABEL: s_exp10_v4f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0xd
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x33979a37
; SI-GISEL-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x9
; SI-GISEL-NEXT: s_waitcnt lgkmcnt(0)
; SI-GISEL-NEXT: v_mul_f32_e32 v2, s0, v0
; SI-GISEL-NEXT: v_fma_f32 v3, s0, v0, -v2
; SI-GISEL-NEXT: v_rndne_f32_e32 v4, v2
; SI-GISEL-NEXT: v_fma_f32 v3, s0, v1, v3
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v4
; SI-GISEL-NEXT: v_add_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; SI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v4, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s0, v4
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v3, s1, v0
; SI-GISEL-NEXT: v_fma_f32 v5, s1, v0, -v3
; SI-GISEL-NEXT: v_rndne_f32_e32 v6, v3
; SI-GISEL-NEXT: v_fma_f32 v5, s1, v1, v5
; SI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v6
; SI-GISEL-NEXT: v_add_f32_e32 v3, v3, v5
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; SI-GISEL-NEXT: v_exp_f32_e32 v3, v3
; SI-GISEL-NEXT: v_readfirstlane_b32 s8, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s0, v2
; SI-GISEL-NEXT: s_cselect_b32 s8, 0, s8
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v3, v3, v5
; SI-GISEL-NEXT: s_cselect_b32 s0, 0x7f800000, s8
; SI-GISEL-NEXT: v_readfirstlane_b32 s8, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v3, s2, v0
; SI-GISEL-NEXT: v_fma_f32 v5, s2, v0, -v3
; SI-GISEL-NEXT: v_rndne_f32_e32 v6, v3
; SI-GISEL-NEXT: v_fma_f32 v5, s2, v1, v5
; SI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v6
; SI-GISEL-NEXT: v_add_f32_e32 v3, v3, v5
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v5, v6
; SI-GISEL-NEXT: v_exp_f32_e32 v3, v3
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s1, v4
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s1, v2
; SI-GISEL-NEXT: s_cselect_b32 s8, 0, s8
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v3, v3, v5
; SI-GISEL-NEXT: s_cselect_b32 s1, 0x7f800000, s8
; SI-GISEL-NEXT: v_readfirstlane_b32 s8, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v3, s3, v0
; SI-GISEL-NEXT: v_fma_f32 v0, s3, v0, -v3
; SI-GISEL-NEXT: v_fma_f32 v0, s3, v1, v0
; SI-GISEL-NEXT: v_rndne_f32_e32 v1, v3
; SI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v1
; SI-GISEL-NEXT: v_add_f32_e32 v0, v3, v0
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s2, v4
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s2, v2
; SI-GISEL-NEXT: s_cselect_b32 s8, 0, s8
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s3, v4
; SI-GISEL-NEXT: s_cselect_b32 s2, 0x7f800000, s8
; SI-GISEL-NEXT: v_readfirstlane_b32 s8, v0
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s3, v2
; SI-GISEL-NEXT: s_cselect_b32 s8, 0, s8
; SI-GISEL-NEXT: s_or_b64 s[6:7], vcc, vcc
; SI-GISEL-NEXT: s_cselect_b32 s3, 0x7f800000, s8
; SI-GISEL-NEXT: v_mov_b32_e32 v0, s0
; SI-GISEL-NEXT: v_mov_b32_e32 v1, s1
; SI-GISEL-NEXT: v_mov_b32_e32 v2, s2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, s3
; SI-GISEL-NEXT: s_mov_b32 s6, -1
; SI-GISEL-NEXT: s_mov_b32 s7, 0xf000
; SI-GISEL-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
; SI-GISEL-NEXT: s_endpgm
%result = call <4 x float> @llvm.exp10.v4f32(<4 x float> %in)
store <4 x float> %result, ptr addrspace(1) %out
ret void
}
define float @v_exp10_f32(float %in) {
; VI-SDAG-LABEL: v_exp10_f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_fabs_f32(float %in) {
; VI-SDAG-LABEL: v_exp10_fabs_f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0x7fffffff, v0
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0x7ffff000, v1
; VI-SDAG-NEXT: v_sub_f32_e64 v4, |v0|, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e64 vcc, |v0|, s4
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_ngt_f32_e64 vcc, |v0|, s4
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_fabs_f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0x7fffffff, v0
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v1
; VI-GISEL-NEXT: v_sub_f32_e64 v2, |v0|, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], |v0|, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; VI-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, |v0|, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_fabs_f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_mul_f32_e64 v1, |v0|, s4
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e64 vcc, |v0|, s4
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e64 vcc, |v0|, s4
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_fabs_f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e64 v2, |v0|, v1
; GFX900-GISEL-NEXT: v_fma_f32 v1, |v0|, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, |v0|, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], |v0|, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, |v0|, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_fabs_f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_mul_f32_e64 v1, |v0|, s4
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_nlt_f32_e64 vcc, |v0|, s4
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_ngt_f32_e64 vcc, |v0|, s4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_fabs_f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e64 v2, |v0|, v1
; SI-GISEL-NEXT: v_fma_f32 v1, |v0|, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, |v0|, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], |v0|, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; SI-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, |v0|, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fabs = call float @llvm.fabs.f32(float %in)
%result = call float @llvm.exp10.f32(float %fabs)
ret float %result
}
define float @v_exp10_fneg_fabs_f32(float %in) {
; VI-SDAG-LABEL: v_exp10_fneg_fabs_f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_or_b32_e32 v1, 0x80000000, v0
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v1
; VI-SDAG-NEXT: v_sub_f32_e64 v4, -|v0|, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0x423369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e64 vcc, |v0|, s4
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc21a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e64 vcc, |v0|, s4
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_fneg_fabs_f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_or_b32_e32 v1, 0x80000000, v0
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v1
; VI-GISEL-NEXT: v_sub_f32_e64 v2, -|v0|, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], -|v0|, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; VI-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, -|v0|, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_fneg_fabs_f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc0549a78
; GFX900-SDAG-NEXT: v_mul_f32_e64 v1, |v0|, s4
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xb3979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x423369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e64 vcc, |v0|, s4
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc21a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e64 vcc, |v0|, s4
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_fneg_fabs_f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e64 v2, -|v0|, v1
; GFX900-GISEL-NEXT: v_fma_f32 v1, -|v0|, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, -|v0|, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], -|v0|, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, -|v0|, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_fneg_fabs_f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc0549a78
; SI-SDAG-NEXT: v_mul_f32_e64 v1, |v0|, s4
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0xb3979a37
; SI-SDAG-NEXT: v_fma_f32 v1, |v0|, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0x423369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e64 vcc, |v0|, s4
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc21a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e64 vcc, |v0|, s4
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_fneg_fabs_f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e64 v2, -|v0|, v1
; SI-GISEL-NEXT: v_fma_f32 v1, -|v0|, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, -|v0|, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], -|v0|, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; SI-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, -|v0|, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fabs = call float @llvm.fabs.f32(float %in)
%fneg.fabs = fneg float %fabs
%result = call float @llvm.exp10.f32(float %fneg.fabs)
ret float %result
}
define float @v_exp10_fneg_f32(float %in) {
; VI-SDAG-LABEL: v_exp10_fneg_f32:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_xor_b32_e32 v1, 0x80000000, v0
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v1
; VI-SDAG-NEXT: v_sub_f32_e64 v4, -v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0x423369f4
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc21a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_fneg_f32:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_xor_b32_e32 v1, 0x80000000, v0
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v1
; VI-GISEL-NEXT: v_sub_f32_e64 v2, -v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], -v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; VI-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, -v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_fneg_f32:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0xc0549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc0549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xb3979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x423369f4
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc21a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_fneg_f32:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e64 v2, -v0, v1
; GFX900-GISEL-NEXT: v_fma_f32 v1, -v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, -v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], -v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, -v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_fneg_f32:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0xc0549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc0549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0xb3979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0x423369f4
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc21a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_fneg_f32:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e64 v2, -v0, v1
; SI-GISEL-NEXT: v_fma_f32 v1, -v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, -v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e64 s[4:5], -v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, s[4:5]
; SI-GISEL-NEXT: v_cmp_gt_f32_e64 vcc, -v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fneg = fneg float %in
%result = call float @llvm.exp10.f32(float %fneg)
ret float %result
}
define float @v_exp10_f32_fast(float %in) {
; GCN-SDAG-LABEL: v_exp10_f32_fast:
; GCN-SDAG: ; %bb.0:
; GCN-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; GCN-SDAG-NEXT: v_add_f32_e32 v1, 0x42000000, v0
; GCN-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, s4, v0
; GCN-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GCN-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GCN-GISEL-LABEL: v_exp10_f32_fast:
; GCN-GISEL: ; %bb.0:
; GCN-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; GCN-GISEL-NEXT: v_add_f32_e32 v2, 0x42000000, v0
; GCN-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v1
; GCN-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GCN-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_fast:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; SI-SDAG-NEXT: v_add_f32_e32 v1, 0x42000000, v0
; SI-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_fast:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; SI-GISEL-NEXT: v_add_f32_e32 v2, 0x42000000, v0
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v1
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call fast float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_ninf(float %in) {
; VI-SDAG-LABEL: v_exp10_f32_ninf:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_ninf:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_ninf:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_ninf:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_ninf:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_ninf:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call ninf float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_afn(float %in) {
; GCN-SDAG-LABEL: v_exp10_f32_afn:
; GCN-SDAG: ; %bb.0:
; GCN-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; GCN-SDAG-NEXT: v_add_f32_e32 v1, 0x42000000, v0
; GCN-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, s4, v0
; GCN-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GCN-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GCN-GISEL-LABEL: v_exp10_f32_afn:
; GCN-GISEL: ; %bb.0:
; GCN-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; GCN-GISEL-NEXT: v_add_f32_e32 v2, 0x42000000, v0
; GCN-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v1
; GCN-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GCN-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_afn:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; SI-SDAG-NEXT: v_add_f32_e32 v1, 0x42000000, v0
; SI-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_afn:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; SI-GISEL-NEXT: v_add_f32_e32 v2, 0x42000000, v0
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v1
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call afn float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_afn_daz(float %in) #0 {
; GCN-LABEL: v_exp10_f32_afn_daz:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-NEXT: v_exp_f32_e32 v1, v1
; GCN-NEXT: v_exp_f32_e32 v0, v0
; GCN-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_f32_afn_daz:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-NEXT: v_exp_f32_e32 v1, v1
; SI-NEXT: v_exp_f32_e32 v0, v0
; SI-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-NEXT: s_setpc_b64 s[30:31]
%result = call afn float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_afn_dynamic(float %in) #1 {
; GCN-SDAG-LABEL: v_exp10_f32_afn_dynamic:
; GCN-SDAG: ; %bb.0:
; GCN-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; GCN-SDAG-NEXT: v_add_f32_e32 v1, 0x42000000, v0
; GCN-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, s4, v0
; GCN-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GCN-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GCN-GISEL-LABEL: v_exp10_f32_afn_dynamic:
; GCN-GISEL: ; %bb.0:
; GCN-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; GCN-GISEL-NEXT: v_add_f32_e32 v2, 0x42000000, v0
; GCN-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v1
; GCN-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GCN-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_afn_dynamic:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; SI-SDAG-NEXT: v_add_f32_e32 v1, 0x42000000, v0
; SI-SDAG-NEXT: v_cmp_gt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_afn_dynamic:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; SI-GISEL-NEXT: v_add_f32_e32 v2, 0x42000000, v0
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v1
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call afn float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_fabs_exp10_f32_afn(float %in) {
; GCN-SDAG-LABEL: v_fabs_exp10_f32_afn:
; GCN-SDAG: ; %bb.0:
; GCN-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; GCN-SDAG-NEXT: s_mov_b32 s5, 0x42000000
; GCN-SDAG-NEXT: v_add_f32_e64 v1, |v0|, s5
; GCN-SDAG-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
; GCN-SDAG-NEXT: v_cndmask_b32_e64 v0, |v0|, v1, vcc
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GCN-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GCN-GISEL-LABEL: v_fabs_exp10_f32_afn:
; GCN-GISEL: ; %bb.0:
; GCN-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; GCN-GISEL-NEXT: v_mov_b32_e32 v2, 0x42000000
; GCN-GISEL-NEXT: v_add_f32_e64 v2, |v0|, v2
; GCN-GISEL-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, v1
; GCN-GISEL-NEXT: v_cndmask_b32_e64 v0, |v0|, v2, vcc
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GCN-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; GCN-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; GCN-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_fabs_exp10_f32_afn:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc217b818
; SI-SDAG-NEXT: s_mov_b32 s5, 0x42000000
; SI-SDAG-NEXT: v_add_f32_e64 v1, |v0|, s5
; SI-SDAG-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, s4
; SI-SDAG-NEXT: v_cndmask_b32_e64 v0, |v0|, v1, vcc
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_fabs_exp10_f32_afn:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc217b818
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x42000000
; SI-GISEL-NEXT: v_add_f32_e64 v2, |v0|, v2
; SI-GISEL-NEXT: v_cmp_lt_f32_e64 vcc, |v0|, v1
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, |v0|, v2, vcc
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0xa4fb11f, v0
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v1, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fabs = call float @llvm.fabs.f32(float %in)
%result = call afn float @llvm.exp10.f32(float %fabs)
ret float %result
}
define float @v_exp10_f32_daz(float %in) #0 {
; VI-SDAG-LABEL: v_exp10_f32_daz:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_daz:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_daz:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_daz:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_daz:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_daz:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_nnan(float %in) {
; VI-SDAG-LABEL: v_exp10_f32_nnan:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_nnan:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_nnan:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_nnan:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_nnan:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_nnan:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call nnan float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_nnan_daz(float %in) #0 {
; VI-SDAG-LABEL: v_exp10_f32_nnan_daz:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_nnan_daz:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_nnan_daz:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_nnan_daz:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_nnan_daz:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_nnan_daz:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call nnan float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_nnan_dynamic(float %in) #1 {
; VI-SDAG-LABEL: v_exp10_f32_nnan_dynamic:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_nnan_dynamic:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_nnan_dynamic:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_nnan_dynamic:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_nnan_dynamic:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_nnan_dynamic:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call nnan float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_ninf_daz(float %in) #0 {
; VI-SDAG-LABEL: v_exp10_f32_ninf_daz:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_ninf_daz:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_ninf_daz:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_ninf_daz:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_ninf_daz:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_ninf_daz:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call ninf float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_ninf_dynamic(float %in) #1 {
; VI-SDAG-LABEL: v_exp10_f32_ninf_dynamic:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_ninf_dynamic:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_ninf_dynamic:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_ninf_dynamic:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_ninf_dynamic:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_ninf_dynamic:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call ninf float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_nnan_ninf(float %in) {
; VI-SDAG-LABEL: v_exp10_f32_nnan_ninf:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_nnan_ninf:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_nnan_ninf:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_nnan_ninf:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_nnan_ninf:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_nnan_ninf:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call nnan ninf float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_nnan_ninf_daz(float %in) #0 {
; VI-SDAG-LABEL: v_exp10_f32_nnan_ninf_daz:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_nnan_ninf_daz:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_nnan_ninf_daz:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_nnan_ninf_daz:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_nnan_ninf_daz:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_nnan_ninf_daz:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call nnan ninf float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_nnan_ninf_dynamic(float %in) #1 {
; VI-SDAG-LABEL: v_exp10_f32_nnan_ninf_dynamic:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_nnan_ninf_dynamic:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_nnan_ninf_dynamic:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_nnan_ninf_dynamic:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_nnan_ninf_dynamic:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_nnan_ninf_dynamic:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call nnan ninf float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_fast_daz(float %in) #0 {
; GCN-LABEL: v_exp10_f32_fast_daz:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-NEXT: v_exp_f32_e32 v1, v1
; GCN-NEXT: v_exp_f32_e32 v0, v0
; GCN-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_f32_fast_daz:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-NEXT: v_exp_f32_e32 v1, v1
; SI-NEXT: v_exp_f32_e32 v0, v0
; SI-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-NEXT: s_setpc_b64 s[30:31]
%result = call fast float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_dynamic_mode(float %in) #1 {
; VI-SDAG-LABEL: v_exp10_f32_dynamic_mode:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_dynamic_mode:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_dynamic_mode:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_dynamic_mode:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_dynamic_mode:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_dynamic_mode:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_undef() {
; GCN-LABEL: v_exp10_f32_undef:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_f32_undef:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: s_setpc_b64 s[30:31]
%result = call float @llvm.exp10.f32(float poison)
ret float %result
}
define float @v_exp10_f32_0() {
; GCN-LABEL: v_exp10_f32_0:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: v_mov_b32_e32 v0, 1.0
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_f32_0:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: v_mov_b32_e32 v0, 1.0
; SI-NEXT: s_setpc_b64 s[30:31]
%result = call float @llvm.exp10.f32(float 0.0)
ret float %result
}
define float @v_exp10_f32_from_fpext_f16(i16 %src.i) {
; VI-SDAG-LABEL: v_exp10_f32_from_fpext_f16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v3, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v3
; VI-SDAG-NEXT: v_mul_f32_e32 v3, 0x40549000, v3
; VI-SDAG-NEXT: v_rndne_f32_e32 v4, v2
; VI-SDAG-NEXT: v_add_f32_e32 v3, v3, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v4
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_from_fpext_f16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_from_fpext_f16:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: s_mov_b32 s5, 0x33979a37
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_fma_f32 v3, v0, s4, -v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v1, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v3, v0, s5, v3
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v1, v3
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_from_fpext_f16:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v3
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v4, v3
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v2, v1
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v3, v4
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v4
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v3
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_from_fpext_f16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: s_mov_b32 s5, 0x33979a37
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_fma_f32 v3, v0, s4, -v1
; SI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v3, v0, s5, v3
; SI-SDAG-NEXT: v_add_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_from_fpext_f16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
; SI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v3
; SI-GISEL-NEXT: v_rndne_f32_e32 v4, v3
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v2, v1
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v3, v4
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v4
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v3
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%src = bitcast i16 %src.i to half
%fpext = fpext half %src to float
%result = call float @llvm.exp10.f32(float %fpext)
ret float %result
}
define float @v_exp10_f32_from_fpext_math_f16(i16 %src0.i, i16 %src1.i) {
; VI-SDAG-LABEL: v_exp10_f32_from_fpext_math_f16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_add_f16_e32 v0, v0, v1
; VI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v3, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549000, v1
; VI-SDAG-NEXT: v_add_f32_e32 v2, v3, v2
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_from_fpext_math_f16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_add_f16_e32 v0, v0, v1
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_from_fpext_math_f16:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_add_f16_e32 v0, v0, v1
; GFX900-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: s_mov_b32 s5, 0x33979a37
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: v_fma_f32 v2, v0, s4, -v1
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; GFX900-SDAG-NEXT: v_fma_f32 v2, v0, s5, v2
; GFX900-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_from_fpext_math_f16:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_add_f16_e32 v0, v0, v1
; GFX900-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v3
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v2, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_from_fpext_math_f16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: s_mov_b32 s5, 0x33979a37
; SI-SDAG-NEXT: v_add_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: v_fma_f32 v2, v0, s4, -v1
; SI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; SI-SDAG-NEXT: v_fma_f32 v2, v0, s5, v2
; SI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: s_mov_b32 s5, 0x421a209b
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s5, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_from_fpext_math_f16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
; SI-GISEL-NEXT: v_mov_b32_e32 v5, 0x7f800000
; SI-GISEL-NEXT: v_add_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v3
; SI-GISEL-NEXT: v_rndne_f32_e32 v4, v3
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v2, v1
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v3, v4
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_mov_b32_e32 v4, 0x421a209b
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v3
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v4
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v5, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%src0 = bitcast i16 %src0.i to half
%src1 = bitcast i16 %src1.i to half
%fadd = fadd half %src0, %src1
%fpext = fpext half %fadd to float
%result = call float @llvm.exp10.f32(float %fpext)
ret float %result
}
define float @v_exp10_f32_from_fpext_bf16(bfloat %src) {
; VI-SDAG-LABEL: v_exp10_f32_from_fpext_bf16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v3, v0, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549000, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v3
; VI-SDAG-NEXT: v_mul_f32_e32 v3, 0x40549000, v3
; VI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; VI-SDAG-NEXT: v_add_f32_e32 v3, v3, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v2
; VI-SDAG-NEXT: v_add_f32_e32 v3, v4, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_from_fpext_bf16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v1, v0, v0
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549000, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v0
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v3
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x3a2784bc, v0
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_from_fpext_bf16:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: v_fma_f32 v2, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; GFX900-SDAG-NEXT: v_fma_f32 v2, v0, s4, v2
; GFX900-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_from_fpext_bf16:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_from_fpext_bf16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: v_fma_f32 v2, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; SI-SDAG-NEXT: v_fma_f32 v2, v0, s4, v2
; SI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_from_fpext_bf16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fpext = fpext bfloat %src to float
%result = call float @llvm.exp10.f32(float %fpext)
ret float %result
}
define float @v_exp10_f32_from_fpext_math_f16_fast(i16 %src0.i, i16 %src1.i) {
; GCN-LABEL: v_exp10_f32_from_fpext_math_f16_fast:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: v_add_f16_e32 v0, v0, v1
; GCN-NEXT: v_cvt_f32_f16_e32 v0, v0
; GCN-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; GCN-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; GCN-NEXT: v_exp_f32_e32 v1, v1
; GCN-NEXT: v_exp_f32_e32 v0, v0
; GCN-NEXT: v_mul_f32_e32 v0, v0, v1
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_from_fpext_math_f16_fast:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_add_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_from_fpext_math_f16_fast:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_add_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%src0 = bitcast i16 %src0.i to half
%src1 = bitcast i16 %src1.i to half
%fadd = fadd half %src0, %src1
%fpext = fpext half %fadd to float
%result = call fast float @llvm.exp10.f32(float %fpext)
ret float %result
}
define float @v_exp10_f32_from_fpext_math_f16_daz(i16 %src0.i, i16 %src1.i) #0 {
; VI-SDAG-LABEL: v_exp10_f32_from_fpext_math_f16_daz:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_add_f16_e32 v0, v0, v1
; VI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v3, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_add_f32_e32 v2, v2, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549000, v1
; VI-SDAG-NEXT: v_add_f32_e32 v2, v3, v2
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_from_fpext_math_f16_daz:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_add_f16_e32 v0, v0, v1
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_from_fpext_math_f16_daz:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_add_f16_e32 v0, v0, v1
; GFX900-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: s_mov_b32 s5, 0x33979a37
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: v_fma_f32 v2, v0, s4, -v1
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; GFX900-SDAG-NEXT: v_fma_f32 v2, v0, s5, v2
; GFX900-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_from_fpext_math_f16_daz:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_add_f16_e32 v0, v0, v1
; GFX900-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
; GFX900-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v3
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v2, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_from_fpext_math_f16_daz:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: s_mov_b32 s5, 0x33979a37
; SI-SDAG-NEXT: v_add_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: v_fma_f32 v2, v0, s4, -v1
; SI-SDAG-NEXT: v_rndne_f32_e32 v3, v1
; SI-SDAG-NEXT: v_fma_f32 v2, v0, s5, v2
; SI-SDAG-NEXT: v_sub_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_add_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v3, v3
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: s_mov_b32 s5, 0x421a209b
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s5, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_from_fpext_math_f16_daz:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
; SI-GISEL-NEXT: v_mov_b32_e32 v5, 0x7f800000
; SI-GISEL-NEXT: v_add_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v3
; SI-GISEL-NEXT: v_rndne_f32_e32 v4, v3
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v2, v1
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v3, v4
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v3, v4
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_mov_b32_e32 v4, 0x421a209b
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v3
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v4
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v5, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%src0 = bitcast i16 %src0.i to half
%src1 = bitcast i16 %src1.i to half
%fadd = fadd half %src0, %src1
%fpext = fpext half %fadd to float
%result = call float @llvm.exp10.f32(float %fpext)
ret float %result
}
; FIXME: Fold out fp16_to_fp (FP_TO_FP16) on no-f16 targets
define half @v_exp10_f16(half %in) {
; GCN-LABEL: v_exp10_f16:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: v_cvt_f32_f16_e32 v0, v0
; GCN-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GCN-NEXT: v_exp_f32_e32 v0, v0
; GCN-NEXT: v_cvt_f16_f32_e32 v0, v0
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_f16:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-NEXT: v_exp_f32_e32 v0, v0
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-NEXT: s_setpc_b64 s[30:31]
%result = call half @llvm.exp10.f16(half %in)
ret half %result
}
define half @v_exp10_fabs_f16(half %in) {
; GCN-LABEL: v_exp10_fabs_f16:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: v_cvt_f32_f16_e64 v0, |v0|
; GCN-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GCN-NEXT: v_exp_f32_e32 v0, v0
; GCN-NEXT: v_cvt_f16_f32_e32 v0, v0
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_fabs_f16:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: v_cvt_f32_f16_e64 v0, |v0|
; SI-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-NEXT: v_exp_f32_e32 v0, v0
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-NEXT: s_setpc_b64 s[30:31]
%fabs = call half @llvm.fabs.f16(half %in)
%result = call half @llvm.exp10.f16(half %fabs)
ret half %result
}
define half @v_exp10_fneg_fabs_f16(half %in) {
; GCN-SDAG-LABEL: v_exp10_fneg_fabs_f16:
; GCN-SDAG: ; %bb.0:
; GCN-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-SDAG-NEXT: v_cvt_f32_f16_e64 v0, |v0|
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, 0xc0549a78, v0
; GCN-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GCN-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; GCN-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GCN-GISEL-LABEL: v_exp10_fneg_fabs_f16:
; GCN-GISEL: ; %bb.0:
; GCN-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-GISEL-NEXT: v_cvt_f32_f16_e64 v0, -|v0|
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GCN-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GCN-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; GCN-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_fneg_fabs_f16:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: v_cvt_f32_f16_e64 v0, -|v0|
; SI-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-NEXT: v_exp_f32_e32 v0, v0
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-NEXT: s_setpc_b64 s[30:31]
%fabs = call half @llvm.fabs.f16(half %in)
%fneg.fabs = fneg half %fabs
%result = call half @llvm.exp10.f16(half %fneg.fabs)
ret half %result
}
define half @v_exp10_fneg_f16(half %in) {
; GCN-SDAG-LABEL: v_exp10_fneg_f16:
; GCN-SDAG: ; %bb.0:
; GCN-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; GCN-SDAG-NEXT: v_mul_f32_e32 v0, 0xc0549a78, v0
; GCN-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GCN-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; GCN-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GCN-GISEL-LABEL: v_exp10_fneg_f16:
; GCN-GISEL: ; %bb.0:
; GCN-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-GISEL-NEXT: v_cvt_f32_f16_e64 v0, -v0
; GCN-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GCN-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GCN-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; GCN-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-LABEL: v_exp10_fneg_f16:
; SI: ; %bb.0:
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-NEXT: v_cvt_f32_f16_e64 v0, -v0
; SI-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-NEXT: v_exp_f32_e32 v0, v0
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-NEXT: s_setpc_b64 s[30:31]
%fneg = fneg half %in
%result = call half @llvm.exp10.f16(half %fneg)
ret half %result
}
define half @v_exp10_f16_fast(half %in) {
; GCN-LABEL: v_exp10_f16_fast:
; GCN: ; %bb.0:
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GCN-NEXT: v_mul_f16_e32 v1, 0x113c, v0
; GCN-NEXT: v_mul_f16_e32 v0, 0x42a4, v0
; GCN-NEXT: v_exp_f16_e32 v1, v1
; GCN-NEXT: v_exp_f16_e32 v0, v0
; GCN-NEXT: v_mul_f16_e32 v0, v0, v1
; GCN-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f16_fast:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a278000, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40548000, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f16_fast:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a278000, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40548000, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call fast half @llvm.exp10.f16(half %in)
ret half %result
}
define <2 x half> @v_exp10_v2f16(<2 x half> %in) {
; VI-SDAG-LABEL: v_exp10_v2f16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_cvt_f32_f16_sdwa v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_f16_f32_sdwa v1, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD
; VI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_v2f16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 16
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; VI-GISEL-NEXT: v_lshlrev_b32_sdwa v0, v2, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
; VI-GISEL-NEXT: v_or_b32_sdwa v0, v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-LABEL: v_exp10_v2f16:
; GFX900: ; %bb.0:
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-NEXT: v_cvt_f32_f16_e32 v1, v0
; GFX900-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-NEXT: v_exp_f32_e32 v1, v1
; GFX900-NEXT: v_exp_f32_e32 v0, v0
; GFX900-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_v2f16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
; SI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_v2f16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; SI-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; SI-GISEL-NEXT: v_bfe_u32 v0, v0, 0, 16
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_or_b32_e32 v0, v1, v0
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call <2 x half> @llvm.exp10.v2f16(<2 x half> %in)
ret <2 x half> %result
}
define <2 x half> @v_exp10_fabs_v2f16(<2 x half> %in) {
; VI-SDAG-LABEL: v_exp10_fabs_v2f16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_cvt_f32_f16_sdwa v1, |v0| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-SDAG-NEXT: v_cvt_f32_f16_e64 v0, |v0|
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_f16_f32_sdwa v1, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD
; VI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_fabs_v2f16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v0, 0x7fff7fff, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 16
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; VI-GISEL-NEXT: v_lshlrev_b32_sdwa v0, v2, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
; VI-GISEL-NEXT: v_or_b32_sdwa v0, v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_fabs_v2f16:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_cvt_f32_f16_e64 v1, |v0|
; GFX900-SDAG-NEXT: v_cvt_f32_f16_sdwa v0, |v0| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_fabs_v2f16:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_and_b32_e32 v0, 0x7fff7fff, v0
; GFX900-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; GFX900-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_fabs_v2f16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e64 v1, |v1|
; SI-SDAG-NEXT: v_cvt_f32_f16_e64 v0, |v0|
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
; SI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_fabs_v2f16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_and_b32_e32 v0, 0x7fff7fff, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; SI-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; SI-GISEL-NEXT: v_bfe_u32 v0, v0, 0, 16
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_or_b32_e32 v0, v1, v0
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fabs = call <2 x half> @llvm.fabs.v2f16(<2 x half> %in)
%result = call <2 x half> @llvm.exp10.v2f16(<2 x half> %fabs)
ret <2 x half> %result
}
define <2 x half> @v_exp10_fneg_fabs_v2f16(<2 x half> %in) {
; VI-SDAG-LABEL: v_exp10_fneg_fabs_v2f16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_cvt_f32_f16_sdwa v1, -|v0| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-SDAG-NEXT: v_cvt_f32_f16_e64 v0, -|v0|
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_f16_f32_sdwa v1, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD
; VI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_fneg_fabs_v2f16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_or_b32_e32 v0, 0x80008000, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 16
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; VI-GISEL-NEXT: v_lshlrev_b32_sdwa v0, v2, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
; VI-GISEL-NEXT: v_or_b32_sdwa v0, v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_fneg_fabs_v2f16:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_cvt_f32_f16_e64 v1, -|v0|
; GFX900-SDAG-NEXT: v_cvt_f32_f16_sdwa v0, -|v0| dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_fneg_fabs_v2f16:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_or_b32_e32 v0, 0x80008000, v0
; GFX900-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; GFX900-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_fneg_fabs_v2f16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_or_b32_e32 v0, 0x80008000, v0
; SI-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
; SI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_fneg_fabs_v2f16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_or_b32_e32 v0, 0x80008000, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; SI-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; SI-GISEL-NEXT: v_bfe_u32 v0, v0, 0, 16
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_or_b32_e32 v0, v1, v0
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fabs = call <2 x half> @llvm.fabs.v2f16(<2 x half> %in)
%fneg.fabs = fneg <2 x half> %fabs
%result = call <2 x half> @llvm.exp10.v2f16(<2 x half> %fneg.fabs)
ret <2 x half> %result
}
define <2 x half> @v_exp10_fneg_v2f16(<2 x half> %in) {
; VI-SDAG-LABEL: v_exp10_fneg_v2f16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_cvt_f32_f16_sdwa v1, -v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-SDAG-NEXT: v_cvt_f32_f16_e64 v0, -v0
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_cvt_f16_f32_sdwa v1, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD
; VI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_fneg_v2f16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_xor_b32_e32 v0, 0x80008000, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 16
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; VI-GISEL-NEXT: v_lshlrev_b32_sdwa v0, v2, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
; VI-GISEL-NEXT: v_or_b32_sdwa v0, v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_fneg_v2f16:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_cvt_f32_f16_e64 v1, -v0
; GFX900-SDAG-NEXT: v_cvt_f32_f16_sdwa v0, -v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-SDAG-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_fneg_v2f16:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_xor_b32_e32 v0, 0x80008000, v0
; GFX900-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; GFX900-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-GISEL-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_fneg_v2f16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_xor_b32_e32 v0, 0x80008000, v0
; SI-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
; SI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_fneg_v2f16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_xor_b32_e32 v0, 0x80008000, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; SI-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; SI-GISEL-NEXT: v_bfe_u32 v0, v0, 0, 16
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_or_b32_e32 v0, v1, v0
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%fneg = fneg <2 x half> %in
%result = call <2 x half> @llvm.exp10.v2f16(<2 x half> %fneg)
ret <2 x half> %result
}
define <2 x half> @v_exp10_v2f16_fast(<2 x half> %in) {
; VI-SDAG-LABEL: v_exp10_v2f16_fast:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_mov_b32_e32 v1, 0x113c
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x42a4
; VI-SDAG-NEXT: v_mul_f16_sdwa v1, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-SDAG-NEXT: v_mul_f16_sdwa v2, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-SDAG-NEXT: v_mul_f16_e32 v3, 0x113c, v0
; VI-SDAG-NEXT: v_mul_f16_e32 v0, 0x42a4, v0
; VI-SDAG-NEXT: v_exp_f16_e32 v1, v1
; VI-SDAG-NEXT: v_exp_f16_e32 v2, v2
; VI-SDAG-NEXT: v_exp_f16_e32 v3, v3
; VI-SDAG-NEXT: v_exp_f16_e32 v0, v0
; VI-SDAG-NEXT: v_mul_f16_sdwa v1, v2, v1 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
; VI-SDAG-NEXT: v_mul_f16_e32 v0, v0, v3
; VI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_v2f16_fast:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x113c
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x42a4
; VI-GISEL-NEXT: v_mul_f16_e32 v2, 0x113c, v0
; VI-GISEL-NEXT: v_mul_f16_e32 v4, 0x42a4, v0
; VI-GISEL-NEXT: v_mul_f16_sdwa v1, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-GISEL-NEXT: v_mul_f16_sdwa v0, v0, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-GISEL-NEXT: v_exp_f16_e32 v1, v1
; VI-GISEL-NEXT: v_exp_f16_e32 v0, v0
; VI-GISEL-NEXT: v_exp_f16_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f16_e32 v4, v4
; VI-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 16
; VI-GISEL-NEXT: v_mul_f16_e32 v2, v4, v2
; VI-GISEL-NEXT: v_lshlrev_b32_sdwa v0, v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
; VI-GISEL-NEXT: v_or_b32_sdwa v0, v2, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_v2f16_fast:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: s_movk_i32 s4, 0x113c
; GFX900-SDAG-NEXT: s_movk_i32 s5, 0x42a4
; GFX900-SDAG-NEXT: v_mul_f16_e32 v1, 0x113c, v0
; GFX900-SDAG-NEXT: v_mul_f16_e32 v2, 0x42a4, v0
; GFX900-SDAG-NEXT: v_mul_f16_sdwa v3, v0, s4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-SDAG-NEXT: v_mul_f16_sdwa v0, v0, s5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-SDAG-NEXT: v_exp_f16_e32 v1, v1
; GFX900-SDAG-NEXT: v_exp_f16_e32 v2, v2
; GFX900-SDAG-NEXT: v_exp_f16_e32 v3, v3
; GFX900-SDAG-NEXT: v_exp_f16_e32 v0, v0
; GFX900-SDAG-NEXT: v_mul_f16_e32 v1, v2, v1
; GFX900-SDAG-NEXT: v_mul_f16_e32 v0, v0, v3
; GFX900-SDAG-NEXT: v_pack_b32_f16 v0, v1, v0
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_v2f16_fast:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x113c
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x42a4
; GFX900-GISEL-NEXT: v_mul_f16_e32 v2, 0x113c, v0
; GFX900-GISEL-NEXT: v_mul_f16_e32 v4, 0x42a4, v0
; GFX900-GISEL-NEXT: v_mul_f16_sdwa v1, v0, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-GISEL-NEXT: v_mul_f16_sdwa v0, v0, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-GISEL-NEXT: v_exp_f16_e32 v2, v2
; GFX900-GISEL-NEXT: v_exp_f16_e32 v4, v4
; GFX900-GISEL-NEXT: v_exp_f16_e32 v1, v1
; GFX900-GISEL-NEXT: v_exp_f16_e32 v0, v0
; GFX900-GISEL-NEXT: v_mul_f16_e32 v2, v4, v2
; GFX900-GISEL-NEXT: v_mul_f16_e32 v0, v0, v1
; GFX900-GISEL-NEXT: v_pack_b32_f16 v0, v2, v0
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_v2f16_fast:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v2, 0x3a278000, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40548000, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v2, v2
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v3, 0x3a278000, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40548000, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v3, v3
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v3
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v1, 16, v1
; SI-SDAG-NEXT: v_or_b32_e32 v0, v0, v1
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_v2f16_fast:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v0
; SI-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x3a278000, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40548000, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v3, 0x3a278000, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40548000, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v3, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_bfe_u32 v0, v0, 0, 16
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; SI-GISEL-NEXT: v_or_b32_e32 v0, v1, v0
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call fast <2 x half> @llvm.exp10.v2f16(<2 x half> %in)
ret <2 x half> %result
}
define <3 x half> @v_exp10_v3f16(<3 x half> %in) {
; VI-SDAG-LABEL: v_exp10_v3f16:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_cvt_f32_f16_e32 v2, v0
; VI-SDAG-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549a78, v2
; VI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-SDAG-NEXT: v_exp_f32_e32 v2, v2
; VI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_f16_f32_e32 v2, v2
; VI-SDAG-NEXT: v_cvt_f16_f32_sdwa v0, v0 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD
; VI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; VI-SDAG-NEXT: v_or_b32_e32 v0, v2, v0
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_v3f16:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v2, v0
; VI-GISEL-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; VI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 16
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; VI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v2, v2
; VI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; VI-GISEL-NEXT: v_lshlrev_b32_sdwa v0, v3, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
; VI-GISEL-NEXT: v_or_b32_sdwa v0, v2, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
; VI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-LABEL: v_exp10_v3f16:
; GFX900: ; %bb.0:
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-NEXT: v_cvt_f32_f16_e32 v2, v0
; GFX900-NEXT: v_cvt_f32_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
; GFX900-NEXT: v_cvt_f32_f16_e32 v1, v1
; GFX900-NEXT: v_mul_f32_e32 v2, 0x40549a78, v2
; GFX900-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; GFX900-NEXT: v_exp_f32_e32 v2, v2
; GFX900-NEXT: v_exp_f32_e32 v0, v0
; GFX900-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; GFX900-NEXT: v_exp_f32_e32 v1, v1
; GFX900-NEXT: v_cvt_f16_f32_e32 v2, v2
; GFX900-NEXT: v_cvt_f16_f32_e32 v0, v0
; GFX900-NEXT: v_cvt_f16_f32_e32 v1, v1
; GFX900-NEXT: v_pack_b32_f16 v0, v2, v0
; GFX900-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_v3f16:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_lshrrev_b32_e32 v2, 16, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549a78, v2
; SI-SDAG-NEXT: v_exp_f32_e32 v2, v2
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
; SI-SDAG-NEXT: v_or_b32_e32 v0, v0, v2
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_v3f16:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v2, v0
; SI-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v2
; SI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549a78, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40549a78, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_bfe_u32 v2, v2, 0, 16
; SI-GISEL-NEXT: v_bfe_u32 v0, v0, 0, 16
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_or_b32_e32 v0, v2, v0
; SI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call <3 x half> @llvm.exp10.v3f16(<3 x half> %in)
ret <3 x half> %result
}
define <3 x half> @v_exp10_v3f16_afn(<3 x half> %in) {
; VI-SDAG-LABEL: v_exp10_v3f16_afn:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_mov_b32_e32 v5, 0x113c
; VI-SDAG-NEXT: v_mov_b32_e32 v6, 0x42a4
; VI-SDAG-NEXT: v_mul_f16_e32 v2, 0x113c, v1
; VI-SDAG-NEXT: v_mul_f16_e32 v1, 0x42a4, v1
; VI-SDAG-NEXT: v_mul_f16_e32 v3, 0x113c, v0
; VI-SDAG-NEXT: v_mul_f16_e32 v4, 0x42a4, v0
; VI-SDAG-NEXT: v_mul_f16_sdwa v5, v0, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-SDAG-NEXT: v_mul_f16_sdwa v0, v0, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-SDAG-NEXT: v_exp_f16_e32 v2, v2
; VI-SDAG-NEXT: v_exp_f16_e32 v1, v1
; VI-SDAG-NEXT: v_exp_f16_e32 v3, v3
; VI-SDAG-NEXT: v_exp_f16_e32 v4, v4
; VI-SDAG-NEXT: v_exp_f16_e32 v5, v5
; VI-SDAG-NEXT: v_exp_f16_e32 v0, v0
; VI-SDAG-NEXT: v_mul_f16_e32 v1, v1, v2
; VI-SDAG-NEXT: v_mul_f16_e32 v2, v4, v3
; VI-SDAG-NEXT: v_mul_f16_sdwa v0, v0, v5 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
; VI-SDAG-NEXT: v_or_b32_e32 v0, v2, v0
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_v3f16_afn:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x113c
; VI-GISEL-NEXT: v_mov_b32_e32 v4, 0x42a4
; VI-GISEL-NEXT: v_mul_f16_e32 v3, 0x113c, v0
; VI-GISEL-NEXT: v_mul_f16_e32 v5, 0x42a4, v0
; VI-GISEL-NEXT: v_mul_f16_sdwa v2, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-GISEL-NEXT: v_mul_f16_sdwa v0, v0, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; VI-GISEL-NEXT: v_exp_f16_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f16_e32 v0, v0
; VI-GISEL-NEXT: v_mul_f16_e32 v4, 0x113c, v1
; VI-GISEL-NEXT: v_mul_f16_e32 v1, 0x42a4, v1
; VI-GISEL-NEXT: v_exp_f16_e32 v3, v3
; VI-GISEL-NEXT: v_exp_f16_e32 v5, v5
; VI-GISEL-NEXT: v_exp_f16_e32 v4, v4
; VI-GISEL-NEXT: v_exp_f16_e32 v1, v1
; VI-GISEL-NEXT: v_mul_f16_e32 v0, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 16
; VI-GISEL-NEXT: v_mul_f16_e32 v3, v5, v3
; VI-GISEL-NEXT: v_mul_f16_e32 v1, v1, v4
; VI-GISEL-NEXT: v_lshlrev_b32_sdwa v0, v2, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:WORD_0
; VI-GISEL-NEXT: v_or_b32_sdwa v0, v3, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
; VI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_v3f16_afn:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: s_movk_i32 s4, 0x113c
; GFX900-SDAG-NEXT: s_movk_i32 s5, 0x42a4
; GFX900-SDAG-NEXT: v_mul_f16_e32 v2, 0x113c, v1
; GFX900-SDAG-NEXT: v_mul_f16_e32 v1, 0x42a4, v1
; GFX900-SDAG-NEXT: v_mul_f16_e32 v3, 0x113c, v0
; GFX900-SDAG-NEXT: v_mul_f16_e32 v4, 0x42a4, v0
; GFX900-SDAG-NEXT: v_mul_f16_sdwa v5, v0, s4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-SDAG-NEXT: v_mul_f16_sdwa v0, v0, s5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-SDAG-NEXT: v_exp_f16_e32 v2, v2
; GFX900-SDAG-NEXT: v_exp_f16_e32 v1, v1
; GFX900-SDAG-NEXT: v_exp_f16_e32 v3, v3
; GFX900-SDAG-NEXT: v_exp_f16_e32 v4, v4
; GFX900-SDAG-NEXT: v_exp_f16_e32 v5, v5
; GFX900-SDAG-NEXT: v_exp_f16_e32 v0, v0
; GFX900-SDAG-NEXT: v_mul_f16_e32 v1, v1, v2
; GFX900-SDAG-NEXT: v_mul_f16_e32 v2, v4, v3
; GFX900-SDAG-NEXT: v_mul_f16_e32 v0, v0, v5
; GFX900-SDAG-NEXT: v_pack_b32_f16 v0, v2, v0
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_v3f16_afn:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x113c
; GFX900-GISEL-NEXT: v_mov_b32_e32 v4, 0x42a4
; GFX900-GISEL-NEXT: v_mul_f16_e32 v3, 0x113c, v0
; GFX900-GISEL-NEXT: v_mul_f16_e32 v5, 0x42a4, v0
; GFX900-GISEL-NEXT: v_mul_f16_sdwa v2, v0, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-GISEL-NEXT: v_mul_f16_sdwa v0, v0, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
; GFX900-GISEL-NEXT: v_exp_f16_e32 v3, v3
; GFX900-GISEL-NEXT: v_exp_f16_e32 v5, v5
; GFX900-GISEL-NEXT: v_exp_f16_e32 v2, v2
; GFX900-GISEL-NEXT: v_exp_f16_e32 v0, v0
; GFX900-GISEL-NEXT: v_mul_f16_e32 v4, 0x113c, v1
; GFX900-GISEL-NEXT: v_mul_f16_e32 v1, 0x42a4, v1
; GFX900-GISEL-NEXT: v_exp_f16_e32 v4, v4
; GFX900-GISEL-NEXT: v_exp_f16_e32 v1, v1
; GFX900-GISEL-NEXT: v_mul_f16_e32 v3, v5, v3
; GFX900-GISEL-NEXT: v_mul_f16_e32 v0, v0, v2
; GFX900-GISEL-NEXT: v_pack_b32_f16 v0, v3, v0
; GFX900-GISEL-NEXT: v_mul_f16_e32 v1, v1, v4
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_v3f16_afn:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_lshrrev_b32_e32 v2, 16, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a278000, v2
; SI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40548000, v2
; SI-SDAG-NEXT: v_mul_f32_e32 v4, 0x3a278000, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v5, v5
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-SDAG-NEXT: v_mul_f32_e32 v0, 0x40548000, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v3, 0x3a278000, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40548000, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v4, v4
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v3, v3
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v5, v5
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v4, v4
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v3, v3
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v5, v5
; SI-SDAG-NEXT: v_exp_f32_e32 v2, v2
; SI-SDAG-NEXT: v_exp_f32_e32 v4, v4
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
; SI-SDAG-NEXT: v_exp_f32_e32 v3, v3
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v5, v5
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v4, v4
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v3, v3
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v5, v5
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v4, v4
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v3, v3
; SI-SDAG-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-SDAG-NEXT: v_mul_f32_e32 v2, v2, v5
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-SDAG-NEXT: v_mul_f32_e32 v0, v0, v4
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-SDAG-NEXT: v_mul_f32_e32 v1, v1, v3
; SI-SDAG-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-SDAG-NEXT: v_lshlrev_b32_e32 v2, 16, v2
; SI-SDAG-NEXT: v_or_b32_e32 v0, v0, v2
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_v3f16_afn:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v2, v0
; SI-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v3, 0x3a278000, v2
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40548000, v2
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v3, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v5, 0x3a278000, v0
; SI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40548000, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v5, v5
; SI-GISEL-NEXT: v_exp_f32_e32 v2, v2
; SI-GISEL-NEXT: v_exp_f32_e32 v3, v3
; SI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a278000, v1
; SI-GISEL-NEXT: v_mul_f32_e32 v1, 0x40548000, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v4, v4
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v2, v2
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v4, v4
; SI-GISEL-NEXT: v_mul_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v3, v5
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_exp_f32_e32 v4, v4
; SI-GISEL-NEXT: v_exp_f32_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v4, v4
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v1, v1
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v4, v4
; SI-GISEL-NEXT: v_cvt_f32_f16_e32 v3, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v2, v2
; SI-GISEL-NEXT: v_mul_f32_e32 v1, v1, v4
; SI-GISEL-NEXT: v_mul_f32_e32 v0, v0, v3
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v0, v0
; SI-GISEL-NEXT: v_cvt_f16_f32_e32 v1, v1
; SI-GISEL-NEXT: v_bfe_u32 v2, v2, 0, 16
; SI-GISEL-NEXT: v_bfe_u32 v0, v0, 0, 16
; SI-GISEL-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; SI-GISEL-NEXT: v_or_b32_e32 v0, v2, v0
; SI-GISEL-NEXT: v_bfe_u32 v1, v1, 0, 16
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call afn <3 x half> @llvm.exp10.v3f16(<3 x half> %in)
ret <3 x half> %result
}
define float @v_exp10_f32_contract(float %in) {
; VI-SDAG-LABEL: v_exp10_f32_contract:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_contract:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_contract:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_contract:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_contract:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_contract:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call contract float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_contract_daz(float %in) #0 {
; VI-SDAG-LABEL: v_exp10_f32_contract_daz:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; VI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; VI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_contract_daz:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; VI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_contract_daz:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; GFX900-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; GFX900-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_contract_daz:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_contract_daz:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x421a209b
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
; SI-SDAG-NEXT: v_mov_b32_e32 v2, 0x7f800000
; SI-SDAG-NEXT: v_cmp_nlt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_contract_daz:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x7f800000
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x421a209b
; SI-GISEL-NEXT: v_cndmask_b32_e64 v1, v1, 0, vcc
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v1, v3, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call contract float @llvm.exp10.f32(float %in)
ret float %result
}
define float @v_exp10_f32_contract_nnan_ninf(float %in) {
; VI-SDAG-LABEL: v_exp10_f32_contract_nnan_ninf:
; VI-SDAG: ; %bb.0:
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-SDAG-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-SDAG-NEXT: v_sub_f32_e32 v4, v0, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v2, 0x40549000, v1
; VI-SDAG-NEXT: v_mul_f32_e32 v5, 0x3a2784bc, v4
; VI-SDAG-NEXT: v_mul_f32_e32 v4, 0x40549000, v4
; VI-SDAG-NEXT: v_rndne_f32_e32 v3, v2
; VI-SDAG-NEXT: v_add_f32_e32 v4, v4, v5
; VI-SDAG-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-SDAG-NEXT: v_sub_f32_e32 v2, v2, v3
; VI-SDAG-NEXT: v_add_f32_e32 v1, v1, v4
; VI-SDAG-NEXT: v_add_f32_e32 v1, v2, v1
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v3
; VI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; VI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; VI-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; VI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: v_exp10_f32_contract_nnan_ninf:
; VI-GISEL: ; %bb.0:
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; VI-GISEL-NEXT: v_and_b32_e32 v1, 0xfffff000, v0
; VI-GISEL-NEXT: v_sub_f32_e32 v2, v0, v1
; VI-GISEL-NEXT: v_mul_f32_e32 v4, 0x3a2784bc, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549000, v2
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x40549000, v1
; VI-GISEL-NEXT: v_add_f32_e32 v2, v2, v4
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0x3a2784bc, v1
; VI-GISEL-NEXT: v_add_f32_e32 v1, v1, v2
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v3
; VI-GISEL-NEXT: v_sub_f32_e32 v3, v3, v2
; VI-GISEL-NEXT: v_add_f32_e32 v1, v3, v1
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v2
; VI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; VI-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-SDAG-LABEL: v_exp10_f32_contract_nnan_ninf:
; GFX900-SDAG: ; %bb.0:
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; GFX900-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; GFX900-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; GFX900-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; GFX900-SDAG-NEXT: v_exp_f32_e32 v1, v1
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; GFX900-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; GFX900-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; GFX900-SDAG-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; GFX900-GISEL-LABEL: v_exp10_f32_contract_nnan_ninf:
; GFX900-GISEL: ; %bb.0:
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; GFX900-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; GFX900-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; GFX900-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; GFX900-GISEL-NEXT: v_exp_f32_e32 v1, v1
; GFX900-GISEL-NEXT: v_ldexp_f32 v1, v1, v2
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
;
; SI-SDAG-LABEL: v_exp10_f32_contract_nnan_ninf:
; SI-SDAG: ; %bb.0:
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-SDAG-NEXT: v_mul_f32_e32 v1, 0x40549a78, v0
; SI-SDAG-NEXT: s_mov_b32 s4, 0x40549a78
; SI-SDAG-NEXT: v_rndne_f32_e32 v2, v1
; SI-SDAG-NEXT: v_sub_f32_e32 v3, v1, v2
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, -v1
; SI-SDAG-NEXT: s_mov_b32 s4, 0x33979a37
; SI-SDAG-NEXT: v_fma_f32 v1, v0, s4, v1
; SI-SDAG-NEXT: v_add_f32_e32 v1, v3, v1
; SI-SDAG-NEXT: v_exp_f32_e32 v1, v1
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v2, v2
; SI-SDAG-NEXT: s_mov_b32 s4, 0xc23369f4
; SI-SDAG-NEXT: v_cmp_ngt_f32_e32 vcc, s4, v0
; SI-SDAG-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v1, vcc
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
;
; SI-GISEL-LABEL: v_exp10_f32_contract_nnan_ninf:
; SI-GISEL: ; %bb.0:
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549a78
; SI-GISEL-NEXT: v_mul_f32_e32 v2, 0x40549a78, v0
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v1, -v2
; SI-GISEL-NEXT: v_mov_b32_e32 v3, 0x33979a37
; SI-GISEL-NEXT: v_fma_f32 v1, v0, v3, v1
; SI-GISEL-NEXT: v_rndne_f32_e32 v3, v2
; SI-GISEL-NEXT: v_sub_f32_e32 v2, v2, v3
; SI-GISEL-NEXT: v_add_f32_e32 v1, v2, v1
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v2, v3
; SI-GISEL-NEXT: v_exp_f32_e32 v1, v1
; SI-GISEL-NEXT: v_ldexp_f32_e32 v1, v1, v2
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0xc23369f4
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, v0, v2
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v1, 0, vcc
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
%result = call contract nnan ninf float @llvm.exp10.f32(float %in)
ret float %result
}
declare float @llvm.fabs.f32(float) #2
declare float @llvm.exp10.f32(float) #2
declare <2 x float> @llvm.exp10.v2f32(<2 x float>) #2
declare <3 x float> @llvm.exp10.v3f32(<3 x float>) #2
declare <4 x float> @llvm.exp10.v4f32(<4 x float>) #2
declare half @llvm.fabs.f16(half) #2
declare half @llvm.exp10.f16(half) #2
declare <2 x half> @llvm.exp10.v2f16(<2 x half>) #2
declare <3 x half> @llvm.exp10.v3f16(<3 x half>) #2
declare <2 x half> @llvm.fabs.v2f16(<2 x half>) #2
attributes #0 = { denormal_fpenv(float: ieee|preservesign) }
attributes #1 = { denormal_fpenv(float: dynamic|dynamic) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; VI: {{.*}}