1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=riscv32 -mattr=+zfbfmin -verify-machineinstrs \
3 ; RUN: -target-abi ilp32f < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+zfbfmin -verify-machineinstrs \
5 ; RUN: -target-abi lp64f < %s | FileCheck %s
7 define bfloat @bfloat_imm() nounwind {
8 ; CHECK-LABEL: bfloat_imm:
10 ; CHECK-NEXT: lui a0, %hi(.LCPI0_0)
11 ; CHECK-NEXT: flh fa0, %lo(.LCPI0_0)(a0)
16 define bfloat @bfloat_imm_op(bfloat %a) nounwind {
17 ; CHECK-LABEL: bfloat_imm_op:
19 ; CHECK-NEXT: fcvt.s.bf16 fa5, fa0
20 ; CHECK-NEXT: lui a0, 260096
21 ; CHECK-NEXT: fmv.w.x fa4, a0
22 ; CHECK-NEXT: fadd.s fa5, fa5, fa4
23 ; CHECK-NEXT: fcvt.bf16.s fa0, fa5
25 %1 = fadd bfloat %a, 1.0
29 define bfloat @bfloat_zero() nounwind {
30 ; CHECK-LABEL: bfloat_zero:
32 ; CHECK-NEXT: fmv.h.x fa0, zero
37 define bfloat @bfloat_negative_zero() nounwind {
38 ; CHECK-LABEL: bfloat_negative_zero:
40 ; CHECK-NEXT: lui a0, 1048568
41 ; CHECK-NEXT: fmv.h.x fa0, a0