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

65 lines
2.2 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -mattr=+xandesbfhcvt -target-abi ilp32f \
; RUN: -verify-machineinstrs < %s | FileCheck --check-prefixes=CHECK,XANDESBFHCVT %s
; RUN: llc -mtriple=riscv32 -mattr=+zfh,+xandesbfhcvt -target-abi ilp32f \
; RUN: -verify-machineinstrs < %s | FileCheck --check-prefixes=CHECK,ZFH %s
; RUN: llc -mtriple=riscv64 -mattr=+xandesbfhcvt -target-abi lp64f \
; RUN: -verify-machineinstrs < %s | FileCheck --check-prefixes=CHECK,XANDESBFHCVT %s
; RUN: llc -mtriple=riscv64 -mattr=+zfh,+xandesbfhcvt -target-abi lp64f \
; RUN: -verify-machineinstrs < %s | FileCheck --check-prefixes=CHECK,ZFH %s
define float @fcvt_s_bf16(bfloat %a) nounwind {
; CHECK-LABEL: fcvt_s_bf16:
; CHECK: # %bb.0:
; CHECK-NEXT: nds.fcvt.s.bf16 fa0, fa0
; CHECK-NEXT: ret
%1 = fpext bfloat %a to float
ret float %1
}
define bfloat @fcvt_bf16_s(float %a) nounwind {
; CHECK-LABEL: fcvt_bf16_s:
; CHECK: # %bb.0:
; CHECK-NEXT: nds.fcvt.bf16.s fa0, fa0
; CHECK-NEXT: ret
%1 = fptrunc float %a to bfloat
ret bfloat %1
}
; Check load and store to bf16.
define void @loadstorebf16(ptr %bf, ptr %sf) nounwind {
; XANDESBFHCVT-LABEL: loadstorebf16:
; XANDESBFHCVT: # %bb.0: # %entry
; XANDESBFHCVT-NEXT: lhu a2, 0(a0)
; XANDESBFHCVT-NEXT: lui a3, 1048560
; XANDESBFHCVT-NEXT: or a2, a2, a3
; XANDESBFHCVT-NEXT: fmv.w.x fa5, a2
; XANDESBFHCVT-NEXT: nds.fcvt.s.bf16 fa5, fa5
; XANDESBFHCVT-NEXT: fsw fa5, 0(a1)
; XANDESBFHCVT-NEXT: flw fa5, 0(a1)
; XANDESBFHCVT-NEXT: nds.fcvt.bf16.s fa5, fa5
; XANDESBFHCVT-NEXT: fmv.x.w a1, fa5
; XANDESBFHCVT-NEXT: sh a1, 0(a0)
; XANDESBFHCVT-NEXT: ret
;
; ZFH-LABEL: loadstorebf16:
; ZFH: # %bb.0: # %entry
; ZFH-NEXT: flh fa5, 0(a0)
; ZFH-NEXT: nds.fcvt.s.bf16 fa5, fa5
; ZFH-NEXT: fsw fa5, 0(a1)
; ZFH-NEXT: flw fa5, 0(a1)
; ZFH-NEXT: nds.fcvt.bf16.s fa5, fa5
; ZFH-NEXT: fsh fa5, 0(a0)
; ZFH-NEXT: ret
entry:
%0 = load bfloat, ptr %bf, align 2
%1 = fpext bfloat %0 to float
store volatile float %1, ptr %sf, align 4
%2 = load float, ptr %sf, align 4
%3 = fptrunc float %2 to bfloat
store volatile bfloat %3, ptr %bf, align 2
ret void
}