Skip to content

Commit

Permalink
Test sew16 (zvfh) fp tests (#50)
Browse files Browse the repository at this point in the history
* Test sew16 (zvfh) fp tests

* Add flag to disable Zvfh instructions
  • Loading branch information
jerryz123 authored Sep 24, 2024
1 parent 82fef98 commit 42e1a32
Show file tree
Hide file tree
Showing 122 changed files with 2,018 additions and 16 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
INTEGER = 0##
##Set to [1] if you don't want float tests (i.e. for Zve32x or Zve64x)
##
FLOAT16 = 1##
##Set to [0] if you don't want float16 (Zvfh) tests
##
PATTERN = '.*'##
##Set to a valid regex to generate the tests of your interests (e.g. PATTERN='^v[ls].+\.v$' to generate only load/store tests)
##
Expand All @@ -55,14 +58,14 @@ CONFIGS = configs/

SPIKE = spike
PATCHER_SPIKE = build/pspike
MARCH = rv${XLEN}gcv_zvbb_zvbc_zvkg_zvkned_zvknha_zvksed_zvksh
MARCH = rv${XLEN}gcv_zvbb_zvbc_zfh_zvfh_zvkg_zvkned_zvknha_zvksed_zvksh
MABI = lp64d

ifeq ($(XLEN), 32)
MABI = ilp32f
VARCH = zvl${VLEN}b_zve32f
VARCH = zvl${VLEN}b_zve32f_zfh_zfhmin_zvfh
else
VARCH = zvl${VLEN}b_zve64d
VARCH = zvl${VLEN}b_zve64d_zfh_zfhmin_zvfh
endif

RISCV_PREFIX = riscv64-unknown-elf-
Expand Down Expand Up @@ -112,7 +115,7 @@ unittest:

generate-stage1: clean-out build
@mkdir -p ${OUTPUT_STAGE1}
build/generator -VLEN ${VLEN} -XLEN ${XLEN} -split=${SPLIT} -integer=${INTEGER} -pattern='${PATTERN}' -testfloat3level='${TESTFLOAT3LEVEL}' -repeat='${REPEAT}' -stage1output ${OUTPUT_STAGE1} -configs ${CONFIGS}
build/generator -VLEN ${VLEN} -XLEN ${XLEN} -split=${SPLIT} -integer=${INTEGER} -float16=${FLOAT16} -pattern='${PATTERN}' -testfloat3level='${TESTFLOAT3LEVEL}' -repeat='${REPEAT}' -stage1output ${OUTPUT_STAGE1} -configs ${CONFIGS}

include Makefrag

Expand Down
14 changes: 14 additions & 0 deletions configs/vfadd.vf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfadd.vf"
format = "vd,vs2,fs1,vm"

[tests]
fsew16 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
["3.14159265", "0.00000001"],
["1.1", "-1235.1"],
["-1.0", "-2.0"],
["nan", "-nan"],
["inf", "-inf"],
["quiet_nan", "signaling_nan"],
["smallest_nonzero_float", "largest_subnormal_float"],
["smallest_normal_float", "max_float"],
["-smallest_nonzero_float", "-largest_subnormal_float"],
["-smallest_normal_float", "-max_float"]
]
fsew32 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfadd.vv.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ format = "vd,vs2,vs1,vm"

[tests]

fsew16 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
["3.14159265", "0.00000001"],
["1.1", "-1235.1"],
["-1.0", "-2.0"],
["nan", "-nan"],
["inf", "-inf"],
["quiet_nan", "signaling_nan"],
["smallest_nonzero_float", "largest_subnormal_float"],
["smallest_normal_float", "max_float"],
["-smallest_nonzero_float", "-largest_subnormal_float"],
["-smallest_normal_float", "-max_float"]
]
fsew32 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
Expand Down
15 changes: 15 additions & 0 deletions configs/vfclass.v.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ name = "vfclass.v"
format = "vd,vs2,vm"

[tests]
sew16 = [
[0x7e00], # Quiet NaN
[0x7e01], # Quiet NaN "1"
[0x7e02], # Quiet NaN "2"
[0x7d00], # Signaling NaN
[0x7c00], # Inf
[0xfc00], # -Inf
[0x0000], # 0
[0x8000], # -0
[0xc248], # -3.14159
[0x4248], # 3.14159
[0x0001], # Subnormal
[0x03ff], # Subnormal
]

sew32 = [
[0x7fc00000], # Quiet NaN
[0x7fc00001], # Quiet NaN "1"
Expand Down
5 changes: 5 additions & 0 deletions configs/vfcvt.f.x.v.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name = "vfcvt.f.x.v"
format = "vd,vs2,vm"

[tests]
sew16 = [
[0xffff],
[0xfffe],
[0x2],
]
sew32 = [
[0xffffffff],
[0xfffffffe],
Expand Down
5 changes: 5 additions & 0 deletions configs/vfcvt.f.xu.v.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name = "vfcvt.f.xu.v"
format = "vd,vs2,vm"

[tests]
sew16 = [
[0xffff],
[0xfffe],
[0x2],
]
sew32 = [
[0xffffffff],
[0xfffffffe],
Expand Down
15 changes: 15 additions & 0 deletions configs/vfcvt.rtz.x.f.v.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ name = "vfcvt.rtz.x.f.v"
format = "vd,vs2,vm"

[tests]
sew16 = [
[0x7e00], # Quiet NaN
[0x7e01], # Quiet NaN "1"
[0x7e02], # Quiet NaN "2"
[0x7d00], # Signaling NaN
[0x7c00], # Inf
[0xfc00], # -Inf
[0x0000], # 0
[0x8000], # -0
[0xc248], # -3.14159
[0x4248], # 3.14159
[0x0001], # Subnormal
[0x03ff], # Subnormal
]

sew32 = [
[0x7fc00000], # Quiet NaN
[0x7fc00001], # Quiet NaN "1"
Expand Down
15 changes: 15 additions & 0 deletions configs/vfcvt.rtz.xu.f.v.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ name = "vfcvt.rtz.xu.f.v"
format = "vd,vs2,vm"

[tests]
sew16 = [
[0x7e00], # Quiet NaN
[0x7e01], # Quiet NaN "1"
[0x7e02], # Quiet NaN "2"
[0x7d00], # Signaling NaN
[0x7c00], # Inf
[0xfc00], # -Inf
[0x0000], # 0
[0x8000], # -0
[0xc248], # -3.14159
[0x4248], # 3.14159
[0x0001], # Subnormal
[0x03ff], # Subnormal
]

sew32 = [
[0x7fc00000], # Quiet NaN
[0x7fc00001], # Quiet NaN "1"
Expand Down
14 changes: 14 additions & 0 deletions configs/vfcvt.x.f.v.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfcvt.x.f.v"
format = "vd,vs2,vm"

[tests]
sew16 = [
[0x7e00], # Quiet NaN
[0x7e01], # Quiet NaN "1"
[0x7e02], # Quiet NaN "2"
[0x7d00], # Signaling NaN
[0x7c00], # Inf
[0xfc00], # -Inf
[0x0000], # 0
[0x8000], # -0
[0xc248], # -3.14159
[0x4248], # 3.14159
[0x0001], # Subnormal
[0x03ff], # Subnormal
]
sew32 = [
[0x7fc00000], # Quiet NaN
[0x7fc00001], # Quiet NaN "1"
Expand Down
15 changes: 15 additions & 0 deletions configs/vfcvt.xu.f.v.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ name = "vfcvt.xu.f.v"
format = "vd,vs2,vm"

[tests]
sew16 = [
[0x7e00], # Quiet NaN
[0x7e01], # Quiet NaN "1"
[0x7e02], # Quiet NaN "2"
[0x7d00], # Signaling NaN
[0x7c00], # Inf
[0xfc00], # -Inf
[0x0000], # 0
[0x8000], # -0
[0xc248], # -3.14159
[0x4248], # 3.14159
[0x0001], # Subnormal
[0x03ff], # Subnormal
]

sew32 = [
[0x7fc00000], # Quiet NaN
[0x7fc00001], # Quiet NaN "1"
Expand Down
14 changes: 14 additions & 0 deletions configs/vfdiv.vf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfdiv.vf"
format = "vd,vs2,fs1,vm"

[tests]
fsew16 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
["3.14159265", "0.00000001"],
["1.1", "-1235.1"],
["-1.0", "-2.0"],
["nan", "-nan"],
["inf", "-inf"],
["quiet_nan", "signaling_nan"],
["smallest_nonzero_float", "largest_subnormal_float"],
["smallest_normal_float", "max_float"],
["-smallest_nonzero_float", "-largest_subnormal_float"],
["-smallest_normal_float", "-max_float"]
]
fsew32 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfdiv.vv.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfdiv.vv"
format = "vd,vs2,vs1,vm"

[tests]
fsew16 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
["3.14159265", "0.00000001"],
["1.1", "-1235.1"],
["-1.0", "-2.0"],
["nan", "-nan"],
["inf", "-inf"],
["quiet_nan", "signaling_nan"],
["smallest_nonzero_float", "largest_subnormal_float"],
["smallest_normal_float", "max_float"],
["-smallest_nonzero_float", "-largest_subnormal_float"],
["-smallest_normal_float", "-max_float"]
]
fsew32 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfmacc.vf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfmacc.vf"
format = "vd,fs1,vs2,vm"

[tests]
fsew16 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
["0.002", "3.14159265", "0.00000001"],
["0.0", "1.1", "-1235.1"],
["-1.0", "-1.0", "-2.0"],
["0.002", "nan", "-nan"],
["0.0", "inf", "-inf"],
["-1.0", "quiet_nan", "signaling_nan"],
["0.002", "smallest_nonzero_float", "largest_subnormal_float"],
["0.0", "smallest_normal_float", "max_float"],
["-1.0", "-smallest_nonzero_float", "-largest_subnormal_float"],
["0.002", "-smallest_normal_float", "-max_float"]
]
fsew32 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfmacc.vv.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfmacc.vv"
format = "vd,vs1,vs2,vm"

[tests]
fsew16 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
["0.002", "3.14159265", "0.00000001"],
["0.0", "1.1", "-1235.1"],
["-1.0", "-1.0", "-2.0"],
["0.002", "nan", "-nan"],
["0.0", "inf", "-inf"],
["-1.0", "quiet_nan", "signaling_nan"],
["0.002", "smallest_nonzero_float", "largest_subnormal_float"],
["0.0", "smallest_normal_float", "max_float"],
["-1.0", "-smallest_nonzero_float", "-largest_subnormal_float"],
["0.002", "-smallest_normal_float", "-max_float"]
]
fsew32 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfmadd.vf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfmadd.vf"
format = "vd,fs1,vs2,vm"

[tests]
fsew16 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
["0.002", "3.14159265", "0.00000001"],
["0.0", "1.1", "-1235.1"],
["-1.0", "-1.0", "-2.0"],
["0.002", "nan", "-nan"],
["0.0", "inf", "-inf"],
["-1.0", "quiet_nan", "signaling_nan"],
["0.002", "smallest_nonzero_float", "largest_subnormal_float"],
["0.0", "smallest_normal_float", "max_float"],
["-1.0", "-smallest_nonzero_float", "-largest_subnormal_float"],
["0.002", "-smallest_normal_float", "-max_float"]
]
fsew32 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfmadd.vv.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfmadd.vv"
format = "vd,vs1,vs2,vm"

[tests]
fsew16 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
["0.002", "3.14159265", "0.00000001"],
["0.0", "1.1", "-1235.1"],
["-1.0", "-1.0", "-2.0"],
["0.002", "nan", "-nan"],
["0.0", "inf", "-inf"],
["-1.0", "quiet_nan", "signaling_nan"],
["0.002", "smallest_nonzero_float", "largest_subnormal_float"],
["0.0", "smallest_normal_float", "max_float"],
["-1.0", "-smallest_nonzero_float", "-largest_subnormal_float"],
["0.002", "-smallest_normal_float", "-max_float"]
]
fsew32 = [
["0.0", "2.5", "1.0"],
["-1.0", "-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfmax.vf.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfmax.vf"
format = "vd,vs2,fs1,vm"

[tests]
fsew16 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
["3.14159265", "0.00000001"],
["1.1", "-1235.1"],
["-1.0", "-2.0"],
["nan", "-nan"],
["inf", "-inf"],
["quiet_nan", "signaling_nan"],
["smallest_nonzero_float", "largest_subnormal_float"],
["smallest_normal_float", "max_float"],
["-smallest_nonzero_float", "-largest_subnormal_float"],
["-smallest_normal_float", "-max_float"]
]
fsew32 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
Expand Down
14 changes: 14 additions & 0 deletions configs/vfmax.vv.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ name = "vfmax.vv"
format = "vd,vs2,vs1,vm"

[tests]
fsew16 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
["3.14159265", "0.00000001"],
["1.1", "-1235.1"],
["-1.0", "-2.0"],
["nan", "-nan"],
["inf", "-inf"],
["quiet_nan", "signaling_nan"],
["smallest_nonzero_float", "largest_subnormal_float"],
["smallest_normal_float", "max_float"],
["-smallest_nonzero_float", "-largest_subnormal_float"],
["-smallest_normal_float", "-max_float"]
]
fsew32 = [
["2.5", "1.0"],
["-1235.1", "1.1"],
Expand Down
Loading

0 comments on commit 42e1a32

Please sign in to comment.