-
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 zquarterinx hardware tests
- Loading branch information
1 parent
a09dc11
commit f80cac9
Showing
8 changed files
with
207 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#======================================================================= | ||
# Makefrag for rv32uzquarterinx tests | ||
#----------------------------------------------------------------------- | ||
|
||
ifeq ($(COMPILER), llvm) | ||
rv32uzquarterinx_sc_tests = \ | ||
fadd_b \ | ||
fmadd_b \ | ||
fmin_b \ | ||
fsgnj_b | ||
endif | ||
|
||
rv32uzquarterinx_p_tests = $(addprefix rv32uzquarterinx-p-, $(rv32uzquarterinx_sc_tests)) | ||
|
||
# Zquarterinx 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,47 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fadd_b.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
|
||
# 0xFFFFFF42; // 3.14 | ||
# 0xFFFFFF3E; // 1.618 | ||
# 0xFFFFFF34; // 0.250244 | ||
# 0xFFFFFF56; // 100.123456789 | ||
|
||
TEST_RR_OP( 2, fadd.b, 0xFFFFFF44, 0xFFFFFF42, 0xFFFFFF3E ); | ||
TEST_RR_OP( 3, fadd.b, 0xFFFFFF3F, 0xFFFFFF3E, 0xFFFFFF34 ); | ||
TEST_RR_OP( 4, fadd.b, 0xFFFFFF56, 0xFFFFFF34, 0xFFFFFF56 ); | ||
|
||
TEST_RR_OP( 5, fsub.b, 0xFFFFFF3E, 0xFFFFFF42, 0xFFFFFF3E ); | ||
TEST_RR_OP( 6, fsub.b, 0xFFFFFF3D, 0xFFFFFF3E, 0xFFFFFF34 ); | ||
TEST_RR_OP( 7, fsub.b, 0xFFFFFFD6, 0xFFFFFF34, 0xFFFFFF56 ); | ||
|
||
TEST_RR_OP( 8, fmul.b, 0xFFFFFF44, 0xFFFFFF42, 0xFFFFFF3E ); | ||
TEST_RR_OP( 9, fmul.b, 0xFFFFFF36, 0xFFFFFF3E, 0xFFFFFF34 ); | ||
TEST_RR_OP(10, fmul.b, 0xFFFFFF4E, 0xFFFFFF34, 0xFFFFFF56 ); | ||
|
||
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,50 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fmadd_b.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
# 0xFFFFFF42; // 3.14 | ||
# 0xFFFFFF3E; // 1.618 | ||
# 0xFFFFFF34; // 0.250244 | ||
# 0xFFFFFF56; // 100.123456789 | ||
|
||
TEST_RRR_PLUSD_OP( 2, fmadd.b, 0xFFFFFF45, 0xFFFFFF42, 0xFFFFFF3E, 0xFFFFFF34 ); | ||
TEST_RRR_PLUSD_OP( 3, fmadd.b, 0xFFFFFF56, 0xFFFFFF3E, 0xFFFFFF34, 0xFFFFFF56 ); | ||
TEST_RRR_PLUSD_OP( 4, fmadd.b, 0xFFFFFF4F, 0xFFFFFF34, 0xFFFFFF56, 0xFFFFFF42); | ||
|
||
#TEST_RRR_PLUSD_OP( 5, fnmadd.b, 0xFFFFFFC5, 0xFFFFFF42, 0xFFFFFF3E, 0xFFFFFF34 ); | ||
#TEST_RRR_PLUSD_OP( 6, fnmadd.b, 0xFFFFFFD6, 0xFFFFFF3E, 0xFFFFFF34, 0xFFFFFF56 ); | ||
#TEST_RRR_PLUSD_OP( 7, fnmadd.b, 0xFFFFFFCF, 0xFFFFFF34, 0xFFFFFF56, 0xFFFFFF42 ); | ||
|
||
TEST_RRR_PLUSD_OP( 8, fmsub.b, 0xFFFFFF44, 0xFFFFFF42, 0xFFFFFF3E, 0xFFFFFF34 ); | ||
TEST_RRR_PLUSD_OP( 9, fmsub.b, 0xFFFFFFD6, 0xFFFFFF3E, 0xFFFFFF34, 0xFFFFFF56); | ||
TEST_RRR_PLUSD_OP(10, fmsub.b, 0xFFFFFF4D, 0xFFFFFF34, 0xFFFFFF56, 0xFFFFFF42); | ||
|
||
TEST_RRR_PLUSD_OP(11, fnmsub.b, 0xFFFFFFC4, 0xFFFFFF42, 0xFFFFFF3E, 0xFFFFFF34 ); | ||
TEST_RRR_PLUSD_OP(12, fnmsub.b, 0xFFFFFF56, 0xFFFFFF3E, 0xFFFFFF34, 0xFFFFFF56 ); | ||
TEST_RRR_PLUSD_OP(13, fnmsub.b, 0xFFFFFFCD, 0xFFFFFF34, 0xFFFFFF56, 0xFFFFFF42 ); | ||
|
||
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,39 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fmin_b.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
# 0xFFFFFF42; // 3.14 | ||
# 0xFFFFFF56; // 100.123456789 | ||
# 0xFFFFFFD6; // -100.123456789 | ||
|
||
TEST_RR_OP( 2, fmin.b, 0xFFFFFF42, 0xFFFFFF56, 0xFFFFFF42 ); | ||
TEST_RR_OP( 3, fmin.b, 0xFFFFFFD6, 0xFFFFFFD6, 0xFFFFFF42 ); | ||
|
||
TEST_RR_OP( 8, fmax.b, 0xFFFFFF56, 0xFFFFFF56, 0xFFFFFF42 ); | ||
TEST_RR_OP( 9, fmax.b, 0xFFFFFF42, 0xFFFFFFD6, 0xFFFFFF42 ); | ||
|
||
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,46 @@ | ||
# See LICENSE for license details. | ||
|
||
#***************************************************************************** | ||
# fsgnj_b.S | ||
#----------------------------------------------------------------------------- | ||
# | ||
# Test add instruction. | ||
# | ||
|
||
#include "riscv_test.h" | ||
#include "test_macros.h" | ||
|
||
RVTEST_RV32U | ||
RVTEST_CODE_BEGIN | ||
|
||
#------------------------------------------------------------- | ||
# Arithmetic tests | ||
#------------------------------------------------------------- | ||
|
||
# 0xFFFFFF42; // 3.14 | ||
# 0xFFFFFFC2; // -3.14 | ||
# 0xFFFFFF3E; // 1.618 | ||
# 0xFFFFFFBE; // -1.618 | ||
|
||
TEST_RR_OP( 2, fsgnj.b, 0xFFFFFFC2, 0xFFFFFF42, 0xFFFFFFC2 ); #3.14 -3.14 | ||
TEST_RR_OP( 3, fsgnj.b, 0xFFFFFF3E, 0xFFFFFF3E, 0xFFFFFF42 ); #1.618 3.14 | ||
TEST_RR_OP( 4, fsgnj.b, 0xFFFFFFBE, 0xFFFFFFBE, 0xFFFFFFC2 ); #-1.618 -3.14 | ||
|
||
TEST_RR_OP( 5, fsgnjn.b, 0xFFFFFF42, 0xFFFFFF42, 0xFFFFFFC2 ); | ||
TEST_RR_OP( 6, fsgnjn.b, 0xFFFFFFBE, 0xFFFFFF3E, 0xFFFFFF42 ); | ||
TEST_RR_OP( 7, fsgnjn.b, 0xFFFFFF3E, 0xFFFFFFBE, 0xFFFFFFC2 ); | ||
|
||
TEST_RR_OP( 8, fsgnjx.b, 0xFFFFFFC2, 0xFFFFFF42, 0xFFFFFFC2 ); | ||
TEST_RR_OP( 9, fsgnjx.b, 0xFFFFFF3E, 0xFFFFFF3E, 0xFFFFFF42 ); | ||
TEST_RR_OP(10, fsgnjx.b, 0xFFFFFF3E, 0xFFFFFFBE, 0xFFFFFFC2 ); | ||
|
||
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