Skip to content

Commit

Permalink
[GSOC] modified vdvs2vs1vm generator for sew64 reserved insn
Browse files Browse the repository at this point in the history
refactored generator for sew64Only insn

Co-authored-by: Yang Liu <[email protected]>
  • Loading branch information
SyedHassanUlHaq and ksco committed Aug 8, 2024
1 parent 5609d7c commit 9b115bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generator/insn_vdvs2rs1vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func (i *Insn) genCodeVdVs2Rs1Vm(pos int) []string {
vdWidening := strings.HasPrefix(i.Name, "vw")
vs2Widening := strings.HasSuffix(i.Name, ".wx")
sew64_insn := i.Name == "vclmul.vx" || i.Name == "vclmulh.vx"
sew64Only := strings.HasSuffix(i.Name, "vclmul")
vdSize := iff(vdWidening, 2, 1)
vs2Size := iff(vs2Widening, 2, 1)

Expand Down
4 changes: 3 additions & 1 deletion generator/insn_vdvs2vs1vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ import (

func (i *Insn) genCodeVdVs2Vs1Vm(pos int) []string {
float := strings.HasPrefix(i.Name, "vf") || strings.HasPrefix(i.Name, "vmf")
sew64_insn := i.Name == "vclmul.vv" || i.Name == "vclmulh.vv"
vdWidening := strings.HasPrefix(i.Name, "vw") || strings.HasPrefix(i.Name, "vfw")
vs2Widening := strings.HasSuffix(i.Name, ".wv")
vdSize := iff(vdWidening, 2, 1)
vs2Size := iff(vs2Widening, 2, 1)

sews := iff(float, floatSEWs, allSEWs)
sews = iff(vdWidening || vs2Widening, sews[:len(sews)-1], sews)
sews = iff(sew64_insn, []SEW{64}, sews)
combinations := i.combinations(
iff(vdWidening || vs2Widening, wideningMULs, allLMULs),
iff(vdWidening || vs2Widening, wideningMULs, iff(sew64_insn, []LMUL{1, 2, 4, 8}, allLMULs)),
sews,
[]bool{false, true},
i.vxrms(),
Expand Down

0 comments on commit 9b115bb

Please sign in to comment.