From 391168d4445fc0d3033bbc4e09f2b7f960092f74 Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Fri, 18 Oct 2024 17:35:19 +0800 Subject: [PATCH] Add fp field for filter out FP tests Signed-off-by: Avimitin --- generator/insn.go | 16 +++++++++++++++- single/single.go | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/generator/insn.go b/generator/insn.go index c2ef8c8..efbeee6 100644 --- a/generator/insn.go +++ b/generator/insn.go @@ -18,6 +18,7 @@ type insnFormat string type Option struct { VLEN VLEN XLEN XLEN + Fp bool Repeat int Float16 bool } @@ -56,6 +57,7 @@ func (t *TestData) String() string { type Insn struct { Name string `toml:"name"` Format insnFormat `toml:"format"` + Fp bool `toml:"fp"` NoTestfloat3 bool `toml:"notestfloat3"` Vxrm bool `toml:"vxrm"` Vxsat bool `toml:"vxsat"` @@ -287,7 +289,8 @@ func (i *Insn) Generate(splitPerLines int) []string { } func (i *Insn) genHeader() string { - return fmt.Sprintf(`# + if i.Option.Fp { + return fmt.Sprintf(`# # This file is automatically generated. Do not edit. # Instruction: %s @@ -296,6 +299,17 @@ func (i *Insn) genHeader() string { RVTEST_RV%dUV `, i.Name, i.Option.XLEN) + } else { + return fmt.Sprintf(`# +# This file is automatically generated. Do not edit. +# Instruction: %s + +#include "riscv_test.h" +#include "test_macros.h" + +RVTEST_RV%dUVX +`, i.Name, i.Option.XLEN) + } } func (i *Insn) genMergedCodeCombinations(splitPerLines int) ([]string, []string) { diff --git a/single/single.go b/single/single.go index 31584f4..ff19a1d 100644 --- a/single/single.go +++ b/single/single.go @@ -62,7 +62,10 @@ func main() { if (!strings.HasPrefix(filepath.Base(fp), "vf") && !strings.HasPrefix(filepath.Base(fp), "vmf")) || strings.HasPrefix(filepath.Base(fp), "vfirst") { option.Repeat = 1 + } else { + option.Fp = 1 } + insn, err := generator.ReadInsnFromToml(contents, option) fatalIf(err)