diff --git a/generator/insn.go b/generator/insn.go index c2ef8c8..e08686b 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 } @@ -294,8 +295,8 @@ func (i *Insn) genHeader() string { #include "riscv_test.h" #include "test_macros.h" -RVTEST_RV%dUV -`, i.Name, i.Option.XLEN) +RVTEST_RV%dUV%s +`, i.Name, i.Option.XLEN, iff(i.Option.Fp, "", "x")) } func (i *Insn) genMergedCodeCombinations(splitPerLines int) ([]string, []string) { diff --git a/main.go b/main.go index d9aeacf..f4b7dc3 100644 --- a/main.go +++ b/main.go @@ -99,6 +99,8 @@ func main() { } if (!strings.HasPrefix(file.Name(), "vf") && !strings.HasPrefix(file.Name(), "vmf")) || strings.HasPrefix(file.Name(), "vfirst") { option.Repeat = 1 + } else { + option.Fp = true } insn, err := generator.ReadInsnFromToml(contents, option) @@ -135,4 +137,4 @@ func writeTo(path string, name string, contents string) { fatalIf(err) err = os.WriteFile(filepath.Join(path, name), []byte(contents), 0644) fatalIf(err) -} \ No newline at end of file +} diff --git a/single/single.go b/single/single.go index 31584f4..a28c03d 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 = true } + insn, err := generator.ReadInsnFromToml(contents, option) fatalIf(err)