Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BF16 tests #395

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions riscv-test-suite/env/test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,16 +453,44 @@ RVTEST_SIGUPD_F(swreg,destreg,flagreg)
csrr flagreg, fcsr ;\
)

//Tests for floating-point instructions with a single register operand
#define TEST_FPSR_OP_V16_32( inst, destreg, freg, rm, fcsr_val, correctval, valaddr_reg, val_offset, flagreg, swreg, testreg) \
allenjbaum marked this conversation as resolved.
Show resolved Hide resolved
TEST_CASE_F(testreg, destreg, correctval, swreg, flagreg, \
LOAD_MEM_VAL(FLREG, valaddr_reg, freg, val_offset, testreg); \
LI(testreg, fcsr_val) ; \
csrw fcsr, testreg ; \
vsetivli x0, 1, e16, m1, ta, ma ; \
vfmv.s.f v1, freg ; \
inst v2, v1 ; \
vsetivli x0, 1, e32, m1, ta, ma ; \
vfmv.f.s destreg, v2 ; \
csrr flagreg, fcsr ; \
)

//Tests for floating-point instructions with a single register operand
//This variant does not take the rm field and set it while writing the instruction
#define TEST_FPSR_OP_NRM( inst, destreg, freg, fcsr_val, correctval, valaddr_reg, val_offset, flagreg, swreg, testreg) \
#define TEST_FPSR_OP_NRM_V32_16( inst, destreg, freg, fcsr_val, correctval, valaddr_reg, val_offset, flagreg, swreg, testreg) \
TEST_CASE_F(testreg, destreg, correctval, swreg, flagreg, \
LOAD_MEM_VAL(FLREG, valaddr_reg, freg, val_offset, testreg) ;\
li testreg, fcsr_val; csrw fcsr, testreg ;\
inst destreg, freg ;\
vsetivli x0, 1, e32, m1, ta, ma ; \
vfmv.s.f v1, freg ; \
vsetivli x0, 1, e16, m1, ta, ma ; \
inst v2, v1 ; \
vfmv.f.s destreg, v2 ; \
csrr flagreg, fcsr ;\
)

//Tests for floating-point instructions with a single register operand
//This variant does not take the rm field and set it while writing the instruction
#define TEST_FPSR_OP_NRM( inst, destreg, freg, fcsr_val, correctval, valaddr_reg, val_offset, flagreg, swreg, testreg) \
TEST_CASE_F(testreg, destreg, correctval, swreg, flagreg, \
LOAD_MEM_VAL(FLREG, valaddr_reg, freg, val_offset, testreg) ; \
li testreg, fcsr_val; csrw fcsr, testreg ; \
inst destreg, freg ; \
csrr flagreg, fcsr ; \
)

//Tests for floating-point instructions with a single register operand and integer destination register
#define TEST_FPID_OP( inst, destreg, freg, rm, fcsr_val, correctval, valaddr_reg, val_offset, flagreg, swreg, testreg,load_instr) \
TEST_CASE_FID(testreg, destreg, correctval, swreg, flagreg, \
Expand Down
1,254 changes: 1,254 additions & 0 deletions riscv-test-suite/rv32i_m/Zvfbfmin/src/vfncvtbf16.f.f.w_b1-01.S

Large diffs are not rendered by default.

Loading