-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Add zfinx and zhinx hardware tests
- Loading branch information
1 parent
4982a51
commit c3d5d63
Showing
19 changed files
with
528 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#======================================================================= | ||
# Makefrag for rv32uzfinx tests | ||
#----------------------------------------------------------------------- | ||
|
||
ifeq ($(COMPILER), llvm) | ||
rv32uzfinx_sc_tests = \ | ||
fadd \ | ||
fdiv \ | ||
fmadd \ | ||
fmin \ | ||
fsgnj | ||
endif | ||
|
||
rv32uzfinx_p_tests = $(addprefix rv32uzfinx-p-, $(rv32uzfinx_sc_tests)) | ||
|
||
# Zfinx extensions are not tested on Spike |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fadd.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
TEST_RR_OP( 2, fadd.s, 0x40600000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 3, fadd.s, 0xC49A4000, 0xC49A6333, 0x3F8CCCCD ); | ||
TEST_RR_OP( 4, fadd.s, 0x40490FDB, 0x40490FDB, 0x322BCC77 ); | ||
|
||
TEST_RR_OP( 5, fsub.s, 0x3FC00000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 6, fsub.s, 0xC49A4000, 0xC49A6333, 0xBF8CCCCD ); | ||
TEST_RR_OP( 7, fsub.s, 0x40490FDB, 0x40490FDB, 0x322BCC77 ); | ||
|
||
TEST_RR_OP( 8, fmul.s, 0x40200000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 9, fmul.s, 0x44A9D385, 0xC49A6333, 0xBF8CCCCD ); | ||
TEST_RR_OP(10, fmul.s, 0x3306EE2D, 0x40490FDB, 0x322BCC77 ); | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fdiv.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
TEST_RR_OP( 2, fdiv.s, 0x3F93EEE0, 0x40490FDB, 0x402DF854 ); | ||
TEST_RR_OP( 3, fdiv.s, 0xBF7FC5A2, 0xC49A4000, 0x449A6333 ); | ||
TEST_RR_OP( 4, fdiv.s, 0x40490FDB, 0x40490FDB, 0x3F800000 ); | ||
|
||
TEST_R_OP( 5, fsqrt.s, 0x3FE2DFC5, 0x40490FDB ); | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fmadd.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
TEST_RRR_PLUSD_OP( 2, fmadd.s, 0x40600000, 0x3F800000, 0x40200000, 0x3F800000 ); # 3.5, 1.0, 2.5, 1.0 | ||
TEST_RRR_PLUSD_OP( 3, fmadd.s, 0x449A8666, 0xBF800000, 0xC49A6333, 0x3F8CCCCD ); #1236.2, -1.0, -1235.1, 1.1 | ||
TEST_RRR_PLUSD_OP( 4, fmadd.s, 0xC1400000, 0x40000000, 0xC0A00000, 0xC0000000 ); # -12.0, 2.0, -5.0, -2.0 | ||
|
||
TEST_RRR_PLUSD_OP( 5, fnmadd.s, 0xC0600000, 0x3F800000, 0x40200000, 0x3F800000 ); # -3.5, 1.0, 2.5, 1.0 | ||
TEST_RRR_PLUSD_OP( 6, fnmadd.s, 0xC49A8666, 0xBF800000, 0xC49A6333, 0x3F8CCCCD ); #-1236.2, -1.0, -1235.1, 1.1 | ||
TEST_RRR_PLUSD_OP( 7, fnmadd.s, 0x41400000, 0x40000000, 0xC0A00000, 0xC0000000 ); # 12.0, 2.0, -5.0, -2.0 | ||
|
||
TEST_RRR_PLUSD_OP( 8, fmsub.s, 0x3FC00000, 0x3F800000, 0x40200000, 0x3F800000 ); # -1.5, 1.0, 2.5, 1.0 | ||
TEST_RRR_PLUSD_OP( 9, fmsub.s, 0x449A4000, 0xBF800000, 0xC49A6333, 0x3F8CCCCD ); # 1234.0, -1.0, -1235.1, 1.1 | ||
TEST_RRR_PLUSD_OP( 10, fmsub.s, 0xC1000000, 0x40000000, 0xC0A00000, 0xC0000000 ); # -8.0, 2.0, -5.0, -2.0 | ||
|
||
TEST_RRR_PLUSD_OP( 11, fnmsub.s, 0xBFC00000, 0x3F800000, 0x40200000, 0x3F800000 ); # -1.5, 1.0, 2.5, 1.0 | ||
TEST_RRR_PLUSD_OP( 12, fnmsub.s, 0xC49A4000, 0xBF800000, 0xC49A6333, 0x3F8CCCCD ); #-1234.0, -1.0, -1235.1, 1.1 | ||
TEST_RRR_PLUSD_OP( 13, fnmsub.s, 0x41000000, 0x40000000, 0xC0A00000, 0xC0000000 ); # 8.0, 2.0, -5.0, -2.0 | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fmin.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
TEST_RR_OP( 2, fmin.s, 0x3F800000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 3, fmin.s, 0xC49A6333, 0xC49A6333, 0x3F8CCCCD ); | ||
TEST_RR_OP( 4, fmin.s, 0xC49A6333, 0x3F8CCCCD, 0xC49A6333 ); | ||
TEST_RR_OP( 5, fmin.s, 0xC49A6333, 0x7FC00000, 0xC49A6333 ); | ||
TEST_RR_OP( 6, fmin.s, 0x322BCC77, 0x40490FDB, 0x322BCC77 ); | ||
TEST_RR_OP( 7, fmin.s, 0xC0000000, 0xBF800000, 0xC0000000 ); | ||
|
||
TEST_RR_OP( 8, fmax.s, 0x40200000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 9, fmax.s, 0x3F8CCCCD, 0xC49A6333, 0x3F8CCCCD ); | ||
TEST_RR_OP(10, fmax.s, 0x3F8CCCCD, 0x3F8CCCCD, 0xC49A6333 ); | ||
TEST_RR_OP(11, fmax.s, 0xC49A6333, 0x7FC00000, 0xC49A6333 ); | ||
TEST_RR_OP(12, fmax.s, 0x40490FDB, 0x40490FDB, 0x322BCC77 ); | ||
TEST_RR_OP(13, fmax.s, 0xBF800000, 0xBF800000, 0xC0000000 ); | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fsgnj.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
TEST_RR_OP( 2, fsgnj.s, 0x40200000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 3, fsgnj.s, 0x449A6333, 0xC49A6333, 0x3F8CCCCD ); | ||
TEST_RR_OP( 4, fsgnj.s, 0xBF8CCCCD, 0x3F8CCCCD, 0xC49A6333 ); | ||
|
||
TEST_RR_OP( 5, fsgnjn.s, 0xC0200000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 6, fsgnjn.s, 0xC49A6333, 0xC49A6333, 0x3F8CCCCD ); | ||
TEST_RR_OP( 7, fsgnjn.s, 0x3F8CCCCD, 0x3F8CCCCD, 0xC49A6333 ); | ||
|
||
TEST_RR_OP( 8, fsgnjx.s, 0x40200000, 0x40200000, 0x3F800000 ); | ||
TEST_RR_OP( 9, fsgnjx.s, 0xC49A6333, 0xC49A6333, 0x3F8CCCCD ); | ||
TEST_RR_OP(10, fsgnjx.s, 0xBF8CCCCD, 0x3F8CCCCD, 0xC49A6333 ); | ||
|
||
TEST_PASSFAIL | ||
|
||
RVTEST_CODE_END | ||
|
||
.data | ||
RVTEST_DATA_BEGIN | ||
|
||
TEST_DATA | ||
|
||
RVTEST_DATA_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#======================================================================= | ||
# Makefrag for rv32uzfinx tests | ||
#----------------------------------------------------------------------- | ||
|
||
ifeq ($(COMPILER), llvm) | ||
rv32uzhinx_sc_tests = \ | ||
fadd_h \ | ||
fdiv_h \ | ||
fmadd_h \ | ||
fmin_h \ | ||
fsgnj_h | ||
endif | ||
|
||
rv32uzhinx_p_tests = $(addprefix rv32uzhinx-p-, $(rv32uzhinx_sc_tests)) | ||
|
||
# Zhinx extensions are not tested on Spike |
Oops, something went wrong.