Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

301 lines
9.9 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "load" --filter-out "store" --filter-out "wait" --version 6
; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=fiji -mattr=-flat-for-global < %s | FileCheck -check-prefix=VI-SDAG %s
; RUN: llc -global-isel=1 -new-reg-bank-select -mtriple=amdgcn -mcpu=fiji -mattr=-flat-for-global < %s | FileCheck -check-prefix=VI-GISEL %s
declare half @llvm.amdgcn.div.fixup.f16(half %a, half %b, half %c)
define amdgpu_kernel void @div_fixup_f16(
; VI-SDAG-LABEL: div_fixup_f16:
; VI-SDAG: ; %bb.0: ; %entry
; VI-SDAG: s_mov_b32 s11, 0xf000
; VI-SDAG: s_mov_b32 s10, -1
; VI-SDAG: s_mov_b32 s14, s10
; VI-SDAG: s_mov_b32 s15, s11
; VI-SDAG: s_mov_b32 s12, s2
; VI-SDAG: s_mov_b32 s13, s3
; VI-SDAG: s_mov_b32 s16, s4
; VI-SDAG: s_mov_b32 s17, s5
; VI-SDAG: s_mov_b32 s18, s10
; VI-SDAG: s_mov_b32 s19, s11
; VI-SDAG: s_mov_b32 s4, s6
; VI-SDAG: s_mov_b32 s5, s7
; VI-SDAG: s_mov_b32 s6, s10
; VI-SDAG: s_mov_b32 s7, s11
; VI-SDAG: s_mov_b32 s8, s0
; VI-SDAG: s_mov_b32 s9, s1
; VI-SDAG: v_div_fixup_f16 v0, v0, v1, v2
; VI-SDAG: s_endpgm
;
; VI-GISEL-LABEL: div_fixup_f16:
; VI-GISEL: ; %bb.0: ; %entry
; VI-GISEL: s_mov_b32 s10, -1
; VI-GISEL: s_mov_b32 s11, 0xf000
; VI-GISEL: s_mov_b64 s[8:9], s[2:3]
; VI-GISEL: s_mov_b64 s[8:9], s[4:5]
; VI-GISEL: s_mov_b64 s[8:9], s[6:7]
; VI-GISEL: v_readfirstlane_b32 s2, v0
; VI-GISEL: v_readfirstlane_b32 s3, v1
; VI-GISEL: v_mov_b32_e32 v0, s3
; VI-GISEL: v_readfirstlane_b32 s4, v2
; VI-GISEL: v_mov_b32_e32 v1, s4
; VI-GISEL: v_div_fixup_f16 v0, s2, v0, v1
; VI-GISEL: s_mov_b64 s[2:3], s[10:11]
; VI-GISEL: s_endpgm
ptr addrspace(1) %r,
ptr addrspace(1) %a,
ptr addrspace(1) %b,
ptr addrspace(1) %c) {
entry:
%a.val = load volatile half, ptr addrspace(1) %a
%b.val = load volatile half, ptr addrspace(1) %b
%c.val = load volatile half, ptr addrspace(1) %c
%r.val = call half @llvm.amdgcn.div.fixup.f16(half %a.val, half %b.val, half %c.val)
store half %r.val, ptr addrspace(1) %r
ret void
}
define amdgpu_kernel void @div_fixup_f16_imm_a(
; VI-SDAG-LABEL: div_fixup_f16_imm_a:
; VI-SDAG: ; %bb.0: ; %entry
; VI-SDAG: s_mov_b32 s7, 0xf000
; VI-SDAG: s_mov_b32 s6, -1
; VI-SDAG: s_mov_b32 s14, s6
; VI-SDAG: s_mov_b32 s12, s2
; VI-SDAG: s_mov_b32 s13, s3
; VI-SDAG: s_mov_b32 s15, s7
; VI-SDAG: s_mov_b32 s10, s6
; VI-SDAG: s_mov_b32 s11, s7
; VI-SDAG: s_mov_b32 s4, s0
; VI-SDAG: s_movk_i32 s0, 0x4200
; VI-SDAG: s_mov_b32 s5, s1
; VI-SDAG: v_div_fixup_f16 v0, s0, v0, v1
; VI-SDAG: s_endpgm
;
; VI-GISEL-LABEL: div_fixup_f16_imm_a:
; VI-GISEL: ; %bb.0: ; %entry
; VI-GISEL: s_mov_b32 s6, -1
; VI-GISEL: s_mov_b32 s7, 0xf000
; VI-GISEL: s_mov_b64 s[10:11], s[6:7]
; VI-GISEL: s_mov_b64 s[4:5], s[2:3]
; VI-GISEL: v_mov_b32_e32 v2, 0x4200
; VI-GISEL: v_readfirstlane_b32 s2, v0
; VI-GISEL: v_readfirstlane_b32 s3, v1
; VI-GISEL: v_mov_b32_e32 v0, s3
; VI-GISEL: v_div_fixup_f16 v0, v2, s2, v0
; VI-GISEL: s_mov_b64 s[2:3], s[6:7]
; VI-GISEL: s_nop 1
; VI-GISEL: s_endpgm
ptr addrspace(1) %r,
ptr addrspace(1) %b,
ptr addrspace(1) %c) {
entry:
%b.val = load volatile half, ptr addrspace(1) %b
%c.val = load volatile half, ptr addrspace(1) %c
%r.val = call half @llvm.amdgcn.div.fixup.f16(half 3.0, half %b.val, half %c.val)
store half %r.val, ptr addrspace(1) %r
ret void
}
define amdgpu_kernel void @div_fixup_f16_imm_b(
; VI-SDAG-LABEL: div_fixup_f16_imm_b:
; VI-SDAG: ; %bb.0: ; %entry
; VI-SDAG: s_mov_b32 s7, 0xf000
; VI-SDAG: s_mov_b32 s6, -1
; VI-SDAG: s_mov_b32 s14, s6
; VI-SDAG: s_mov_b32 s12, s2
; VI-SDAG: s_mov_b32 s13, s3
; VI-SDAG: s_mov_b32 s15, s7
; VI-SDAG: s_mov_b32 s10, s6
; VI-SDAG: s_mov_b32 s11, s7
; VI-SDAG: s_mov_b32 s4, s0
; VI-SDAG: s_movk_i32 s0, 0x4200
; VI-SDAG: s_mov_b32 s5, s1
; VI-SDAG: v_div_fixup_f16 v0, v0, s0, v1
; VI-SDAG: s_endpgm
;
; VI-GISEL-LABEL: div_fixup_f16_imm_b:
; VI-GISEL: ; %bb.0: ; %entry
; VI-GISEL: s_mov_b32 s6, -1
; VI-GISEL: s_mov_b32 s7, 0xf000
; VI-GISEL: s_mov_b64 s[10:11], s[6:7]
; VI-GISEL: s_mov_b64 s[4:5], s[2:3]
; VI-GISEL: v_mov_b32_e32 v2, 0x4200
; VI-GISEL: v_readfirstlane_b32 s2, v0
; VI-GISEL: v_readfirstlane_b32 s3, v1
; VI-GISEL: v_mov_b32_e32 v0, s3
; VI-GISEL: v_div_fixup_f16 v0, s2, v2, v0
; VI-GISEL: s_mov_b64 s[2:3], s[6:7]
; VI-GISEL: s_nop 1
; VI-GISEL: s_endpgm
ptr addrspace(1) %r,
ptr addrspace(1) %a,
ptr addrspace(1) %c) {
entry:
%a.val = load volatile half, ptr addrspace(1) %a
%c.val = load volatile half, ptr addrspace(1) %c
%r.val = call half @llvm.amdgcn.div.fixup.f16(half %a.val, half 3.0, half %c.val)
store half %r.val, ptr addrspace(1) %r
ret void
}
define amdgpu_kernel void @div_fixup_f16_imm_c(
; VI-SDAG-LABEL: div_fixup_f16_imm_c:
; VI-SDAG: ; %bb.0: ; %entry
; VI-SDAG: s_mov_b32 s7, 0xf000
; VI-SDAG: s_mov_b32 s6, -1
; VI-SDAG: s_mov_b32 s14, s6
; VI-SDAG: s_mov_b32 s12, s2
; VI-SDAG: s_mov_b32 s13, s3
; VI-SDAG: s_mov_b32 s15, s7
; VI-SDAG: s_mov_b32 s10, s6
; VI-SDAG: s_mov_b32 s11, s7
; VI-SDAG: s_mov_b32 s4, s0
; VI-SDAG: s_movk_i32 s0, 0x4200
; VI-SDAG: s_mov_b32 s5, s1
; VI-SDAG: v_div_fixup_f16 v0, v0, v1, s0
; VI-SDAG: s_endpgm
;
; VI-GISEL-LABEL: div_fixup_f16_imm_c:
; VI-GISEL: ; %bb.0: ; %entry
; VI-GISEL: s_mov_b32 s6, -1
; VI-GISEL: s_mov_b32 s7, 0xf000
; VI-GISEL: s_mov_b64 s[10:11], s[6:7]
; VI-GISEL: s_mov_b64 s[4:5], s[2:3]
; VI-GISEL: v_mov_b32_e32 v2, 0x4200
; VI-GISEL: v_readfirstlane_b32 s2, v0
; VI-GISEL: v_readfirstlane_b32 s3, v1
; VI-GISEL: v_mov_b32_e32 v0, s3
; VI-GISEL: v_div_fixup_f16 v0, s2, v0, v2
; VI-GISEL: s_mov_b64 s[2:3], s[6:7]
; VI-GISEL: s_nop 1
; VI-GISEL: s_endpgm
ptr addrspace(1) %r,
ptr addrspace(1) %a,
ptr addrspace(1) %b) {
entry:
%a.val = load volatile half, ptr addrspace(1) %a
%b.val = load volatile half, ptr addrspace(1) %b
%r.val = call half @llvm.amdgcn.div.fixup.f16(half %a.val, half %b.val, half 3.0)
store half %r.val, ptr addrspace(1) %r
ret void
}
define amdgpu_kernel void @div_fixup_f16_imm_a_imm_b(
; VI-SDAG-LABEL: div_fixup_f16_imm_a_imm_b:
; VI-SDAG: ; %bb.0: ; %entry
; VI-SDAG: s_mov_b32 s7, 0xf000
; VI-SDAG: s_mov_b32 s6, -1
; VI-SDAG: s_mov_b32 s10, s6
; VI-SDAG: s_mov_b32 s11, s7
; VI-SDAG: s_mov_b32 s8, s2
; VI-SDAG: s_mov_b32 s9, s3
; VI-SDAG: s_mov_b32 s4, s0
; VI-SDAG: s_movk_i32 s0, 0x4200
; VI-SDAG: s_mov_b32 s5, s1
; VI-SDAG: v_div_fixup_f16 v0, s0, s0, v0
; VI-SDAG: s_endpgm
;
; VI-GISEL-LABEL: div_fixup_f16_imm_a_imm_b:
; VI-GISEL: ; %bb.0: ; %entry
; VI-GISEL: s_mov_b32 s6, -1
; VI-GISEL: s_mov_b32 s7, 0xf000
; VI-GISEL: v_mov_b32_e32 v1, 0x4200
; VI-GISEL: s_mov_b64 s[4:5], s[2:3]
; VI-GISEL: v_readfirstlane_b32 s2, v0
; VI-GISEL: v_div_fixup_f16 v0, v1, v1, s2
; VI-GISEL: s_mov_b64 s[2:3], s[6:7]
; VI-GISEL: s_nop 2
; VI-GISEL: s_endpgm
ptr addrspace(1) %r,
ptr addrspace(1) %c) {
entry:
%c.val = load volatile half, ptr addrspace(1) %c
%r.val = call half @llvm.amdgcn.div.fixup.f16(half 3.0, half 3.0, half %c.val)
store half %r.val, ptr addrspace(1) %r
ret void
}
define amdgpu_kernel void @div_fixup_f16_imm_b_imm_c(
; VI-SDAG-LABEL: div_fixup_f16_imm_b_imm_c:
; VI-SDAG: ; %bb.0: ; %entry
; VI-SDAG: s_mov_b32 s7, 0xf000
; VI-SDAG: s_mov_b32 s6, -1
; VI-SDAG: s_mov_b32 s10, s6
; VI-SDAG: s_mov_b32 s11, s7
; VI-SDAG: s_mov_b32 s8, s2
; VI-SDAG: s_mov_b32 s9, s3
; VI-SDAG: s_mov_b32 s4, s0
; VI-SDAG: s_movk_i32 s0, 0x4200
; VI-SDAG: s_mov_b32 s5, s1
; VI-SDAG: v_div_fixup_f16 v0, v0, s0, s0
; VI-SDAG: s_endpgm
;
; VI-GISEL-LABEL: div_fixup_f16_imm_b_imm_c:
; VI-GISEL: ; %bb.0: ; %entry
; VI-GISEL: s_mov_b32 s6, -1
; VI-GISEL: s_mov_b32 s7, 0xf000
; VI-GISEL: v_mov_b32_e32 v1, 0x4200
; VI-GISEL: s_mov_b64 s[4:5], s[2:3]
; VI-GISEL: v_readfirstlane_b32 s2, v0
; VI-GISEL: v_div_fixup_f16 v0, s2, v1, v1
; VI-GISEL: s_mov_b64 s[2:3], s[6:7]
; VI-GISEL: s_nop 2
; VI-GISEL: s_endpgm
ptr addrspace(1) %r,
ptr addrspace(1) %a) {
entry:
%a.val = load half, ptr addrspace(1) %a
%r.val = call half @llvm.amdgcn.div.fixup.f16(half %a.val, half 3.0, half 3.0)
store half %r.val, ptr addrspace(1) %r
ret void
}
define amdgpu_kernel void @div_fixup_f16_imm_a_imm_c(
; VI-SDAG-LABEL: div_fixup_f16_imm_a_imm_c:
; VI-SDAG: ; %bb.0: ; %entry
; VI-SDAG: s_mov_b32 s7, 0xf000
; VI-SDAG: s_mov_b32 s6, -1
; VI-SDAG: s_mov_b32 s10, s6
; VI-SDAG: s_mov_b32 s11, s7
; VI-SDAG: s_mov_b32 s8, s2
; VI-SDAG: s_mov_b32 s9, s3
; VI-SDAG: s_mov_b32 s4, s0
; VI-SDAG: s_movk_i32 s0, 0x4200
; VI-SDAG: s_mov_b32 s5, s1
; VI-SDAG: v_div_fixup_f16 v0, s0, v0, s0
; VI-SDAG: s_endpgm
;
; VI-GISEL-LABEL: div_fixup_f16_imm_a_imm_c:
; VI-GISEL: ; %bb.0: ; %entry
; VI-GISEL: s_mov_b32 s6, -1
; VI-GISEL: s_mov_b32 s7, 0xf000
; VI-GISEL: v_mov_b32_e32 v1, 0x4200
; VI-GISEL: s_mov_b64 s[4:5], s[2:3]
; VI-GISEL: v_readfirstlane_b32 s2, v0
; VI-GISEL: v_div_fixup_f16 v0, v1, s2, v1
; VI-GISEL: s_mov_b64 s[2:3], s[6:7]
; VI-GISEL: s_nop 2
; VI-GISEL: s_endpgm
ptr addrspace(1) %r,
ptr addrspace(1) %b) {
entry:
%b.val = load half, ptr addrspace(1) %b
%r.val = call half @llvm.amdgcn.div.fixup.f16(half 3.0, half %b.val, half 3.0)
store half %r.val, ptr addrspace(1) %r
ret void
}
define half @div_fixup_f16_vgpr(half %a, half %b, half %c) {
; VI-SDAG-LABEL: div_fixup_f16_vgpr:
; VI-SDAG: ; %bb.0:
; VI-SDAG: v_div_fixup_f16 v0, v0, v1, v2
; VI-SDAG: s_setpc_b64 s[30:31]
;
; VI-GISEL-LABEL: div_fixup_f16_vgpr:
; VI-GISEL: ; %bb.0:
; VI-GISEL: v_div_fixup_f16 v0, v0, v1, v2
; VI-GISEL: s_setpc_b64 s[30:31]
%r = call half @llvm.amdgcn.div.fixup.f16(half %a, half %b, half %c)
ret half %r
}