From 22f5c5ecc7434678b680c9bcc119736c31e55faf Mon Sep 17 00:00:00 2001 From: SyedHassanUlHaq <21b-029-cs@students.uit.edu> Date: Wed, 21 Aug 2024 03:33:05 +0500 Subject: [PATCH] [GSOC] removed unnecessary allowedLMUL func for zvkg --- Makefrag | 1 - generator/insn_util.go | 15 --------------- generator/insn_vdvs2.go | 6 ++---- generator/insn_vdvs2vs1.go | 7 +++---- 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/Makefrag b/Makefrag index 925c1fd..62347e9 100644 --- a/Makefrag +++ b/Makefrag @@ -416,7 +416,6 @@ tests = \ vfwsub_wf-1 \ vfwsub_wv-0 \ vghsh_vv-0 \ - vgmul_vv-0 \ vid_v-0 \ vid_v-1 \ viota_m-0 \ diff --git a/generator/insn_util.go b/generator/insn_util.go index 3821523..4d2e426 100644 --- a/generator/insn_util.go +++ b/generator/insn_util.go @@ -81,21 +81,6 @@ func (l LMUL) String() string { return fmt.Sprintf("m%d", int(l)) } -func ZvkgAllowedLMULs(vlen VLEN) []LMUL { - switch vlen { - case 64: - return []LMUL{2, 4, 8} - case 128: - return []LMUL{1, 2, 4, 8} - case 256: - return []LMUL{LMUL(1) / 2, 1, 2, 4, 8} - case 512: - return []LMUL{LMUL(1) / 4, LMUL(1) / 2, 1, 2, 4, 8} - default: - return allLMULs - } -} - type VLEN int func (v VLEN) Valid() bool { diff --git a/generator/insn_vdvs2.go b/generator/insn_vdvs2.go index b110383..b3da463 100644 --- a/generator/insn_vdvs2.go +++ b/generator/insn_vdvs2.go @@ -10,7 +10,7 @@ import ( func (i *Insn) genCodeVdVs2(pos int) []string { zvkg_insn := strings.HasPrefix(i.Name, "vg") - sew32_only := iff(zvkg_insn, []SEW{32}, allSEWs) + sews := iff(zvkg_insn, []SEW{32}, allSEWs) var nr int var err error @@ -22,9 +22,7 @@ func (i *Insn) genCodeVdVs2(pos int) []string { } } - vlen := i.Option.VLEN - - combinations := i.combinations(iff(zvkg_insn, ZvkgAllowedLMULs(vlen), []LMUL{LMUL(nr)}), iff(zvkg_insn, sew32_only, allSEWs), []bool{false}, i.vxrms()) + combinations := i.combinations([]LMUL{LMUL(nr)}, sews, []bool{false}, i.vxrms()) res := make([]string, 0, len(combinations)) for _, c := range combinations[pos:] { diff --git a/generator/insn_vdvs2vs1.go b/generator/insn_vdvs2vs1.go index 6f9c7ca..0ba8be6 100644 --- a/generator/insn_vdvs2vs1.go +++ b/generator/insn_vdvs2vs1.go @@ -7,11 +7,10 @@ import ( func (i *Insn) genCodeVdVs2Vs1(pos int) []string { zvkg_insn := strings.HasPrefix(i.Name, "vg") - sew32_only := iff(zvkg_insn, []SEW{32}, allSEWs) - vlen := i.Option.VLEN + sews := iff(zvkg_insn, []SEW{32}, allSEWs) combinations := i.combinations( - iff(zvkg_insn, ZvkgAllowedLMULs(vlen), allLMULs), - iff(zvkg_insn, sew32_only, allSEWs), + allLMULs, + sews, []bool{false}, i.vxrms(), )