Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non fp v #58

Merged
merged 3 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 3 additions & 1 deletion 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 Expand Up @@ -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)
}
}
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
Loading