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

231 lines
9.8 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 -mattr=+real-true16 %s -o - | FileCheck -check-prefix=GFX-SDAG-TRUE16 %s
; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 -mattr=-real-true16 %s -o - | FileCheck -check-prefix=GFX-SDAG-FAKE16 %s
; xUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 -mattr=+real-true16 %s -o - | FileCheck -check-prefix=GFX-GISEL-TRUE16 %s
; xUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 -mattr=-real-true16 %s -o - | FileCheck -check-prefix=GFX-GISEL-FAKE16 %s
define bfloat @v_log2_bf16(bfloat %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e32 v0.l, v0.l
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e32 v0, v0
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%result = call bfloat @llvm.log2.bf16(bfloat %in)
ret bfloat %result
}
define bfloat @v_log2_fabs_bf16(bfloat %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_fabs_bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.l, |v0.l|
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_fabs_bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v0, |v0|
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%fabs = call bfloat @llvm.fabs.bf16(bfloat %in)
%result = call bfloat @llvm.log2.bf16(bfloat %fabs)
ret bfloat %result
}
define bfloat @v_log2_fneg_fabs_bf16(bfloat %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_fneg_fabs_bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.l, -|v0.l|
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_fneg_fabs_bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v0, -|v0|
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%fabs = call bfloat @llvm.fabs.bf16(bfloat %in)
%fneg.fabs = fneg bfloat %fabs
%result = call bfloat @llvm.log2.bf16(bfloat %fneg.fabs)
ret bfloat %result
}
define bfloat @v_log2_fneg_bf16(bfloat %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_fneg_bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.l, -v0.l
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_fneg_bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v0, -v0
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%fneg = fneg bfloat %in
%result = call bfloat @llvm.log2.bf16(bfloat %fneg)
ret bfloat %result
}
define bfloat @v_log2_bf16_fast(bfloat %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_bf16_fast:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e32 v0.l, v0.l
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_bf16_fast:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e32 v0, v0
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%result = call fast bfloat @llvm.log2.bf16(bfloat %in)
ret bfloat %result
}
define <2 x bfloat> @v_log2_v2bf16(<2 x bfloat> %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_v2bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e32 v0.h, v0.h
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e32 v0.l, v0.l
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_v2bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e32 v0, v0
; GFX-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(TRANS32_DEP_1)
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e32 v1, v1
; GFX-SDAG-FAKE16-NEXT: v_nop
; GFX-SDAG-FAKE16-NEXT: v_perm_b32 v0, v1, v0, 0x5040100
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%result = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> %in)
ret <2 x bfloat> %result
}
define <2 x bfloat> @v_log2_fabs_v2bf16(<2 x bfloat> %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_fabs_v2bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.h, |v0.h|
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.l, |v0.l|
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_fabs_v2bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v0, |v0|
; GFX-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(TRANS32_DEP_1)
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v1, |v1|
; GFX-SDAG-FAKE16-NEXT: v_nop
; GFX-SDAG-FAKE16-NEXT: v_perm_b32 v0, v1, v0, 0x5040100
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%fabs = call <2 x bfloat> @llvm.fabs.v2bf16(<2 x bfloat> %in)
%result = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> %fabs)
ret <2 x bfloat> %result
}
define <2 x bfloat> @v_log2_fneg_fabs_v2bf16(<2 x bfloat> %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_fneg_fabs_v2bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.h, -|v0.h|
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.l, -|v0.l|
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_fneg_fabs_v2bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v0, -|v0|
; GFX-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(TRANS32_DEP_1)
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v1, -|v1|
; GFX-SDAG-FAKE16-NEXT: v_nop
; GFX-SDAG-FAKE16-NEXT: v_perm_b32 v0, v1, v0, 0x5040100
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%fabs = call <2 x bfloat> @llvm.fabs.v2bf16(<2 x bfloat> %in)
%fneg.fabs = fneg <2 x bfloat> %fabs
%result = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> %fneg.fabs)
ret <2 x bfloat> %result
}
define <2 x bfloat> @v_log2_fneg_v2bf16(<2 x bfloat> %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_fneg_v2bf16:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.h, -v0.h
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e64 v0.l, -v0.l
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_fneg_v2bf16:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v0, -v0
; GFX-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(TRANS32_DEP_1)
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e64 v1, -v1
; GFX-SDAG-FAKE16-NEXT: v_nop
; GFX-SDAG-FAKE16-NEXT: v_perm_b32 v0, v1, v0, 0x5040100
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%fneg = fneg <2 x bfloat> %in
%result = call <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> %fneg)
ret <2 x bfloat> %result
}
define <2 x bfloat> @v_log2_v2bf16_fast(<2 x bfloat> %in) {
; GFX-SDAG-TRUE16-LABEL: v_log2_v2bf16_fast:
; GFX-SDAG-TRUE16: ; %bb.0:
; GFX-SDAG-TRUE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-TRUE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e32 v0.h, v0.h
; GFX-SDAG-TRUE16-NEXT: v_log_bf16_e32 v0.l, v0.l
; GFX-SDAG-TRUE16-NEXT: s_set_pc_i64 s[30:31]
;
; GFX-SDAG-FAKE16-LABEL: v_log2_v2bf16_fast:
; GFX-SDAG-FAKE16: ; %bb.0:
; GFX-SDAG-FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX-SDAG-FAKE16-NEXT: s_wait_kmcnt 0x0
; GFX-SDAG-FAKE16-NEXT: v_lshrrev_b32_e32 v1, 16, v0
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e32 v0, v0
; GFX-SDAG-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(TRANS32_DEP_1)
; GFX-SDAG-FAKE16-NEXT: v_log_bf16_e32 v1, v1
; GFX-SDAG-FAKE16-NEXT: v_nop
; GFX-SDAG-FAKE16-NEXT: v_perm_b32 v0, v1, v0, 0x5040100
; GFX-SDAG-FAKE16-NEXT: s_set_pc_i64 s[30:31]
%result = call fast <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat> %in)
ret <2 x bfloat> %result
}
declare bfloat @llvm.log2.bf16(bfloat) #0
declare <2 x bfloat> @llvm.log2.v2bf16(<2 x bfloat>) #0
declare bfloat @llvm.fabs.bf16(bfloat) #0
declare <2 x bfloat> @llvm.fabs.v2bf16(<2 x bfloat>) #0
attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }