From 42e1a32226cf4edbd95e40db2fe7c7577a51b022 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Tue, 24 Sep 2024 12:48:55 -0700 Subject: [PATCH] Test sew16 (zvfh) fp tests (#50) * Test sew16 (zvfh) fp tests * Add flag to disable Zvfh instructions --- Makefile | 11 +- configs/vfadd.vf.toml | 14 + configs/vfadd.vv.toml | 14 + configs/vfclass.v.toml | 15 + configs/vfcvt.f.x.v.toml | 5 + configs/vfcvt.f.xu.v.toml | 5 + configs/vfcvt.rtz.x.f.v.toml | 15 + configs/vfcvt.rtz.xu.f.v.toml | 15 + configs/vfcvt.x.f.v.toml | 14 + configs/vfcvt.xu.f.v.toml | 15 + configs/vfdiv.vf.toml | 14 + configs/vfdiv.vv.toml | 14 + configs/vfmacc.vf.toml | 14 + configs/vfmacc.vv.toml | 14 + configs/vfmadd.vf.toml | 14 + configs/vfmadd.vv.toml | 14 + configs/vfmax.vf.toml | 14 + configs/vfmax.vv.toml | 14 + configs/vfmerge.vfm.toml | 14 + configs/vfmin.vf.toml | 14 + configs/vfmin.vv.toml | 14 + configs/vfmsac.vf.toml | 14 + configs/vfmsac.vv.toml | 14 + configs/vfmsub.vf.toml | 14 + configs/vfmsub.vv.toml | 14 + configs/vfmul.vf.toml | 14 + configs/vfmul.vv.toml | 14 + configs/vfmv.f.s.toml | 1 + configs/vfmv.s.f.toml | 1 + configs/vfmv.v.f.toml | 1 + configs/vfncvt.f.f.w.toml | 5 + configs/vfncvt.f.x.w.toml | 5 + configs/vfncvt.f.xu.w.toml | 5 + configs/vfncvt.rod.f.f.w.toml | 5 + configs/vfncvt.rtz.x.f.w.toml | 14 + configs/vfncvt.rtz.xu.f.w.toml | 14 + configs/vfncvt.xu.f.w.toml | 15 + configs/vfnmacc.vf.toml | 14 + configs/vfnmacc.vv.toml | 14 + configs/vfnmadd.vf.toml | 14 + configs/vfnmadd.vv.toml | 14 + configs/vfnmsac.vf.toml | 14 + configs/vfnmsac.vv.toml | 14 + configs/vfnmsub.vf.toml | 14 + configs/vfnmsub.vv.toml | 14 + configs/vfrdiv.vf.toml | 14 + configs/vfrec7.v.toml | 8 + configs/vfredmax.vs.toml | 14 + configs/vfredmin.vs.toml | 14 + configs/vfredosum.vs.toml | 14 + configs/vfredusum.vs.toml | 11 + configs/vfrsqrt7.v.toml | 8 + configs/vfrsub.vf.toml | 14 + configs/vfsgnj.vf.toml | 12 + configs/vfsgnj.vv.toml | 12 + configs/vfsgnjn.vf.toml | 12 + configs/vfsgnjn.vv.toml | 12 + configs/vfsgnjx.vf.toml | 12 + configs/vfsgnjx.vv.toml | 12 + configs/vfslide1down.vf.toml | 14 + configs/vfslide1up.vf.toml | 14 + configs/vfsqrt.v.toml | 8 + configs/vfsub.vf.toml | 14 + configs/vfsub.vv.toml | 14 + configs/vfwadd.vf.toml | 14 + configs/vfwadd.vv.toml | 14 + configs/vfwadd.wf.toml | 14 + configs/vfwadd.wv.toml | 14 + configs/vfwcvt.f.f.v.toml | 5 + configs/vfwcvt.f.x.v.toml | 5 + configs/vfwcvt.f.xu.v.toml | 5 + configs/vfwcvt.rtz.x.f.v.toml | 15 + configs/vfwcvt.rtz.xu.f.v.toml | 15 + configs/vfwcvt.x.f.v.toml | 14 + configs/vfwcvt.xu.f.v.toml | 14 + configs/vfwmacc.vf.toml | 14 + configs/vfwmacc.vv.toml | 14 + configs/vfwmsac.vf.toml | 14 + configs/vfwmsac.vv.toml | 14 + configs/vfwmul.vf.toml | 14 + configs/vfwmul.vv.toml | 14 + configs/vfwnmacc.vf.toml | 14 + configs/vfwnmacc.vv.toml | 14 + configs/vfwnmsac.vf.toml | 14 + configs/vfwnmsac.vv.toml | 14 + configs/vfwredosum.vs.toml | 14 + configs/vfwredusum.vs.toml | 11 + configs/vfwsub.vf.toml | 14 + configs/vfwsub.vv.toml | 14 + configs/vfwsub.wf.toml | 14 + configs/vfwsub.wv.toml | 14 + configs/vmfeq.vf.toml | 14 + configs/vmfeq.vv.toml | 14 + configs/vmfge.vf.toml | 14 + configs/vmfgt.vf.toml | 14 + configs/vmfle.vf.toml | 14 + configs/vmfle.vv.toml | 14 + configs/vmflt.vf.toml | 14 + configs/vmflt.vv.toml | 14 + configs/vmfne.vf.toml | 14 + configs/vmfne.vv.toml | 14 + generator/insn.go | 13 +- generator/insn_fdvs2.go | 2 +- generator/insn_g.go | 12 +- generator/insn_util.go | 8 +- generator/insn_vdfs1.go | 5 +- generator/insn_vdfs1vs2vm.go | 5 +- generator/insn_vdvs1vs2vm.go | 2 +- generator/insn_vdvs2fs1v0.go | 5 +- generator/insn_vdvs2fs1vm.go | 5 +- generator/insn_vdvs2vm.go | 2 +- generator/insn_vdvs2vs1vm.go | 2 +- generator/tests.go | 51 +++ go.mod | 1 + go.sum | 2 + main.go | 4 + single/single.go | 2 + testfloat3/genCases.h | 9 + testfloat3/genCases_f16.c | 583 +++++++++++++++++++++++++++++++++ testfloat3/testfloat3.c | 21 ++ testfloat3/testfloat3.go | 29 ++ testfloat3/testfloat3.h | 9 + 122 files changed, 2018 insertions(+), 16 deletions(-) create mode 100644 testfloat3/genCases_f16.c diff --git a/Makefile b/Makefile index fbe60cb..4af4802 100644 --- a/Makefile +++ b/Makefile @@ -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) ## @@ -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- @@ -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 diff --git a/configs/vfadd.vf.toml b/configs/vfadd.vf.toml index 61316b5..1215de7 100644 --- a/configs/vfadd.vf.toml +++ b/configs/vfadd.vf.toml @@ -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"], diff --git a/configs/vfadd.vv.toml b/configs/vfadd.vv.toml index e5a74f4..fe31a62 100644 --- a/configs/vfadd.vv.toml +++ b/configs/vfadd.vv.toml @@ -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"], diff --git a/configs/vfclass.v.toml b/configs/vfclass.v.toml index 0b335c9..d237d4e 100644 --- a/configs/vfclass.v.toml +++ b/configs/vfclass.v.toml @@ -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" diff --git a/configs/vfcvt.f.x.v.toml b/configs/vfcvt.f.x.v.toml index 31ff18d..cdf07be 100644 --- a/configs/vfcvt.f.x.v.toml +++ b/configs/vfcvt.f.x.v.toml @@ -2,6 +2,11 @@ name = "vfcvt.f.x.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0xffff], + [0xfffe], + [0x2], +] sew32 = [ [0xffffffff], [0xfffffffe], diff --git a/configs/vfcvt.f.xu.v.toml b/configs/vfcvt.f.xu.v.toml index 7a83c61..c9fb59b 100644 --- a/configs/vfcvt.f.xu.v.toml +++ b/configs/vfcvt.f.xu.v.toml @@ -2,6 +2,11 @@ name = "vfcvt.f.xu.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0xffff], + [0xfffe], + [0x2], +] sew32 = [ [0xffffffff], [0xfffffffe], diff --git a/configs/vfcvt.rtz.x.f.v.toml b/configs/vfcvt.rtz.x.f.v.toml index d1e899f..6677af5 100644 --- a/configs/vfcvt.rtz.x.f.v.toml +++ b/configs/vfcvt.rtz.x.f.v.toml @@ -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" diff --git a/configs/vfcvt.rtz.xu.f.v.toml b/configs/vfcvt.rtz.xu.f.v.toml index 75d7bbe..ae11262 100644 --- a/configs/vfcvt.rtz.xu.f.v.toml +++ b/configs/vfcvt.rtz.xu.f.v.toml @@ -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" diff --git a/configs/vfcvt.x.f.v.toml b/configs/vfcvt.x.f.v.toml index 56eecfb..172fd5d 100644 --- a/configs/vfcvt.x.f.v.toml +++ b/configs/vfcvt.x.f.v.toml @@ -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" diff --git a/configs/vfcvt.xu.f.v.toml b/configs/vfcvt.xu.f.v.toml index 06ab9eb..7534a19 100644 --- a/configs/vfcvt.xu.f.v.toml +++ b/configs/vfcvt.xu.f.v.toml @@ -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" diff --git a/configs/vfdiv.vf.toml b/configs/vfdiv.vf.toml index ee30c15..095b117 100644 --- a/configs/vfdiv.vf.toml +++ b/configs/vfdiv.vf.toml @@ -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"], diff --git a/configs/vfdiv.vv.toml b/configs/vfdiv.vv.toml index 4eb13c3..7ceac50 100644 --- a/configs/vfdiv.vv.toml +++ b/configs/vfdiv.vv.toml @@ -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"], diff --git a/configs/vfmacc.vf.toml b/configs/vfmacc.vf.toml index 7fd4fe9..2da313b 100644 --- a/configs/vfmacc.vf.toml +++ b/configs/vfmacc.vf.toml @@ -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"], diff --git a/configs/vfmacc.vv.toml b/configs/vfmacc.vv.toml index 8bd0889..349401b 100644 --- a/configs/vfmacc.vv.toml +++ b/configs/vfmacc.vv.toml @@ -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"], diff --git a/configs/vfmadd.vf.toml b/configs/vfmadd.vf.toml index 2b113a1..445ed9a 100644 --- a/configs/vfmadd.vf.toml +++ b/configs/vfmadd.vf.toml @@ -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"], diff --git a/configs/vfmadd.vv.toml b/configs/vfmadd.vv.toml index 8e89e5a..d0e6a23 100644 --- a/configs/vfmadd.vv.toml +++ b/configs/vfmadd.vv.toml @@ -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"], diff --git a/configs/vfmax.vf.toml b/configs/vfmax.vf.toml index b928255..156fae0 100644 --- a/configs/vfmax.vf.toml +++ b/configs/vfmax.vf.toml @@ -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"], diff --git a/configs/vfmax.vv.toml b/configs/vfmax.vv.toml index a671dc8..724bb52 100644 --- a/configs/vfmax.vv.toml +++ b/configs/vfmax.vv.toml @@ -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"], diff --git a/configs/vfmerge.vfm.toml b/configs/vfmerge.vfm.toml index f4d9389..9361890 100644 --- a/configs/vfmerge.vfm.toml +++ b/configs/vfmerge.vfm.toml @@ -2,6 +2,20 @@ name = "vfmerge.vfm" format = "vd,vs2,fs1,v0" [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"], diff --git a/configs/vfmin.vf.toml b/configs/vfmin.vf.toml index c8c2600..6d99933 100644 --- a/configs/vfmin.vf.toml +++ b/configs/vfmin.vf.toml @@ -2,6 +2,20 @@ name = "vfmin.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"], diff --git a/configs/vfmin.vv.toml b/configs/vfmin.vv.toml index 11962c6..2c85672 100644 --- a/configs/vfmin.vv.toml +++ b/configs/vfmin.vv.toml @@ -2,6 +2,20 @@ name = "vfmin.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"], diff --git a/configs/vfmsac.vf.toml b/configs/vfmsac.vf.toml index 8a6fc1f..60263e8 100644 --- a/configs/vfmsac.vf.toml +++ b/configs/vfmsac.vf.toml @@ -2,6 +2,20 @@ name = "vfmsac.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"], diff --git a/configs/vfmsac.vv.toml b/configs/vfmsac.vv.toml index 9e65896..bf9d3da 100644 --- a/configs/vfmsac.vv.toml +++ b/configs/vfmsac.vv.toml @@ -2,6 +2,20 @@ name = "vfmsac.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"], diff --git a/configs/vfmsub.vf.toml b/configs/vfmsub.vf.toml index 9d5dc87..2ba04d4 100644 --- a/configs/vfmsub.vf.toml +++ b/configs/vfmsub.vf.toml @@ -2,6 +2,20 @@ name = "vfmsub.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"], diff --git a/configs/vfmsub.vv.toml b/configs/vfmsub.vv.toml index 24af61a..da0bfd1 100644 --- a/configs/vfmsub.vv.toml +++ b/configs/vfmsub.vv.toml @@ -2,6 +2,20 @@ name = "vfmsub.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"], diff --git a/configs/vfmul.vf.toml b/configs/vfmul.vf.toml index 9a4fae8..a462853 100644 --- a/configs/vfmul.vf.toml +++ b/configs/vfmul.vf.toml @@ -2,6 +2,20 @@ name = "vfmul.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"], diff --git a/configs/vfmul.vv.toml b/configs/vfmul.vv.toml index 273e54d..9db351d 100644 --- a/configs/vfmul.vv.toml +++ b/configs/vfmul.vv.toml @@ -2,6 +2,20 @@ name = "vfmul.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"], diff --git a/configs/vfmv.f.s.toml b/configs/vfmv.f.s.toml index 03d1ae1..2bbbee6 100644 --- a/configs/vfmv.f.s.toml +++ b/configs/vfmv.f.s.toml @@ -2,5 +2,6 @@ name = "vfmv.f.s" format = "fd,vs2" [tests] +fsew16 = [["42.0"]] fsew32 = [["42.0"]] fsew64 = [["42.0"]] diff --git a/configs/vfmv.s.f.toml b/configs/vfmv.s.f.toml index 603ca18..7c2b56b 100644 --- a/configs/vfmv.s.f.toml +++ b/configs/vfmv.s.f.toml @@ -2,5 +2,6 @@ name = "vfmv.s.f" format = "vd,fs1" [tests] +fsew16 = [["42.0"]] fsew32 = [["42.0"]] fsew64 = [["42.0"]] diff --git a/configs/vfmv.v.f.toml b/configs/vfmv.v.f.toml index 83fe9a1..a7cda54 100644 --- a/configs/vfmv.v.f.toml +++ b/configs/vfmv.v.f.toml @@ -2,5 +2,6 @@ name = "vfmv.v.f" format = "vd,fs1" [tests] +fsew16 = [["42.0"]] fsew32 = [["42.0"]] fsew64 = [["42.0"]] diff --git a/configs/vfncvt.f.f.w.toml b/configs/vfncvt.f.f.w.toml index b56a432..6e9a548 100644 --- a/configs/vfncvt.f.f.w.toml +++ b/configs/vfncvt.f.f.w.toml @@ -2,6 +2,11 @@ name = "vfncvt.f.f.w" format = "vd,vs2,vm" [tests] +sew32 = [ + [0xffffffff], + [0xfffffffe], + [0x2], +] sew64 = [ ["0xffffffffffffffff"], ["0xfffffffffffffffe"], diff --git a/configs/vfncvt.f.x.w.toml b/configs/vfncvt.f.x.w.toml index 6679e05..8540539 100644 --- a/configs/vfncvt.f.x.w.toml +++ b/configs/vfncvt.f.x.w.toml @@ -2,6 +2,11 @@ name = "vfncvt.f.x.w" format = "vd,vs2,vm" [tests] +sew32 = [ + [0xffffffff], + [0xfffffffe], + [0x2], +] sew64 = [ ["0xffffffffffffffff"], ["0xfffffffffffffffe"], diff --git a/configs/vfncvt.f.xu.w.toml b/configs/vfncvt.f.xu.w.toml index 7caca35..bfb787c 100644 --- a/configs/vfncvt.f.xu.w.toml +++ b/configs/vfncvt.f.xu.w.toml @@ -2,6 +2,11 @@ name = "vfncvt.f.xu.w" format = "vd,vs2,vm" [tests] +sew32 = [ + [0xffffffff], + [0xfffffffe], + [0x2], +] sew64 = [ ["0xffffffffffffffff"], ["0xfffffffffffffffe"], diff --git a/configs/vfncvt.rod.f.f.w.toml b/configs/vfncvt.rod.f.f.w.toml index 5cd4dd2..2101616 100644 --- a/configs/vfncvt.rod.f.f.w.toml +++ b/configs/vfncvt.rod.f.f.w.toml @@ -2,6 +2,11 @@ name = "vfncvt.rod.f.f.w" format = "vd,vs2,vm" [tests] +sew32 = [ + [0xffffffff], + [0xfffffffe], + [0x2], +] sew64 = [ ["0xffffffffffffffff"], ["0xfffffffffffffffe"], diff --git a/configs/vfncvt.rtz.x.f.w.toml b/configs/vfncvt.rtz.x.f.w.toml index c9886d7..0108473 100644 --- a/configs/vfncvt.rtz.x.f.w.toml +++ b/configs/vfncvt.rtz.x.f.w.toml @@ -2,6 +2,20 @@ name = "vfncvt.rtz.x.f.w" format = "vd,vs2,vm" [tests] +sew32 = [ + [0x7fc00000], # Quiet NaN + [0x7fc00001], # Quiet NaN "1" + [0x7fc00002], # Quiet NaN "2" + [0x7fa00000], # Signaling NaN + [0x7f800000], # Inf + [0xff800000], # -Inf + [0x00000000], # 0 + [0x80000000], # -0 + [0xc0490e56], # -3.14159 + [0x40490fd0], # 3.14159 + [0x00000001], # Subnormal + [0x007fffff], # Subnormal +] sew64 = [ ["0x7ff8000000000000"], # Quiet NaN ["0x7ff8000000000001"], # Quiet NaN "1" diff --git a/configs/vfncvt.rtz.xu.f.w.toml b/configs/vfncvt.rtz.xu.f.w.toml index c7fed42..9a47a8a 100644 --- a/configs/vfncvt.rtz.xu.f.w.toml +++ b/configs/vfncvt.rtz.xu.f.w.toml @@ -2,6 +2,20 @@ name = "vfncvt.rtz.xu.f.w" format = "vd,vs2,vm" [tests] +sew32 = [ + [0x7fc00000], # Quiet NaN + [0x7fc00001], # Quiet NaN "1" + [0x7fc00002], # Quiet NaN "2" + [0x7fa00000], # Signaling NaN + [0x7f800000], # Inf + [0xff800000], # -Inf + [0x00000000], # 0 + [0x80000000], # -0 + [0xc0490e56], # -3.14159 + [0x40490fd0], # 3.14159 + [0x00000001], # Subnormal + [0x007fffff], # Subnormal +] sew64 = [ ["0x7ff8000000000000"], # Quiet NaN ["0x7ff8000000000001"], # Quiet NaN "1" diff --git a/configs/vfncvt.xu.f.w.toml b/configs/vfncvt.xu.f.w.toml index 37b203e..785edbc 100644 --- a/configs/vfncvt.xu.f.w.toml +++ b/configs/vfncvt.xu.f.w.toml @@ -2,6 +2,21 @@ name = "vfncvt.xu.f.w" format = "vd,vs2,vm" [tests] +sew32 = [ + [0x7fc00000], # Quiet NaN + [0x7fc00001], # Quiet NaN "1" + [0x7fc00002], # Quiet NaN "2" + [0x7fa00000], # Signaling NaN + [0x7f800000], # Inf + [0xff800000], # -Inf + [0x00000000], # 0 + [0x80000000], # -0 + [0xc0490e56], # -3.14159 + [0x40490fd0], # 3.14159 + [0x00000001], # Subnormal + [0x007fffff], # Subnormal +] + sew64 = [ ["0x7ff8000000000000"], # Quiet NaN ["0x7ff8000000000001"], # Quiet NaN "1" diff --git a/configs/vfnmacc.vf.toml b/configs/vfnmacc.vf.toml index 0488005..86a072b 100644 --- a/configs/vfnmacc.vf.toml +++ b/configs/vfnmacc.vf.toml @@ -2,6 +2,20 @@ name = "vfnmacc.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"], diff --git a/configs/vfnmacc.vv.toml b/configs/vfnmacc.vv.toml index f419ab3..5feed21 100644 --- a/configs/vfnmacc.vv.toml +++ b/configs/vfnmacc.vv.toml @@ -2,6 +2,20 @@ name = "vfnmacc.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"], diff --git a/configs/vfnmadd.vf.toml b/configs/vfnmadd.vf.toml index 898b49d..daf1821 100644 --- a/configs/vfnmadd.vf.toml +++ b/configs/vfnmadd.vf.toml @@ -2,6 +2,20 @@ name = "vfnmadd.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"], diff --git a/configs/vfnmadd.vv.toml b/configs/vfnmadd.vv.toml index 3a4acaf..c923b2a 100644 --- a/configs/vfnmadd.vv.toml +++ b/configs/vfnmadd.vv.toml @@ -2,6 +2,20 @@ name = "vfnmadd.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"], diff --git a/configs/vfnmsac.vf.toml b/configs/vfnmsac.vf.toml index d216f62..f402751 100644 --- a/configs/vfnmsac.vf.toml +++ b/configs/vfnmsac.vf.toml @@ -2,6 +2,20 @@ name = "vfnmsac.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"], diff --git a/configs/vfnmsac.vv.toml b/configs/vfnmsac.vv.toml index e1595cd..3cf4f47 100644 --- a/configs/vfnmsac.vv.toml +++ b/configs/vfnmsac.vv.toml @@ -2,6 +2,20 @@ name = "vfnmsac.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"], diff --git a/configs/vfnmsub.vf.toml b/configs/vfnmsub.vf.toml index b5e1d93..e02dab3 100644 --- a/configs/vfnmsub.vf.toml +++ b/configs/vfnmsub.vf.toml @@ -2,6 +2,20 @@ name = "vfnmsub.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"], diff --git a/configs/vfnmsub.vv.toml b/configs/vfnmsub.vv.toml index be4b1e2..c6b2cfd 100644 --- a/configs/vfnmsub.vv.toml +++ b/configs/vfnmsub.vv.toml @@ -2,6 +2,20 @@ name = "vfnmsub.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"], diff --git a/configs/vfrdiv.vf.toml b/configs/vfrdiv.vf.toml index edf629c..0d5a948 100644 --- a/configs/vfrdiv.vf.toml +++ b/configs/vfrdiv.vf.toml @@ -2,6 +2,20 @@ name = "vfrdiv.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"], diff --git a/configs/vfrec7.v.toml b/configs/vfrec7.v.toml index bc0a3b1..d2c52d1 100644 --- a/configs/vfrec7.v.toml +++ b/configs/vfrec7.v.toml @@ -2,6 +2,14 @@ name = "vfrec7.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0x4248], # 3.1415926 + [0x70e2], # 10000 + [0xbc00], # -1 + [0x5958], # 171.0 + [0x0002], # 1.60795e-7 +] + sew32 = [ [0x40490fda], # 3.1415926 [0x461c4000], # 10000 diff --git a/configs/vfredmax.vs.toml b/configs/vfredmax.vs.toml index e754e47..e3bea7b 100644 --- a/configs/vfredmax.vs.toml +++ b/configs/vfredmax.vs.toml @@ -2,6 +2,20 @@ name = "vfredmax.vs" 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"], diff --git a/configs/vfredmin.vs.toml b/configs/vfredmin.vs.toml index 9f0ccd3..17b487d 100644 --- a/configs/vfredmin.vs.toml +++ b/configs/vfredmin.vs.toml @@ -2,6 +2,20 @@ name = "vfredmin.vs" 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"], diff --git a/configs/vfredosum.vs.toml b/configs/vfredosum.vs.toml index 1ed4551..9345e6b 100644 --- a/configs/vfredosum.vs.toml +++ b/configs/vfredosum.vs.toml @@ -2,6 +2,20 @@ name = "vfredosum.vs" 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"], diff --git a/configs/vfredusum.vs.toml b/configs/vfredusum.vs.toml index be4a157..8529af8 100644 --- a/configs/vfredusum.vs.toml +++ b/configs/vfredusum.vs.toml @@ -4,6 +4,17 @@ format = "vd,vs2,vs1,vm" notestfloat3 = true [tests] +fsew16 = [ + ["2.5", "1.0"], + ["-1235.1", "1.1"], + ["1.1", "-1235.1"], + ["-1.0", "-2.0"], + ["nan", "-nan"], + ["inf", "-inf"], + ["quiet_nan", "signaling_nan"], + ["smallest_nonzero_float", "largest_subnormal_float"], + ["-smallest_nonzero_float", "-largest_subnormal_float"] +] fsew32 = [ ["2.5", "1.0"], ["-1235.5", "1.5"], diff --git a/configs/vfrsqrt7.v.toml b/configs/vfrsqrt7.v.toml index 013d7fc..8c0de5b 100644 --- a/configs/vfrsqrt7.v.toml +++ b/configs/vfrsqrt7.v.toml @@ -2,6 +2,14 @@ name = "vfrsqrt7.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0x4248], # 3.1415926 + [0x70e2], # 10000 + [0xbc00], # -1 + [0x5958], # 171.0 + [0x0002], # 1.60795e-7 +] + sew32 = [ [0x40490fda], # 3.1415926 [0x461c4000], # 10000 diff --git a/configs/vfrsub.vf.toml b/configs/vfrsub.vf.toml index 4f470e7..748e362 100644 --- a/configs/vfrsub.vf.toml +++ b/configs/vfrsub.vf.toml @@ -2,6 +2,20 @@ name = "vfrsub.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"], diff --git a/configs/vfsgnj.vf.toml b/configs/vfsgnj.vf.toml index 855ae88..628dd76 100644 --- a/configs/vfsgnj.vf.toml +++ b/configs/vfsgnj.vf.toml @@ -2,6 +2,18 @@ name = "vfsgnj.vf" format = "vd,vs2,fs1,vm" [tests] +fsew16 = [ + [ "1.0", "1.0"], + [ "1.0", "-1.0"], + [ "1.0", "-0.0"], + [ "1.0", "0.0"], + ["-1.0", "-0.0"], + ["-1.0", "0.0"], + ["-0.0", "0.0"], + [ "0.0", "-0.0"], + ["-3.14159265", "0.0001"], + ["-3.14159265", "-0.0001"] +] fsew32 = [ [ "1.0", "1.0"], [ "1.0", "-1.0"], diff --git a/configs/vfsgnj.vv.toml b/configs/vfsgnj.vv.toml index f13fdc7..014e94b 100644 --- a/configs/vfsgnj.vv.toml +++ b/configs/vfsgnj.vv.toml @@ -2,6 +2,18 @@ name = "vfsgnj.vv" format = "vd,vs2,vs1,vm" [tests] +fsew16 = [ + [ "1.0", "1.0"], + [ "1.0", "-1.0"], + [ "1.0", "-0.0"], + [ "1.0", "0.0"], + ["-1.0", "-0.0"], + ["-1.0", "0.0"], + ["-0.0", "0.0"], + [ "0.0", "-0.0"], + ["-3.14159265", "0.0001"], + ["-3.14159265", "-0.0001"] +] fsew32 = [ [ "1.0", "1.0"], [ "1.0", "-1.0"], diff --git a/configs/vfsgnjn.vf.toml b/configs/vfsgnjn.vf.toml index 65bfb49..777c699 100644 --- a/configs/vfsgnjn.vf.toml +++ b/configs/vfsgnjn.vf.toml @@ -2,6 +2,18 @@ name = "vfsgnjn.vf" format = "vd,vs2,fs1,vm" [tests] +fsew16 = [ + [ "1.0", "1.0"], + [ "1.0", "-1.0"], + [ "1.0", "-0.0"], + [ "1.0", "0.0"], + ["-1.0", "-0.0"], + ["-1.0", "0.0"], + ["-0.0", "0.0"], + [ "0.0", "-0.0"], + ["-3.14159265", "0.0001"], + ["-3.14159265", "-0.0001"] +] fsew32 = [ [ "1.0", "1.0"], [ "1.0", "-1.0"], diff --git a/configs/vfsgnjn.vv.toml b/configs/vfsgnjn.vv.toml index 891633c..ddd399f 100644 --- a/configs/vfsgnjn.vv.toml +++ b/configs/vfsgnjn.vv.toml @@ -2,6 +2,18 @@ name = "vfsgnjn.vv" format = "vd,vs2,vs1,vm" [tests] +fsew16 = [ + [ "1.0", "1.0"], + [ "1.0", "-1.0"], + [ "1.0", "-0.0"], + [ "1.0", "0.0"], + ["-1.0", "-0.0"], + ["-1.0", "0.0"], + ["-0.0", "0.0"], + [ "0.0", "-0.0"], + ["-3.14159265", "0.0001"], + ["-3.14159265", "-0.0001"] +] fsew32 = [ [ "1.0", "1.0"], [ "1.0", "-1.0"], diff --git a/configs/vfsgnjx.vf.toml b/configs/vfsgnjx.vf.toml index eab3dbe..860069e 100644 --- a/configs/vfsgnjx.vf.toml +++ b/configs/vfsgnjx.vf.toml @@ -2,6 +2,18 @@ name = "vfsgnjx.vf" format = "vd,vs2,fs1,vm" [tests] +fsew16 = [ + [ "1.0", "1.0"], + [ "1.0", "-1.0"], + [ "1.0", "-0.0"], + [ "1.0", "0.0"], + ["-1.0", "-0.0"], + ["-1.0", "0.0"], + ["-0.0", "0.0"], + [ "0.0", "-0.0"], + ["-3.14159265", "0.0001"], + ["-3.14159265", "-0.0001"] +] fsew32 = [ [ "1.0", "1.0"], [ "1.0", "-1.0"], diff --git a/configs/vfsgnjx.vv.toml b/configs/vfsgnjx.vv.toml index 863578d..b5b6ec1 100644 --- a/configs/vfsgnjx.vv.toml +++ b/configs/vfsgnjx.vv.toml @@ -2,6 +2,18 @@ name = "vfsgnjx.vv" format = "vd,vs2,vs1,vm" [tests] +fsew16 = [ + [ "1.0", "1.0"], + [ "1.0", "-1.0"], + [ "1.0", "-0.0"], + [ "1.0", "0.0"], + ["-1.0", "-0.0"], + ["-1.0", "0.0"], + ["-0.0", "0.0"], + [ "0.0", "-0.0"], + ["-3.14159265", "0.0001"], + ["-3.14159265", "-0.0001"] +] fsew32 = [ [ "1.0", "1.0"], [ "1.0", "-1.0"], diff --git a/configs/vfslide1down.vf.toml b/configs/vfslide1down.vf.toml index dff92ad..0f5b8d1 100644 --- a/configs/vfslide1down.vf.toml +++ b/configs/vfslide1down.vf.toml @@ -2,6 +2,20 @@ name = "vfslide1down.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"], diff --git a/configs/vfslide1up.vf.toml b/configs/vfslide1up.vf.toml index 296ba5e..759ef03 100644 --- a/configs/vfslide1up.vf.toml +++ b/configs/vfslide1up.vf.toml @@ -2,6 +2,20 @@ name = "vfslide1up.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"], diff --git a/configs/vfsqrt.v.toml b/configs/vfsqrt.v.toml index 969cadc..33f1971 100644 --- a/configs/vfsqrt.v.toml +++ b/configs/vfsqrt.v.toml @@ -2,6 +2,14 @@ name = "vfsqrt.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0x4248], # 3.1415926 + [0x70e2], # 10000 + [0xbc00], # -1 + [0x5958], # 171.0 + [0x0002], # 1.60795e-7 +] + sew32 = [ [0x40490fda], # 3.1415926 [0x461c4000], # 10000 diff --git a/configs/vfsub.vf.toml b/configs/vfsub.vf.toml index 4c88a20..7029ad9 100644 --- a/configs/vfsub.vf.toml +++ b/configs/vfsub.vf.toml @@ -2,6 +2,20 @@ name = "vfsub.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"], diff --git a/configs/vfsub.vv.toml b/configs/vfsub.vv.toml index f1cec01..0b2fa8c 100644 --- a/configs/vfsub.vv.toml +++ b/configs/vfsub.vv.toml @@ -2,6 +2,20 @@ name = "vfsub.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"], diff --git a/configs/vfwadd.vf.toml b/configs/vfwadd.vf.toml index 4eaf32d..08efcc5 100644 --- a/configs/vfwadd.vf.toml +++ b/configs/vfwadd.vf.toml @@ -2,6 +2,20 @@ name = "vfwadd.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"], diff --git a/configs/vfwadd.vv.toml b/configs/vfwadd.vv.toml index 6ed0f72..a452167 100644 --- a/configs/vfwadd.vv.toml +++ b/configs/vfwadd.vv.toml @@ -2,6 +2,20 @@ name = "vfwadd.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"], diff --git a/configs/vfwadd.wf.toml b/configs/vfwadd.wf.toml index e7b7af0..752cbef 100644 --- a/configs/vfwadd.wf.toml +++ b/configs/vfwadd.wf.toml @@ -2,6 +2,20 @@ name = "vfwadd.wf" 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"], diff --git a/configs/vfwadd.wv.toml b/configs/vfwadd.wv.toml index c5a3987..52b1468 100644 --- a/configs/vfwadd.wv.toml +++ b/configs/vfwadd.wv.toml @@ -2,6 +2,20 @@ name = "vfwadd.wv" 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"], diff --git a/configs/vfwcvt.f.f.v.toml b/configs/vfwcvt.f.f.v.toml index c40f50d..81238b8 100644 --- a/configs/vfwcvt.f.f.v.toml +++ b/configs/vfwcvt.f.f.v.toml @@ -2,6 +2,11 @@ name = "vfwcvt.f.f.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0xffff], + [0xfffe], + [0x2], +] sew32 = [ [0xffffffff], [0xfffffffe], diff --git a/configs/vfwcvt.f.x.v.toml b/configs/vfwcvt.f.x.v.toml index 69ad5b5..04fae65 100644 --- a/configs/vfwcvt.f.x.v.toml +++ b/configs/vfwcvt.f.x.v.toml @@ -2,6 +2,11 @@ name = "vfwcvt.f.x.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0xffff], + [0xfffe], + [0x2], +] sew32 = [ [0xffffffff], [0xfffffffe], diff --git a/configs/vfwcvt.f.xu.v.toml b/configs/vfwcvt.f.xu.v.toml index 6148774..8430147 100644 --- a/configs/vfwcvt.f.xu.v.toml +++ b/configs/vfwcvt.f.xu.v.toml @@ -2,6 +2,11 @@ name = "vfwcvt.f.xu.v" format = "vd,vs2,vm" [tests] +sew16 = [ + [0xffff], + [0xfffe], + [0x2], +] sew32 = [ [0xffffffff], [0xfffffffe], diff --git a/configs/vfwcvt.rtz.x.f.v.toml b/configs/vfwcvt.rtz.x.f.v.toml index 286eb7f..66fc622 100644 --- a/configs/vfwcvt.rtz.x.f.v.toml +++ b/configs/vfwcvt.rtz.x.f.v.toml @@ -2,6 +2,21 @@ name = "vfwcvt.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" diff --git a/configs/vfwcvt.rtz.xu.f.v.toml b/configs/vfwcvt.rtz.xu.f.v.toml index ec18298..1d09c92 100644 --- a/configs/vfwcvt.rtz.xu.f.v.toml +++ b/configs/vfwcvt.rtz.xu.f.v.toml @@ -2,6 +2,21 @@ name = "vfwcvt.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" diff --git a/configs/vfwcvt.x.f.v.toml b/configs/vfwcvt.x.f.v.toml index 676d4d4..b0c9fc0 100644 --- a/configs/vfwcvt.x.f.v.toml +++ b/configs/vfwcvt.x.f.v.toml @@ -2,6 +2,20 @@ name = "vfwcvt.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" diff --git a/configs/vfwcvt.xu.f.v.toml b/configs/vfwcvt.xu.f.v.toml index 3272787..f152f2c 100644 --- a/configs/vfwcvt.xu.f.v.toml +++ b/configs/vfwcvt.xu.f.v.toml @@ -2,6 +2,20 @@ name = "vfwcvt.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" diff --git a/configs/vfwmacc.vf.toml b/configs/vfwmacc.vf.toml index 2bdf788..4f65266 100644 --- a/configs/vfwmacc.vf.toml +++ b/configs/vfwmacc.vf.toml @@ -2,6 +2,20 @@ name = "vfwmacc.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"], diff --git a/configs/vfwmacc.vv.toml b/configs/vfwmacc.vv.toml index 2dea713..cbf959e 100644 --- a/configs/vfwmacc.vv.toml +++ b/configs/vfwmacc.vv.toml @@ -2,6 +2,20 @@ name = "vfwmacc.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"], diff --git a/configs/vfwmsac.vf.toml b/configs/vfwmsac.vf.toml index 594fcdf..553837f 100644 --- a/configs/vfwmsac.vf.toml +++ b/configs/vfwmsac.vf.toml @@ -2,6 +2,20 @@ name = "vfwmsac.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"], diff --git a/configs/vfwmsac.vv.toml b/configs/vfwmsac.vv.toml index b836b9c..463b32d 100644 --- a/configs/vfwmsac.vv.toml +++ b/configs/vfwmsac.vv.toml @@ -2,6 +2,20 @@ name = "vfwmsac.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"], diff --git a/configs/vfwmul.vf.toml b/configs/vfwmul.vf.toml index 05766d6..13ef246 100644 --- a/configs/vfwmul.vf.toml +++ b/configs/vfwmul.vf.toml @@ -2,6 +2,20 @@ name = "vfwmul.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"], diff --git a/configs/vfwmul.vv.toml b/configs/vfwmul.vv.toml index 47b28a1..1a49629 100644 --- a/configs/vfwmul.vv.toml +++ b/configs/vfwmul.vv.toml @@ -2,6 +2,20 @@ name = "vfwmul.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"], diff --git a/configs/vfwnmacc.vf.toml b/configs/vfwnmacc.vf.toml index 5268b4e..1958456 100644 --- a/configs/vfwnmacc.vf.toml +++ b/configs/vfwnmacc.vf.toml @@ -2,6 +2,20 @@ name = "vfwnmacc.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"], diff --git a/configs/vfwnmacc.vv.toml b/configs/vfwnmacc.vv.toml index a6d8a35..c96dd97 100644 --- a/configs/vfwnmacc.vv.toml +++ b/configs/vfwnmacc.vv.toml @@ -2,6 +2,20 @@ name = "vfwnmacc.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"], diff --git a/configs/vfwnmsac.vf.toml b/configs/vfwnmsac.vf.toml index 72fcbba..0f403d4 100644 --- a/configs/vfwnmsac.vf.toml +++ b/configs/vfwnmsac.vf.toml @@ -2,6 +2,20 @@ name = "vfwnmsac.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"], diff --git a/configs/vfwnmsac.vv.toml b/configs/vfwnmsac.vv.toml index 8ec248b..c8f1141 100644 --- a/configs/vfwnmsac.vv.toml +++ b/configs/vfwnmsac.vv.toml @@ -2,6 +2,20 @@ name = "vfwnmsac.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"], diff --git a/configs/vfwredosum.vs.toml b/configs/vfwredosum.vs.toml index 751bdeb..db1f699 100644 --- a/configs/vfwredosum.vs.toml +++ b/configs/vfwredosum.vs.toml @@ -2,6 +2,20 @@ name = "vfwredosum.vs" 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"], diff --git a/configs/vfwredusum.vs.toml b/configs/vfwredusum.vs.toml index 6f3ba67..d31bf0a 100644 --- a/configs/vfwredusum.vs.toml +++ b/configs/vfwredusum.vs.toml @@ -4,6 +4,17 @@ format = "vd,vs2,vs1,vm" notestfloat3 = true [tests] +fsew16 = [ + ["2.5", "1.0"], + ["-1235.5", "1.5"], + ["1.5", "-1235.5"], + ["-1.0", "-2.0"], + ["nan", "-nan"], + ["inf", "-inf"], + ["quiet_nan", "signaling_nan"], + ["smallest_nonzero_float", "largest_subnormal_float"], + ["-smallest_nonzero_float", "-largest_subnormal_float"] +] fsew32 = [ ["2.5", "1.0"], ["-1235.5", "1.5"], diff --git a/configs/vfwsub.vf.toml b/configs/vfwsub.vf.toml index 852dea3..2a5cdd8 100644 --- a/configs/vfwsub.vf.toml +++ b/configs/vfwsub.vf.toml @@ -2,6 +2,20 @@ name = "vfwsub.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"], diff --git a/configs/vfwsub.vv.toml b/configs/vfwsub.vv.toml index 20c984d..b89b288 100644 --- a/configs/vfwsub.vv.toml +++ b/configs/vfwsub.vv.toml @@ -2,6 +2,20 @@ name = "vfwsub.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"], diff --git a/configs/vfwsub.wf.toml b/configs/vfwsub.wf.toml index e5f464f..68ee6df 100644 --- a/configs/vfwsub.wf.toml +++ b/configs/vfwsub.wf.toml @@ -2,6 +2,20 @@ name = "vfwsub.wf" 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"], diff --git a/configs/vfwsub.wv.toml b/configs/vfwsub.wv.toml index 0773a71..8d0c4fe 100644 --- a/configs/vfwsub.wv.toml +++ b/configs/vfwsub.wv.toml @@ -2,6 +2,20 @@ name = "vfwsub.wv" 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"], diff --git a/configs/vmfeq.vf.toml b/configs/vmfeq.vf.toml index 2cab98d..026556d 100644 --- a/configs/vmfeq.vf.toml +++ b/configs/vmfeq.vf.toml @@ -2,6 +2,20 @@ name = "vmfeq.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"], diff --git a/configs/vmfeq.vv.toml b/configs/vmfeq.vv.toml index e1c48ff..2824b16 100644 --- a/configs/vmfeq.vv.toml +++ b/configs/vmfeq.vv.toml @@ -2,6 +2,20 @@ name = "vmfeq.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"], diff --git a/configs/vmfge.vf.toml b/configs/vmfge.vf.toml index 9989087..5616c2b 100644 --- a/configs/vmfge.vf.toml +++ b/configs/vmfge.vf.toml @@ -2,6 +2,20 @@ name = "vmfge.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"], diff --git a/configs/vmfgt.vf.toml b/configs/vmfgt.vf.toml index 030dc2c..d5a2fb0 100644 --- a/configs/vmfgt.vf.toml +++ b/configs/vmfgt.vf.toml @@ -2,6 +2,20 @@ name = "vmfgt.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"], diff --git a/configs/vmfle.vf.toml b/configs/vmfle.vf.toml index 6f24bd8..75a1532 100644 --- a/configs/vmfle.vf.toml +++ b/configs/vmfle.vf.toml @@ -2,6 +2,20 @@ name = "vmfle.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"], diff --git a/configs/vmfle.vv.toml b/configs/vmfle.vv.toml index 25f08fe..9f5e4ba 100644 --- a/configs/vmfle.vv.toml +++ b/configs/vmfle.vv.toml @@ -2,6 +2,20 @@ name = "vmfle.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"], diff --git a/configs/vmflt.vf.toml b/configs/vmflt.vf.toml index 403e84e..3189830 100644 --- a/configs/vmflt.vf.toml +++ b/configs/vmflt.vf.toml @@ -2,6 +2,20 @@ name = "vmflt.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"], diff --git a/configs/vmflt.vv.toml b/configs/vmflt.vv.toml index 176219d..8507e7f 100644 --- a/configs/vmflt.vv.toml +++ b/configs/vmflt.vv.toml @@ -2,6 +2,20 @@ name = "vmflt.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"], diff --git a/configs/vmfne.vf.toml b/configs/vmfne.vf.toml index 9b1b1ae..c5d64d4 100644 --- a/configs/vmfne.vf.toml +++ b/configs/vmfne.vf.toml @@ -2,6 +2,20 @@ name = "vmfne.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"], diff --git a/configs/vmfne.vv.toml b/configs/vmfne.vv.toml index 7e68e9f..ebd49fb 100644 --- a/configs/vmfne.vv.toml +++ b/configs/vmfne.vv.toml @@ -2,6 +2,20 @@ name = "vmfne.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"], diff --git a/generator/insn.go b/generator/insn.go index 51af6cd..2af6c8e 100644 --- a/generator/insn.go +++ b/generator/insn.go @@ -19,6 +19,7 @@ type Option struct { VLEN VLEN XLEN XLEN Repeat int + Float16 bool } const minStride = -1 // Must be negative @@ -400,7 +401,17 @@ func (i *Insn) testCases(float bool, sew SEW) [][]any { res = append(res, l) } case 16: - for _, c := range i.Tests.SEW16 { + if float { + for _, c := range i.Tests.FSEW16 { + l := make([]any, len(c)) + for b, op := range c { + l[b] = op + } + res = append(res, l) + } + break + } + for _, c := range i.Tests.SEW16 { l := make([]any, len(c)) for b, op := range c { l[b] = op diff --git a/generator/insn_fdvs2.go b/generator/insn_fdvs2.go index 4eabb97..e3f1dda 100644 --- a/generator/insn_fdvs2.go +++ b/generator/insn_fdvs2.go @@ -6,7 +6,7 @@ import ( ) func (i *Insn) genCodeFdVs2(pos int) []string { - combinations := i.combinations([]LMUL{1}, floatSEWs, []bool{false}, i.vxrms()) + combinations := i.combinations([]LMUL{1}, i.floatSEWs(), []bool{false}, i.vxrms()) res := make([]string, 0, len(combinations)) for _, c := range combinations[pos:] { diff --git a/generator/insn_g.go b/generator/insn_g.go index 117ae5e..c6f2b2f 100644 --- a/generator/insn_g.go +++ b/generator/insn_g.go @@ -66,9 +66,13 @@ func (i *Insn) gWriteTestData(float bool, testfloat bool, cont bool, lmul LMUL, } if float && testfloat && !cont { + testfloat3.InitF16(numops) testfloat3.InitF32(numops) testfloat3.InitF64(numops) } + nextf16 := func() uint16 { + return testfloat3.GenF16(numops)[idx] + } nextf32 := func() float32 { return testfloat3.GenF32(numops)[idx] } @@ -86,8 +90,12 @@ func (i *Insn) gWriteTestData(float bool, testfloat bool, cont bool, lmul LMUL, b := a % len(cases) _ = binary.Write(buf, binary.LittleEndian, convNum[uint8](cases[b][idx])) case 16: - b := a % len(cases) - _ = binary.Write(buf, binary.LittleEndian, convNum[uint16](cases[b][idx])) + if (float && testfloat && a >= len(cases)) || cont { + _ = binary.Write(buf, binary.LittleEndian, nextf16()) + } else { + b := a % len(cases) + _ = binary.Write(buf, binary.LittleEndian, convNum[uint16](cases[b][idx])) + } case 32: // Manual test cases exhausted, use testfloat3 to generate new ones. if (float && testfloat && a >= len(cases)) || cont { diff --git a/generator/insn_util.go b/generator/insn_util.go index 4d2e426..2634d4a 100644 --- a/generator/insn_util.go +++ b/generator/insn_util.go @@ -29,7 +29,13 @@ type VXSAT bool type SEW int var allSEWs = []SEW{8, 16, 32, 64} -var floatSEWs = []SEW{32, 64} +func (i *Insn) floatSEWs() []SEW { + if (i.Option.Float16) { + return []SEW{16,32,64} + } else { + return []SEW{32,64} + } +} var validSEWs = map[SEW]struct{}{ allSEWs[0]: {}, allSEWs[1]: {}, diff --git a/generator/insn_vdfs1.go b/generator/insn_vdfs1.go index 4264afe..de06c7d 100644 --- a/generator/insn_vdfs1.go +++ b/generator/insn_vdfs1.go @@ -7,7 +7,7 @@ import ( func (i *Insn) genCodeVdFs1(pos int) []string { lmuls := iff(strings.HasSuffix(i.Name, ".s.f"), []LMUL{1}, allLMULs) - combinations := i.combinations(lmuls, floatSEWs, []bool{false}, i.vxrms()) + combinations := i.combinations(lmuls, i.floatSEWs(), []bool{false}, i.vxrms()) res := make([]string, 0, len(combinations)) for _, c := range combinations[pos:] { @@ -23,6 +23,9 @@ func (i *Insn) genCodeVdFs1(pos int) []string { builder.WriteString("# -------------- TEST BEGIN --------------\n") switch c.SEW { + case 16: + builder.WriteString(fmt.Sprintf("li s0, %d\n", convNum[uint16](cases[0][0]))) + builder.WriteString(fmt.Sprintf("fmv.h.x f0, s0\n")) case 32: builder.WriteString(fmt.Sprintf("li s0, %d\n", convNum[uint32](cases[0][0]))) builder.WriteString(fmt.Sprintf("fmv.w.x f0, s0\n")) diff --git a/generator/insn_vdfs1vs2vm.go b/generator/insn_vdfs1vs2vm.go index de4f089..d0ba53b 100644 --- a/generator/insn_vdfs1vs2vm.go +++ b/generator/insn_vdfs1vs2vm.go @@ -10,7 +10,7 @@ func (i *Insn) genCodeVdFs1Vs2Vm(pos int) []string { vdWidening := strings.HasPrefix(i.Name, "vfw") vdSize := iff(vdWidening, 2, 1) - sews := iff(vdWidening, floatSEWs[:len(floatSEWs)-1], floatSEWs) + sews := iff(vdWidening, i.floatSEWs()[:len(i.floatSEWs())-1], i.floatSEWs()) combinations := i.combinations( iff(vdWidening, wideningMULs, allLMULs), sews, @@ -46,6 +46,9 @@ func (i *Insn) genCodeVdFs1Vs2Vm(pos int) []string { for a := 0; a < len(cases); a++ { builder.WriteString("# -------------- TEST BEGIN --------------\n") switch c.SEW { + case 16: + builder.WriteString(fmt.Sprintf("li s0, 0x%x\n", convNum[uint16](cases[a][1]))) + builder.WriteString(fmt.Sprintf("fmv.h.x f0, s0\n")) case 32: builder.WriteString(fmt.Sprintf("li s0, 0x%x\n", convNum[uint32](cases[a][1]))) builder.WriteString(fmt.Sprintf("fmv.w.x f0, s0\n")) diff --git a/generator/insn_vdvs1vs2vm.go b/generator/insn_vdvs1vs2vm.go index 479fdb8..dd521fa 100644 --- a/generator/insn_vdvs1vs2vm.go +++ b/generator/insn_vdvs1vs2vm.go @@ -12,7 +12,7 @@ func (i *Insn) genCodeVdVs1Vs2Vm(pos int) []string { vdSize := iff(vdWidening, 2, 1) vs1Size := 1 - sews := iff(float, floatSEWs, allSEWs) + sews := iff(float, i.floatSEWs(), allSEWs) sews = iff(vdWidening, sews[:len(sews)-1], sews) combinations := i.combinations( iff(vdWidening, wideningMULs, allLMULs), diff --git a/generator/insn_vdvs2fs1v0.go b/generator/insn_vdvs2fs1v0.go index acced6b..18d7a23 100644 --- a/generator/insn_vdvs2fs1v0.go +++ b/generator/insn_vdvs2fs1v0.go @@ -6,7 +6,7 @@ import ( ) func (i *Insn) genCodeVdVs2Fs1V0(pos int) []string { - combinations := i.combinations(allLMULs, floatSEWs, []bool{false}, i.vxrms()) + combinations := i.combinations(allLMULs, i.floatSEWs(), []bool{false}, i.vxrms()) res := make([]string, 0, len(combinations)) for _, c := range combinations[pos:] { @@ -28,6 +28,9 @@ func (i *Insn) genCodeVdVs2Fs1V0(pos int) []string { for a := 0; a < len(cases); a++ { builder.WriteString("# -------------- TEST BEGIN --------------\n") switch c.SEW { + case 16: + builder.WriteString(fmt.Sprintf("li s0, 0x%x\n", convNum[uint16](cases[a][0]))) + builder.WriteString(fmt.Sprintf("fmv.h.x f0, s0\n")) case 32: builder.WriteString(fmt.Sprintf("li s0, 0x%x\n", convNum[uint32](cases[a][0]))) builder.WriteString(fmt.Sprintf("fmv.w.x f0, s0\n")) diff --git a/generator/insn_vdvs2fs1vm.go b/generator/insn_vdvs2fs1vm.go index 4130c48..134b68b 100644 --- a/generator/insn_vdvs2fs1vm.go +++ b/generator/insn_vdvs2fs1vm.go @@ -12,7 +12,7 @@ func (i *Insn) genCodeVdVs2Fs1Vm(pos int) []string { vdSize := iff(vdWidening, 2, 1) vs2Size := iff(vs2Widening, 2, 1) - sews := iff(vdWidening || vs2Widening, floatSEWs[:len(floatSEWs)-1], floatSEWs) + sews := iff(vdWidening || vs2Widening, i.floatSEWs()[:len(i.floatSEWs())-1], i.floatSEWs()) combinations := i.combinations( iff(vdWidening || vs2Widening, wideningMULs, allLMULs), sews, @@ -50,6 +50,9 @@ func (i *Insn) genCodeVdVs2Fs1Vm(pos int) []string { for a := 0; a < len(cases); a++ { builder.WriteString("# -------------- TEST BEGIN --------------\n") switch c.SEW { + case 16: + builder.WriteString(fmt.Sprintf("li s0, 0x%x\n", convNum[uint16](cases[a][0]))) + builder.WriteString(fmt.Sprintf("fmv.h.x f0, s0\n")) case 32: builder.WriteString(fmt.Sprintf("li s0, 0x%x\n", convNum[uint32](cases[a][0]))) builder.WriteString(fmt.Sprintf("fmv.w.x f0, s0\n")) diff --git a/generator/insn_vdvs2vm.go b/generator/insn_vdvs2vm.go index d85df6f..b681c91 100644 --- a/generator/insn_vdvs2vm.go +++ b/generator/insn_vdvs2vm.go @@ -14,7 +14,7 @@ func (i *Insn) genCodeVdVs2Vm(pos int) []string { vs2Size := iff(vdNarrowing, 2, 1) lmuls := iff(vdWidening || vdNarrowing, wideningMULs, allLMULs) - sews := iff(vdWidening || vdNarrowing, floatSEWs[:len(floatSEWs)-1], floatSEWs) + sews := iff(vdWidening || vdNarrowing, i.floatSEWs()[:len(i.floatSEWs())-1], i.floatSEWs()) combinations := i.combinations(lmuls, sews, []bool{false, true}, i.vxrms()) res := make([]string, 0, len(combinations)) diff --git a/generator/insn_vdvs2vs1vm.go b/generator/insn_vdvs2vs1vm.go index 904b5b3..4aaa88d 100644 --- a/generator/insn_vdvs2vs1vm.go +++ b/generator/insn_vdvs2vs1vm.go @@ -14,7 +14,7 @@ func (i *Insn) genCodeVdVs2Vs1Vm(pos int) []string { vdSize := iff(vdWidening, 2, 1) vs2Size := iff(vs2Widening, 2, 1) - sews := iff(float, floatSEWs, allSEWs) + sews := iff(float, i.floatSEWs(), allSEWs) sews = iff(vdWidening || vs2Widening, sews[:len(sews)-1], sews) sews = iff(sew64Only, []SEW{64}, sews) combinations := i.combinations( diff --git a/generator/tests.go b/generator/tests.go index efec604..56f75a0 100644 --- a/generator/tests.go +++ b/generator/tests.go @@ -5,6 +5,8 @@ import ( "strconv" "strings" "unsafe" + + f16 "github.com/x448/float16" ) type num interface { @@ -20,6 +22,42 @@ func convNum[T num](n any) T { return res } +func parseCustomFloat16(n string) uint16 { + switch n { + case "nan": + return 0x7e01 + case "-nan": + return 0xfe01 + case "inf": + return 0x7c00 + case "-inf": + return 0xfc00 + case "quiet_nan": + return 0x7e00 + case "signaling_nan": + return 0x7d00 + case "smallest_nonzero_float": + return 0x0001 + case "largest_subnormal_float": + return 0x03ff + case "smallest_normal_float": + return 0x0400 + case "max_float": + return 0x7bff + case "-smallest_nonzero_float": + return 0x8001 + case "-largest_subnormal_float": + return 0x83ff + case "-smallest_normal_float": + return 0x8400 + case "-max_float": + return 0xfbff + default: + v, _ := strconv.ParseFloat(n, 32) + return f16.Fromfloat32(float32(v)).Bits() + } +} + func parseCustomFloat32(n string) float32 { var val uint32 = 0x800000 var smallestNormalFloat32 = *(*float32)(unsafe.Pointer(&val)) @@ -120,6 +158,9 @@ type tests struct { SEW64_ []testCase[string] `toml:"sew64"` SEW64 []testCase[uint64] `toml:"-"` + FSEW16_ []testCase[string] `toml:"fsew16"` + FSEW16 []testCase[uint16] `toml:"-"` + FSEW32_ []testCase[string] `toml:"fsew32"` FSEW32 []testCase[float32] `toml:"-"` @@ -140,6 +181,16 @@ func (t *tests) initialize() error { } } + for i, ss := range t.FSEW16_ { + t.FSEW16 = append(t.FSEW16, make([]uint16, len(ss))) + for j, s := range ss { + t.FSEW16[i][j] = parseCustomFloat16(s) + if err != nil { + return err + } + } + } + for i, ss := range t.FSEW32_ { t.FSEW32 = append(t.FSEW32, make([]float32, len(ss))) for j, s := range ss { diff --git a/go.mod b/go.mod index eab1e99..431ba9b 100644 --- a/go.mod +++ b/go.mod @@ -3,3 +3,4 @@ module github.com/ksco/riscv-vector-tests go 1.19 require github.com/pelletier/go-toml/v2 v2.0.6 +require github.com/x448/float16 v0.8.4 \ No newline at end of file diff --git a/go.sum b/go.sum index 092fabf..c6b133b 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/main.go b/main.go index 1bb7e6d..d9aeacf 100644 --- a/main.go +++ b/main.go @@ -28,6 +28,7 @@ var vlenF = flag.Int("VLEN", 256, "") var xlenF = flag.Int("XLEN", 64, "we do not support specifying ELEN yet, ELEN is consistent with XLEN.") var splitF = flag.Int("split", 10000, "split per lines.") var integerF = flag.Bool("integer", false, "only generate integer tests.") +var float16F = flag.Bool("float16", true, "generate float16 tests") var patternF = flag.String("pattern", ".*", "regex to filter out tests.") var stage1OutputDirF = flag.String("stage1output", "", "stage1 output directory.") var configsDirF = flag.String("configs", "configs/", "config files directory.") @@ -94,11 +95,14 @@ func main() { VLEN: generator.VLEN(*vlenF), XLEN: generator.XLEN(*xlenF), Repeat: *repeatF, + Float16: *float16F, } if (!strings.HasPrefix(file.Name(), "vf") && !strings.HasPrefix(file.Name(), "vmf")) || strings.HasPrefix(file.Name(), "vfirst") { option.Repeat = 1 } + insn, err := generator.ReadInsnFromToml(contents, option) + fatalIf(err) if insn.Name != strings.Replace(file.Name(), ".toml", "", -1) { diff --git a/single/single.go b/single/single.go index 65ff270..31584f4 100644 --- a/single/single.go +++ b/single/single.go @@ -23,6 +23,7 @@ func fatalIf(err error) { var vlenF = flag.Int("VLEN", 256, "") var xlenF = flag.Int("XLEN", 64, "") +var float16F = flag.Bool("float16", true, "") var outputFileF = flag.String("outputfile", "", "output file name.") var configFileF = flag.String("configfile", "", "config file path.") var testfloat3LevelF = flag.Int("testfloat3level", 2, "testfloat3 testing level (1 or 2).") @@ -52,6 +53,7 @@ func main() { VLEN: generator.VLEN(*vlenF), XLEN: generator.XLEN(*xlenF), Repeat: *repeatF, + Float16: *float16F, } fp := *configFileF diff --git a/testfloat3/genCases.h b/testfloat3/genCases.h index d199fcc..3a8dc57 100644 --- a/testfloat3/genCases.h +++ b/testfloat3/genCases.h @@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +typedef uint16_t float16_t; typedef float float32_t; typedef double float64_t; @@ -47,6 +48,14 @@ void genCases_setLevel(int); extern uint_fast64_t genCases_total; extern bool genCases_done; +void genCases_f16_a_init(void); +void genCases_f16_a_next(void); +void genCases_f16_ab_init(void); +void genCases_f16_ab_next(void); +void genCases_f16_abc_init(void); +void genCases_f16_abc_next(void); +extern float16_t genCases_f16_a, genCases_f16_b, genCases_f16_c; + void genCases_f32_a_init(void); void genCases_f32_a_next(void); void genCases_f32_ab_init(void); diff --git a/testfloat3/genCases_f16.c b/testfloat3/genCases_f16.c new file mode 100644 index 0000000..aae2374 --- /dev/null +++ b/testfloat3/genCases_f16.c @@ -0,0 +1,583 @@ + +/*============================================================================ + +This C source file is part of TestFloat, Release 3e, a package of programs for +testing the correctness of floating-point arithmetic complying with the IEEE +Standard for Floating-Point, by John R. Hauser. + +Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of +California. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions, and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of the University nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=============================================================================*/ + +#include +#include +#include +#include "random.h" +#include "genCases.h" + +struct sequence { + int expNum, term1Num, term2Num; + bool done; +}; + +union ui16_f16 { uint16_t ui; float16_t f; }; + +enum { + f16NumQIn = 22, + f16NumQOut = 34, + f16NumP1 = 4, + f16NumP2 = 36 +}; +static const uint16_t f16QIn[f16NumQIn] = { + 0x0000, /* positive, subnormal */ + 0x0400, /* positive, -14 */ + 0x1000, /* positive, -11 */ + 0x3400, /* positive, -2 */ + 0x3800, /* positive, -1 */ + 0x3C00, /* positive, 0 */ + 0x4000, /* positive, 1 */ + 0x4400, /* positive, 2 */ + 0x6800, /* positive, 11 */ + 0x7800, /* positive, 15 */ + 0x7C00, /* positive, infinity or NaN */ + 0x8000, /* negative, subnormal */ + 0x8400, /* negative, -14 */ + 0x9000, /* negative, -11 */ + 0xB400, /* negative, -2 */ + 0xB800, /* negative, -1 */ + 0xBC00, /* negative, 0 */ + 0xC000, /* negative, 1 */ + 0xC400, /* negative, 2 */ + 0xE800, /* negative, 11 */ + 0xF800, /* negative, 15 */ + 0xFC00 /* negative, infinity or NaN */ +}; +static const uint16_t f16QOut[f16NumQOut] = { + 0x0000, /* positive, subnormal */ + 0x0400, /* positive, -14 */ + 0x0800, /* positive, -13 */ + 0x1000, /* positive, -11 */ + 0x2C00, /* positive, -4 */ + 0x3000, /* positive, -3 */ + 0x3400, /* positive, -2 */ + 0x3800, /* positive, -1 */ + 0x3C00, /* positive, 0 */ + 0x4000, /* positive, 1 */ + 0x4400, /* positive, 2 */ + 0x4800, /* positive, 3 */ + 0x4C00, /* positive, 4 */ + 0x6800, /* positive, 11 */ + 0x7400, /* positive, 14 */ + 0x7800, /* positive, 15 */ + 0x7C00, /* positive, infinity or NaN */ + 0x8000, /* negative, subnormal */ + 0x8400, /* negative, -14 */ + 0x8800, /* negative, -13 */ + 0x9000, /* negative, -11 */ + 0xAC00, /* negative, -4 */ + 0xB000, /* negative, -3 */ + 0xB400, /* negative, -2 */ + 0xB800, /* negative, -1 */ + 0xBC00, /* negative, 0 */ + 0xC000, /* negative, 1 */ + 0xC400, /* negative, 2 */ + 0xC800, /* negative, 3 */ + 0xCC00, /* negative, 4 */ + 0xE800, /* negative, 11 */ + 0xF400, /* negative, 14 */ + 0xF800, /* negative, 15 */ + 0xFC00 /* negative, infinity or NaN */ +}; +static const uint16_t f16P1[f16NumP1] = { + 0x0000, + 0x0001, + 0x03FF, + 0x03FE +}; +static const uint16_t f16P2[f16NumP2] = { + 0x0000, + 0x0001, + 0x0002, + 0x0004, + 0x0008, + 0x0010, + 0x0020, + 0x0040, + 0x0080, + 0x0100, + 0x0200, + 0x0300, + 0x0380, + 0x03C0, + 0x03E0, + 0x03F0, + 0x03F8, + 0x03FC, + 0x03FE, + 0x03FF, + 0x03FD, + 0x03FB, + 0x03F7, + 0x03EF, + 0x03DF, + 0x03BF, + 0x037F, + 0x02FF, + 0x01FF, + 0x00FF, + 0x007F, + 0x003F, + 0x001F, + 0x000F, + 0x0007, + 0x0003 +}; + +static const uint_fast64_t f16NumQInP1 = f16NumQIn * f16NumP1; +static const uint_fast64_t f16NumQOutP1 = f16NumQOut * f16NumP1; + +static float16_t f16NextQInP1( struct sequence *sequencePtr ) +{ + int expNum, sigNum; + union ui16_f16 uZ; + + expNum = sequencePtr->expNum; + sigNum = sequencePtr->term1Num; + uZ.ui = f16QIn[expNum] | f16P1[sigNum]; + ++sigNum; + if ( f16NumP1 <= sigNum ) { + sigNum = 0; + ++expNum; + if ( f16NumQIn <= expNum ) { + expNum = 0; + sequencePtr->done = true; + } + sequencePtr->expNum = expNum; + } + sequencePtr->term1Num = sigNum; + return uZ.f; + +} + +static float16_t f16NextQOutP1( struct sequence *sequencePtr ) +{ + int expNum, sigNum; + union ui16_f16 uZ; + + expNum = sequencePtr->expNum; + sigNum = sequencePtr->term1Num; + uZ.ui = f16QOut[expNum] | f16P1[sigNum]; + ++sigNum; + if ( f16NumP1 <= sigNum ) { + sigNum = 0; + ++expNum; + if ( f16NumQOut <= expNum ) { + expNum = 0; + sequencePtr->done = true; + } + sequencePtr->expNum = expNum; + } + sequencePtr->term1Num = sigNum; + return uZ.f; + +} + +static const uint_fast64_t f16NumQInP2 = f16NumQIn * f16NumP2; +static const uint_fast64_t f16NumQOutP2 = f16NumQOut * f16NumP2; + +static float16_t f16NextQInP2( struct sequence *sequencePtr ) +{ + int expNum, sigNum; + union ui16_f16 uZ; + + expNum = sequencePtr->expNum; + sigNum = sequencePtr->term1Num; + uZ.ui = f16QIn[expNum] | f16P2[sigNum]; + ++sigNum; + if ( f16NumP2 <= sigNum ) { + sigNum = 0; + ++expNum; + if ( f16NumQIn <= expNum ) { + expNum = 0; + sequencePtr->done = true; + } + sequencePtr->expNum = expNum; + } + sequencePtr->term1Num = sigNum; + return uZ.f; + +} + +static float16_t f16NextQOutP2( struct sequence *sequencePtr ) +{ + int expNum, sigNum; + union ui16_f16 uZ; + + expNum = sequencePtr->expNum; + sigNum = sequencePtr->term1Num; + uZ.ui = f16QOut[expNum] | f16P2[sigNum]; + ++sigNum; + if ( f16NumP2 <= sigNum ) { + sigNum = 0; + ++expNum; + if ( f16NumQOut <= expNum ) { + expNum = 0; + sequencePtr->done = true; + } + sequencePtr->expNum = expNum; + } + sequencePtr->term1Num = sigNum; + return uZ.f; + +} + +static float16_t f16RandomQOutP3( void ) +{ + union ui16_f16 uZ; + + uZ.ui = + f16QOut[randomN_ui8( f16NumQOut )] + | ((f16P2[randomN_ui8( f16NumP2 )] + f16P2[randomN_ui8( f16NumP2 )]) + & 0x03FF); + return uZ.f; + +} + +static float16_t f16RandomQOutPInf( void ) +{ + union ui16_f16 uZ; + + uZ.ui = f16QOut[randomN_ui8( f16NumQOut )] | (random_ui16() & 0x03FF); + return uZ.f; + +} + +enum { f16NumQInfWeightMasks = 4 }; +static const uint16_t f16QInfWeightMasks[f16NumQInfWeightMasks] = + { 0xFC00, 0xFC00, 0xBC00, 0x9C00 }; +static const uint16_t f16QInfWeightOffsets[f16NumQInfWeightMasks] = + { 0x0000, 0x0000, 0x2000, 0x3000 }; + +static float16_t f16RandomQInfP3( void ) +{ + int weightMaskNum; + union ui16_f16 uZ; + + weightMaskNum = randomN_ui8( f16NumQInfWeightMasks ); + uZ.ui = + ((random_ui16() & f16QInfWeightMasks[weightMaskNum]) + + f16QInfWeightOffsets[weightMaskNum]) + | ((f16P2[randomN_ui8( f16NumP2 )] + f16P2[randomN_ui8( f16NumP2 )]) + & 0x03FF); + return uZ.f; + +} + +static float16_t f16RandomQInfPInf( void ) +{ + int weightMaskNum; + union ui16_f16 uZ; + + weightMaskNum = randomN_ui8( f16NumQInfWeightMasks ); + uZ.ui = + (random_ui16() & (f16QInfWeightMasks[weightMaskNum] | 0x03FF)) + + f16QInfWeightOffsets[weightMaskNum]; + return uZ.f; + +} + +static float16_t f16Random( void ) +{ + + switch ( random_ui8() & 7 ) { + case 0: + case 1: + case 2: + return f16RandomQOutP3(); + case 3: + return f16RandomQOutPInf(); + case 4: + case 5: + case 6: + return f16RandomQInfP3(); + case 7: + return f16RandomQInfPInf(); + default: + abort(); + } + +} + +static struct sequence sequenceA, sequenceB, sequenceC; +static float16_t currentA, currentB, currentC; +static int subcase; + +float16_t genCases_f16_a, genCases_f16_b, genCases_f16_c; + +void genCases_f16_a_init( void ) +{ + + sequenceA.expNum = 0; + sequenceA.term1Num = 0; + sequenceA.term2Num = 0; + sequenceA.done = false; + subcase = 0; + genCases_total = + (genCases_level == 1) ? 3 * f16NumQOutP1 : 2 * f16NumQOutP2; + genCases_done = false; + +} + +void genCases_f16_a_next( void ) +{ + + if ( genCases_level == 1 ) { + switch ( subcase ) { + case 0: + case 1: + genCases_f16_a = f16Random(); + break; + case 2: + genCases_f16_a = f16NextQOutP1( &sequenceA ); + genCases_done = sequenceA.done; + subcase = -1; + break; + } + } else { + switch ( subcase ) { + case 0: + genCases_f16_a = f16Random(); + break; + case 1: + genCases_f16_a = f16NextQOutP2( &sequenceA ); + genCases_done = sequenceA.done; + subcase = -1; + break; + } + } + ++subcase; + +} + +void genCases_f16_ab_init( void ) +{ + + sequenceA.expNum = 0; + sequenceA.term1Num = 0; + sequenceA.term2Num = 0; + sequenceA.done = false; + sequenceB.expNum = 0; + sequenceB.term1Num = 0; + sequenceB.term2Num = 0; + sequenceB.done = false; + subcase = 0; + if ( genCases_level == 1 ) { + genCases_total = 6 * f16NumQInP1 * f16NumQInP1; + currentA = f16NextQInP1( &sequenceA ); + } else { + genCases_total = 2 * f16NumQInP2 * f16NumQInP2; + currentA = f16NextQInP2( &sequenceA ); + } + genCases_done = false; + +} + +void genCases_f16_ab_next( void ) +{ + + if ( genCases_level == 1 ) { + switch ( subcase ) { + case 0: + if ( sequenceB.done ) { + sequenceB.done = false; + currentA = f16NextQInP1( &sequenceA ); + } + currentB = f16NextQInP1( &sequenceB ); + case 2: + case 4: + genCases_f16_a = f16Random(); + genCases_f16_b = f16Random(); + break; + case 1: + genCases_f16_a = currentA; + genCases_f16_b = f16Random(); + break; + case 3: + genCases_f16_a = f16Random(); + genCases_f16_b = currentB; + break; + case 5: + genCases_f16_a = currentA; + genCases_f16_b = currentB; + genCases_done = sequenceA.done & sequenceB.done; + subcase = -1; + break; + } + } else { + switch ( subcase ) { + case 0: + genCases_f16_a = f16Random(); + genCases_f16_b = f16Random(); + break; + case 1: + if ( sequenceB.done ) { + sequenceB.done = false; + currentA = f16NextQInP2( &sequenceA ); + } + genCases_f16_a = currentA; + genCases_f16_b = f16NextQInP2( &sequenceB ); + genCases_done = sequenceA.done & sequenceB.done; + subcase = -1; + break; + } + } + ++subcase; + +} + +void genCases_f16_abc_init( void ) +{ + + sequenceA.expNum = 0; + sequenceA.term1Num = 0; + sequenceA.term2Num = 0; + sequenceA.done = false; + sequenceB.expNum = 0; + sequenceB.term1Num = 0; + sequenceB.term2Num = 0; + sequenceB.done = false; + sequenceC.expNum = 0; + sequenceC.term1Num = 0; + sequenceC.term2Num = 0; + sequenceC.done = false; + subcase = 0; + if ( genCases_level == 1 ) { + genCases_total = 9 * f16NumQInP1 * f16NumQInP1 * f16NumQInP1; + currentA = f16NextQInP1( &sequenceA ); + currentB = f16NextQInP1( &sequenceB ); + } else { + genCases_total = 2 * f16NumQInP2 * f16NumQInP2 * f16NumQInP2; + currentA = f16NextQInP2( &sequenceA ); + currentB = f16NextQInP2( &sequenceB ); + } + genCases_done = false; + +} + +void genCases_f16_abc_next( void ) +{ + + if ( genCases_level == 1 ) { + switch ( subcase ) { + case 0: + if ( sequenceC.done ) { + sequenceC.done = false; + if ( sequenceB.done ) { + sequenceB.done = false; + currentA = f16NextQInP1( &sequenceA ); + } + currentB = f16NextQInP1( &sequenceB ); + } + currentC = f16NextQInP1( &sequenceC ); + genCases_f16_a = f16Random(); + genCases_f16_b = f16Random(); + genCases_f16_c = currentC; + break; + case 1: + genCases_f16_a = currentA; + genCases_f16_b = currentB; + genCases_f16_c = f16Random(); + break; + case 2: + genCases_f16_a = f16Random(); + genCases_f16_b = f16Random(); + genCases_f16_c = f16Random(); + break; + case 3: + genCases_f16_a = f16Random(); + genCases_f16_b = currentB; + genCases_f16_c = currentC; + break; + case 4: + genCases_f16_a = currentA; + genCases_f16_b = f16Random(); + genCases_f16_c = f16Random(); + break; + case 5: + genCases_f16_a = f16Random(); + genCases_f16_b = currentB; + genCases_f16_c = f16Random(); + break; + case 6: + genCases_f16_a = currentA; + genCases_f16_b = f16Random(); + genCases_f16_c = currentC; + break; + case 7: + genCases_f16_a = f16Random(); + genCases_f16_b = f16Random(); + genCases_f16_c = f16Random(); + break; + case 8: + genCases_f16_a = currentA; + genCases_f16_b = currentB; + genCases_f16_c = currentC; + genCases_done = sequenceA.done & sequenceB.done & sequenceC.done; + subcase = -1; + break; + } + } else { + switch ( subcase ) { + case 0: + genCases_f16_a = f16Random(); + genCases_f16_b = f16Random(); + genCases_f16_c = f16Random(); + break; + case 1: + if ( sequenceC.done ) { + sequenceC.done = false; + if ( sequenceB.done ) { + sequenceB.done = false; + currentA = f16NextQInP2( &sequenceA ); + } + currentB = f16NextQInP2( &sequenceB ); + } + genCases_f16_a = currentA; + genCases_f16_b = currentB; + genCases_f16_c = f16NextQInP2( &sequenceC ); + genCases_done = sequenceA.done & sequenceB.done & sequenceC.done; + subcase = -1; + break; + } + } + ++subcase; + +} + + diff --git a/testfloat3/testfloat3.c b/testfloat3/testfloat3.c index 0758f28..82f5a57 100644 --- a/testfloat3/testfloat3.c +++ b/testfloat3/testfloat3.c @@ -1,5 +1,26 @@ #include "testfloat3.h" +void init_a_f16(void) { genCases_f16_a_init(); } +void gen_a_f16(float16_t *a) { + genCases_f16_a_next(); + *a = genCases_f16_a; +} + +void init_ab_f16(void) { genCases_f16_ab_init(); } +void gen_ab_f16(float16_t *a, float16_t *b) { + genCases_f16_ab_next(); + *a = genCases_f16_a; + *b = genCases_f16_b; +} + +void init_abc_f16(void) { genCases_f16_abc_init(); } +void gen_abc_f16(float16_t *a, float16_t *b, float16_t *c) { + genCases_f16_abc_next(); + *a = genCases_f16_a; + *b = genCases_f16_b; + *c = genCases_f16_c; +} + void init_a_f32(void) { genCases_f32_a_init(); } void gen_a_f32(float32_t *a) { genCases_f32_a_next(); diff --git a/testfloat3/testfloat3.go b/testfloat3/testfloat3.go index 535dd76..019d3e9 100644 --- a/testfloat3/testfloat3.go +++ b/testfloat3/testfloat3.go @@ -10,6 +10,35 @@ func SetLevel(level int) { C.genCases_setLevel(C.int(level)); } +func InitF16(numops int) { + C.srand(2024); + switch numops { + case 1: + C.init_a_f16() + case 2: + C.init_ab_f16() + case 3: + C.init_abc_f16() + } +} + +func GenF16(numops int) []uint16 { + var a, b, c uint16 = 0, 0, 0 + switch numops { + case 1: + C.gen_a_f16((*C.uint16_t)(&a)) + return []uint16{a} + case 2: + C.gen_ab_f16((*C.uint16_t)(&a), (*C.uint16_t)(&b)) + return []uint16{a, b} + case 3: + C.gen_abc_f16((*C.uint16_t)(&a), (*C.uint16_t)(&b), (*C.uint16_t)(&c)) + return []uint16{a, b, c} + } + + return []uint16{} +} + func InitF32(numops int) { C.srand(2024); switch numops { diff --git a/testfloat3/testfloat3.h b/testfloat3/testfloat3.h index 5cddc20..98e0316 100644 --- a/testfloat3/testfloat3.h +++ b/testfloat3/testfloat3.h @@ -2,6 +2,15 @@ #include "genCases.h" +void init_a_f16(void); +void gen_a_f16(float16_t *); + +void init_ab_f16(void); +void gen_ab_f16(float16_t *, float16_t *); + +void init_abc_f16(void); +void gen_abc_f16(float16_t *, float16_t *, float16_t *); + void init_a_f32(void); void gen_a_f32(float32_t *);