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
187 lines
7.0 KiB
LLVM
187 lines
7.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -mtriple=riscv32 -target-abi=ilp32d -mattr=+v,+zvfbfmin,+f,+d -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,RV32ZVFBFMIN,RV32-NO-ZFBFMIN
|
|
; RUN: llc -mtriple=riscv64 -target-abi=lp64d -mattr=+v,+zvfbfmin,+f,+d -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64ZVFBFMIN,RV64-NO-ZFBFMIN
|
|
; RUN: llc -mtriple=riscv32 -target-abi=ilp32d -mattr=+v,+zfbfmin,+zvfbfmin,+f,+d -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,RV32ZVFBFMIN,RV32-ZFBFMIN
|
|
; RUN: llc -mtriple=riscv64 -target-abi=lp64d -mattr=+v,+zfbfmin,+zvfbfmin,+f,+d -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64ZVFBFMIN,RV64-ZFBFMIN
|
|
; RUN: llc -mtriple=riscv32 -target-abi=ilp32d -mattr=+v,+experimental-zvfbfa -verify-machineinstrs < %s | FileCheck %s --check-prefixes=ZVFBFA
|
|
; RUN: llc -mtriple=riscv64 -target-abi=lp64d -mattr=+v,+experimental-zvfbfa -verify-machineinstrs < %s | FileCheck %s --check-prefixes=ZVFBFA
|
|
|
|
define <4 x bfloat> @splat_idx_v4bf16(<4 x bfloat> %v, i64 %idx) {
|
|
; RV32-NO-ZFBFMIN-LABEL: splat_idx_v4bf16:
|
|
; RV32-NO-ZFBFMIN: # %bb.0:
|
|
; RV32-NO-ZFBFMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
|
|
; RV32-NO-ZFBFMIN-NEXT: vrgather.vx v9, v8, a0
|
|
; RV32-NO-ZFBFMIN-NEXT: vmv1r.v v8, v9
|
|
; RV32-NO-ZFBFMIN-NEXT: ret
|
|
;
|
|
; RV64-NO-ZFBFMIN-LABEL: splat_idx_v4bf16:
|
|
; RV64-NO-ZFBFMIN: # %bb.0:
|
|
; RV64-NO-ZFBFMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
|
|
; RV64-NO-ZFBFMIN-NEXT: vrgather.vx v9, v8, a0
|
|
; RV64-NO-ZFBFMIN-NEXT: vmv1r.v v8, v9
|
|
; RV64-NO-ZFBFMIN-NEXT: ret
|
|
;
|
|
; RV32-ZFBFMIN-LABEL: splat_idx_v4bf16:
|
|
; RV32-ZFBFMIN: # %bb.0:
|
|
; RV32-ZFBFMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
|
|
; RV32-ZFBFMIN-NEXT: vslidedown.vx v8, v8, a0
|
|
; RV32-ZFBFMIN-NEXT: vmv.x.s a0, v8
|
|
; RV32-ZFBFMIN-NEXT: vmv.v.x v8, a0
|
|
; RV32-ZFBFMIN-NEXT: ret
|
|
;
|
|
; RV64-ZFBFMIN-LABEL: splat_idx_v4bf16:
|
|
; RV64-ZFBFMIN: # %bb.0:
|
|
; RV64-ZFBFMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
|
|
; RV64-ZFBFMIN-NEXT: vslidedown.vx v8, v8, a0
|
|
; RV64-ZFBFMIN-NEXT: vmv.x.s a0, v8
|
|
; RV64-ZFBFMIN-NEXT: vmv.v.x v8, a0
|
|
; RV64-ZFBFMIN-NEXT: ret
|
|
;
|
|
; ZVFBFA-LABEL: splat_idx_v4bf16:
|
|
; ZVFBFA: # %bb.0:
|
|
; ZVFBFA-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
|
|
; ZVFBFA-NEXT: vrgather.vx v9, v8, a0
|
|
; ZVFBFA-NEXT: vmv1r.v v8, v9
|
|
; ZVFBFA-NEXT: ret
|
|
%x = extractelement <4 x bfloat> %v, i64 %idx
|
|
%ins = insertelement <4 x bfloat> poison, bfloat %x, i32 0
|
|
%splat = shufflevector <4 x bfloat> %ins, <4 x bfloat> poison, <4 x i32> zeroinitializer
|
|
ret <4 x bfloat> %splat
|
|
}
|
|
|
|
define <2 x bfloat> @buildvec_v2bf16(bfloat %a, bfloat %b) {
|
|
; RV32-NO-ZFBFMIN-LABEL: buildvec_v2bf16:
|
|
; RV32-NO-ZFBFMIN: # %bb.0:
|
|
; RV32-NO-ZFBFMIN-NEXT: fmv.x.w a0, fa1
|
|
; RV32-NO-ZFBFMIN-NEXT: fmv.x.w a1, fa0
|
|
; RV32-NO-ZFBFMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; RV32-NO-ZFBFMIN-NEXT: vmv.v.x v8, a1
|
|
; RV32-NO-ZFBFMIN-NEXT: vslide1down.vx v8, v8, a0
|
|
; RV32-NO-ZFBFMIN-NEXT: ret
|
|
;
|
|
; RV64-NO-ZFBFMIN-LABEL: buildvec_v2bf16:
|
|
; RV64-NO-ZFBFMIN: # %bb.0:
|
|
; RV64-NO-ZFBFMIN-NEXT: fmv.x.w a0, fa1
|
|
; RV64-NO-ZFBFMIN-NEXT: fmv.x.w a1, fa0
|
|
; RV64-NO-ZFBFMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; RV64-NO-ZFBFMIN-NEXT: vmv.v.x v8, a1
|
|
; RV64-NO-ZFBFMIN-NEXT: vslide1down.vx v8, v8, a0
|
|
; RV64-NO-ZFBFMIN-NEXT: ret
|
|
;
|
|
; RV32-ZFBFMIN-LABEL: buildvec_v2bf16:
|
|
; RV32-ZFBFMIN: # %bb.0:
|
|
; RV32-ZFBFMIN-NEXT: fmv.x.h a0, fa1
|
|
; RV32-ZFBFMIN-NEXT: fmv.x.h a1, fa0
|
|
; RV32-ZFBFMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; RV32-ZFBFMIN-NEXT: vmv.v.x v8, a1
|
|
; RV32-ZFBFMIN-NEXT: vslide1down.vx v8, v8, a0
|
|
; RV32-ZFBFMIN-NEXT: ret
|
|
;
|
|
; RV64-ZFBFMIN-LABEL: buildvec_v2bf16:
|
|
; RV64-ZFBFMIN: # %bb.0:
|
|
; RV64-ZFBFMIN-NEXT: fmv.x.h a0, fa1
|
|
; RV64-ZFBFMIN-NEXT: fmv.x.h a1, fa0
|
|
; RV64-ZFBFMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; RV64-ZFBFMIN-NEXT: vmv.v.x v8, a1
|
|
; RV64-ZFBFMIN-NEXT: vslide1down.vx v8, v8, a0
|
|
; RV64-ZFBFMIN-NEXT: ret
|
|
;
|
|
; ZVFBFA-LABEL: buildvec_v2bf16:
|
|
; ZVFBFA: # %bb.0:
|
|
; ZVFBFA-NEXT: vsetivli zero, 2, e16alt, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vfmv.v.f v8, fa0
|
|
; ZVFBFA-NEXT: vfslide1down.vf v8, v8, fa1
|
|
; ZVFBFA-NEXT: ret
|
|
%v1 = insertelement <2 x bfloat> poison, bfloat %a, i64 0
|
|
%v2 = insertelement <2 x bfloat> %v1, bfloat %b, i64 1
|
|
ret <2 x bfloat> %v2
|
|
}
|
|
|
|
define <2 x bfloat> @vid_v2bf16() {
|
|
; CHECK-LABEL: vid_v2bf16:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: lui a0, 260096
|
|
; CHECK-NEXT: vsetivli zero, 2, e32, m1, ta, ma
|
|
; CHECK-NEXT: vmv.s.x v8, a0
|
|
; CHECK-NEXT: ret
|
|
;
|
|
; ZVFBFA-LABEL: vid_v2bf16:
|
|
; ZVFBFA: # %bb.0:
|
|
; ZVFBFA-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vid.v v8
|
|
; ZVFBFA-NEXT: vfwcvt.f.x.v v9, v8
|
|
; ZVFBFA-NEXT: vsetvli zero, zero, e16alt, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vfncvt.f.f.w v8, v9
|
|
; ZVFBFA-NEXT: ret
|
|
ret <2 x bfloat> <bfloat 0.0, bfloat 1.0>
|
|
}
|
|
|
|
define <2 x bfloat> @vid_addend1_v2bf16() {
|
|
; CHECK-LABEL: vid_addend1_v2bf16:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; CHECK-NEXT: vid.v v8
|
|
; CHECK-NEXT: lui a0, 4
|
|
; CHECK-NEXT: vsll.vi v8, v8, 7
|
|
; CHECK-NEXT: addi a0, a0, -128
|
|
; CHECK-NEXT: vadd.vx v8, v8, a0
|
|
; CHECK-NEXT: ret
|
|
;
|
|
; ZVFBFA-LABEL: vid_addend1_v2bf16:
|
|
; ZVFBFA: # %bb.0:
|
|
; ZVFBFA-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vid.v v8
|
|
; ZVFBFA-NEXT: vadd.vi v8, v8, 1
|
|
; ZVFBFA-NEXT: vfwcvt.f.x.v v9, v8
|
|
; ZVFBFA-NEXT: vsetvli zero, zero, e16alt, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vfncvt.f.f.w v8, v9
|
|
; ZVFBFA-NEXT: ret
|
|
ret <2 x bfloat> <bfloat 1.0, bfloat 2.0>
|
|
}
|
|
|
|
define <2 x bfloat> @vid_denominator2_v2bf16() {
|
|
; CHECK-LABEL: vid_denominator2_v2bf16:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; CHECK-NEXT: vid.v v8
|
|
; CHECK-NEXT: lui a0, 4
|
|
; CHECK-NEXT: vsll.vi v8, v8, 7
|
|
; CHECK-NEXT: addi a0, a0, -256
|
|
; CHECK-NEXT: vadd.vx v8, v8, a0
|
|
; CHECK-NEXT: ret
|
|
;
|
|
; ZVFBFA-LABEL: vid_denominator2_v2bf16:
|
|
; ZVFBFA: # %bb.0:
|
|
; ZVFBFA-NEXT: lui a0, %hi(.LCPI4_0)
|
|
; ZVFBFA-NEXT: addi a0, a0, %lo(.LCPI4_0)
|
|
; ZVFBFA-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vle16.v v8, (a0)
|
|
; ZVFBFA-NEXT: ret
|
|
ret <2 x bfloat> <bfloat 0.5, bfloat 1.0>
|
|
}
|
|
|
|
define <2 x bfloat> @vid_step2_v2bf16() {
|
|
; CHECK-LABEL: vid_step2_v2bf16:
|
|
; CHECK: # %bb.0:
|
|
; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; CHECK-NEXT: vid.v v8
|
|
; CHECK-NEXT: vsll.vi v8, v8, 14
|
|
; CHECK-NEXT: ret
|
|
;
|
|
; ZVFBFA-LABEL: vid_step2_v2bf16:
|
|
; ZVFBFA: # %bb.0:
|
|
; ZVFBFA-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vid.v v8
|
|
; ZVFBFA-NEXT: vadd.vv v8, v8, v8
|
|
; ZVFBFA-NEXT: vfwcvt.f.x.v v9, v8
|
|
; ZVFBFA-NEXT: vsetvli zero, zero, e16alt, mf4, ta, ma
|
|
; ZVFBFA-NEXT: vfncvt.f.f.w v8, v9
|
|
; ZVFBFA-NEXT: ret
|
|
ret <2 x bfloat> <bfloat 0.0, bfloat 2.0>
|
|
}
|
|
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
|
|
; RV32: {{.*}}
|
|
; RV32ZVFBFMIN: {{.*}}
|
|
; RV64: {{.*}}
|
|
; RV64ZVFBFMIN: {{.*}}
|