|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 |
| 2 | +; RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=hawaii < %s | FileCheck -check-prefixes=GFX7 %s |
| 3 | + |
| 4 | +declare float @llvm.experimental.constrained.fpext.f32.f16(half, metadata) #0 |
| 5 | +declare <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2f16(<2 x half>, metadata) #0 |
| 6 | + |
| 7 | +define float @v_constrained_fpext_f16_to_f32(ptr addrspace(1) %ptr) #0 { |
| 8 | +; GFX7-LABEL: v_constrained_fpext_f16_to_f32: |
| 9 | +; GFX7: ; %bb.0: |
| 10 | +; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 11 | +; GFX7-NEXT: s_mov_b32 s6, 0 |
| 12 | +; GFX7-NEXT: s_mov_b32 s7, 0xf000 |
| 13 | +; GFX7-NEXT: s_mov_b32 s4, s6 |
| 14 | +; GFX7-NEXT: s_mov_b32 s5, s6 |
| 15 | +; GFX7-NEXT: buffer_load_ushort v0, v[0:1], s[4:7], 0 addr64 |
| 16 | +; GFX7-NEXT: s_waitcnt vmcnt(0) |
| 17 | +; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v0 |
| 18 | +; GFX7-NEXT: s_setpc_b64 s[30:31] |
| 19 | + %val = load half, ptr addrspace(1) %ptr |
| 20 | + %result = call float @llvm.experimental.constrained.fpext.f32.f16(half %val, metadata !"fpexcept.strict") |
| 21 | + ret float %result |
| 22 | +} |
| 23 | + |
| 24 | +define <2 x float> @v_constrained_fpext_v2f16_to_v2f32(ptr addrspace(1) %ptr) #0 { |
| 25 | +; GFX7-LABEL: v_constrained_fpext_v2f16_to_v2f32: |
| 26 | +; GFX7: ; %bb.0: |
| 27 | +; GFX7-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 28 | +; GFX7-NEXT: s_mov_b32 s6, 0 |
| 29 | +; GFX7-NEXT: s_mov_b32 s7, 0xf000 |
| 30 | +; GFX7-NEXT: s_mov_b32 s4, s6 |
| 31 | +; GFX7-NEXT: s_mov_b32 s5, s6 |
| 32 | +; GFX7-NEXT: buffer_load_dword v1, v[0:1], s[4:7], 0 addr64 |
| 33 | +; GFX7-NEXT: s_waitcnt vmcnt(0) |
| 34 | +; GFX7-NEXT: v_cvt_f32_f16_e32 v0, v1 |
| 35 | +; GFX7-NEXT: v_lshrrev_b32_e32 v1, 16, v1 |
| 36 | +; GFX7-NEXT: v_cvt_f32_f16_e32 v1, v1 |
| 37 | +; GFX7-NEXT: s_setpc_b64 s[30:31] |
| 38 | + %val = load <2 x half>, ptr addrspace(1) %ptr |
| 39 | + %result = call <2 x float> @llvm.experimental.constrained.fpext.v2f32.v2f16(<2 x half> %val, metadata !"fpexcept.strict") |
| 40 | + ret <2 x float> %result |
| 41 | +} |
| 42 | + |
| 43 | +attributes #0 = { strictfp } |
0 commit comments