Skip to content

Commit

Permalink
Fix non fp v (#58)
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
Co-authored-by: Jiuyang Liu <[email protected]>
  • Loading branch information
Avimitin and sequencer authored Dec 25, 2024
1 parent 1e8ba15 commit 52ccb79
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ out/
vendor/

# macOS
.DS_Store
.DS_Store

# ccls
.ccls-cache/
15 changes: 15 additions & 0 deletions env/ps/riscv_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
RVTEST_VECTOR_ENABLE; \
.endm

#define RVTEST_RV64UVX \
.macro init; \
RVTEST_ZVE32X_ENABLE; \
.endm

#define RVTEST_RV32U \
.macro init; \
.endm
Expand All @@ -38,6 +43,11 @@
RVTEST_VECTOR_ENABLE; \
.endm

#define RVTEST_RV32UVX \
.macro init; \
RVTEST_ZVE32X_ENABLE; \
.endm

#define RVTEST_RV64M \
.macro init; \
RVTEST_ENABLE_MACHINE; \
Expand Down Expand Up @@ -112,6 +122,11 @@
csrwi fcsr, 0; \
csrwi vcsr, 0;

#define RVTEST_ZVE32X_ENABLE \
li a0, (MSTATUS_VS & (MSTATUS_VS >> 1)); \
csrs mstatus, a0; \
csrwi vcsr, 0;

#define RISCV_MULTICORE_DISABLE \
csrr a0, mhartid; \
1: bnez a0, 1b
Expand Down
2 changes: 1 addition & 1 deletion env/riscv-test-env
5 changes: 3 additions & 2 deletions generator/insn.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type insnFormat string
type Option struct {
VLEN VLEN
XLEN XLEN
Fp bool
Repeat int
Float16 bool
}
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions single/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 52ccb79

Please sign in to comment.