diff --git a/Makefrag b/Makefrag index fea556b..01ad89d 100644 --- a/Makefrag +++ b/Makefrag @@ -462,16 +462,24 @@ tests = \ vloxseg2ei32_v-0 \ vloxseg2ei32_v-1 \ vloxseg2ei64_v-0 \ + vloxseg2ei64_v-1 \ vloxseg2ei8_v-0 \ vloxseg2ei8_v-1 \ vloxseg3ei16_v-0 \ + vloxseg3ei16_v-1 \ vloxseg3ei32_v-0 \ + vloxseg3ei32_v-1 \ vloxseg3ei64_v-0 \ vloxseg3ei8_v-0 \ + vloxseg3ei8_v-1 \ vloxseg4ei16_v-0 \ + vloxseg4ei16_v-1 \ vloxseg4ei32_v-0 \ + vloxseg4ei32_v-1 \ vloxseg4ei64_v-0 \ + vloxseg4ei64_v-1 \ vloxseg4ei8_v-0 \ + vloxseg4ei8_v-1 \ vloxseg5ei16_v-0 \ vloxseg5ei32_v-0 \ vloxseg5ei64_v-0 \ @@ -553,17 +561,25 @@ tests = \ vlseg8e8_v-0 \ vlseg8e8ff_v-0 \ vlsseg2e16_v-0 \ + vlsseg2e16_v-1 \ vlsseg2e32_v-0 \ + vlsseg2e32_v-1 \ vlsseg2e64_v-0 \ + vlsseg2e64_v-1 \ vlsseg2e8_v-0 \ + vlsseg2e8_v-1 \ vlsseg3e16_v-0 \ vlsseg3e32_v-0 \ vlsseg3e64_v-0 \ vlsseg3e8_v-0 \ vlsseg4e16_v-0 \ + vlsseg4e16_v-1 \ vlsseg4e32_v-0 \ + vlsseg4e32_v-1 \ vlsseg4e64_v-0 \ + vlsseg4e64_v-1 \ vlsseg4e8_v-0 \ + vlsseg4e8_v-1 \ vlsseg5e16_v-0 \ vlsseg5e32_v-0 \ vlsseg5e64_v-0 \ @@ -592,16 +608,24 @@ tests = \ vluxseg2ei32_v-0 \ vluxseg2ei32_v-1 \ vluxseg2ei64_v-0 \ + vluxseg2ei64_v-1 \ vluxseg2ei8_v-0 \ vluxseg2ei8_v-1 \ vluxseg3ei16_v-0 \ + vluxseg3ei16_v-1 \ vluxseg3ei32_v-0 \ + vluxseg3ei32_v-1 \ vluxseg3ei64_v-0 \ vluxseg3ei8_v-0 \ + vluxseg3ei8_v-1 \ vluxseg4ei16_v-0 \ + vluxseg4ei16_v-1 \ vluxseg4ei32_v-0 \ + vluxseg4ei32_v-1 \ vluxseg4ei64_v-0 \ + vluxseg4ei64_v-1 \ vluxseg4ei8_v-0 \ + vluxseg4ei8_v-1 \ vluxseg5ei16_v-0 \ vluxseg5ei32_v-0 \ vluxseg5ei64_v-0 \ @@ -1173,6 +1197,7 @@ tests = \ vsoxseg2ei16_v-0 \ vsoxseg2ei16_v-1 \ vsoxseg2ei32_v-0 \ + vsoxseg2ei32_v-1 \ vsoxseg2ei64_v-0 \ vsoxseg2ei8_v-0 \ vsoxseg2ei8_v-1 \ @@ -1181,9 +1206,12 @@ tests = \ vsoxseg3ei64_v-0 \ vsoxseg3ei8_v-0 \ vsoxseg4ei16_v-0 \ + vsoxseg4ei16_v-1 \ vsoxseg4ei32_v-0 \ + vsoxseg4ei32_v-1 \ vsoxseg4ei64_v-0 \ vsoxseg4ei8_v-0 \ + vsoxseg4ei8_v-1 \ vsoxseg5ei16_v-0 \ vsoxseg5ei32_v-0 \ vsoxseg5ei64_v-0 \ @@ -1224,12 +1252,16 @@ tests = \ vsrl_vx-5 \ vsse16_v-0 \ vsse16_v-1 \ + vsse16_v-2 \ vsse32_v-0 \ vsse32_v-1 \ + vsse32_v-2 \ vsse64_v-0 \ vsse64_v-1 \ + vsse64_v-2 \ vsse8_v-0 \ vsse8_v-1 \ + vsse8_v-2 \ vsseg2e16_v-0 \ vsseg2e32_v-0 \ vsseg2e64_v-0 \ @@ -1365,13 +1397,21 @@ tests = \ vssseg2e8_v-0 \ vssseg2e8_v-1 \ vssseg3e16_v-0 \ + vssseg3e16_v-1 \ vssseg3e32_v-0 \ + vssseg3e32_v-1 \ vssseg3e64_v-0 \ + vssseg3e64_v-1 \ vssseg3e8_v-0 \ + vssseg3e8_v-1 \ vssseg4e16_v-0 \ + vssseg4e16_v-1 \ vssseg4e32_v-0 \ + vssseg4e32_v-1 \ vssseg4e64_v-0 \ + vssseg4e64_v-1 \ vssseg4e8_v-0 \ + vssseg4e8_v-1 \ vssseg5e16_v-0 \ vssseg5e32_v-0 \ vssseg5e64_v-0 \ @@ -1428,6 +1468,7 @@ tests = \ vsuxseg2ei16_v-0 \ vsuxseg2ei16_v-1 \ vsuxseg2ei32_v-0 \ + vsuxseg2ei32_v-1 \ vsuxseg2ei64_v-0 \ vsuxseg2ei8_v-0 \ vsuxseg2ei8_v-1 \ @@ -1436,9 +1477,12 @@ tests = \ vsuxseg3ei64_v-0 \ vsuxseg3ei8_v-0 \ vsuxseg4ei16_v-0 \ + vsuxseg4ei16_v-1 \ vsuxseg4ei32_v-0 \ + vsuxseg4ei32_v-1 \ vsuxseg4ei64_v-0 \ vsuxseg4ei8_v-0 \ + vsuxseg4ei8_v-1 \ vsuxseg5ei16_v-0 \ vsuxseg5ei32_v-0 \ vsuxseg5ei64_v-0 \ diff --git a/generator/insn_util.go b/generator/insn_util.go index e662c26..74d0899 100644 --- a/generator/insn_util.go +++ b/generator/insn_util.go @@ -117,7 +117,7 @@ func getEEW(name string) SEW { return SEW(eew) } -func getNfieldsRoundedUp(name string) int { +func getNfields(name string) int { s := regexp.MustCompile(`v.+?seg(\d)e.+?\.v`) subs := s.FindStringSubmatch(name) if len(subs) < 2 { @@ -127,19 +127,7 @@ func getNfieldsRoundedUp(name string) int { if err != nil { return 1 } - switch nfields { - case 1: - return 1 - case 2: - return 2 - case 3, 4: - return 4 - case 5, 6, 7, 8: - return 8 - default: - log.Fatalln("unreachable") - return 1 - } + return nfields } func iff[T any](condition bool, t T, f T) T { diff --git a/generator/insn_vdrs1mrs2vm.go b/generator/insn_vdrs1mrs2vm.go index 35de7dc..5864fb7 100644 --- a/generator/insn_vdrs1mrs2vm.go +++ b/generator/insn_vdrs1mrs2vm.go @@ -2,12 +2,11 @@ package generator import ( "fmt" - "math" "strings" ) func (i *Insn) genCodeVdRs1mRs2Vm(pos int) []string { - nfields := getNfieldsRoundedUp(i.Name) + nfields := getNfields(i.Name) combinations := i.combinations( nfieldsLMULs(nfields), []SEW{getEEW(i.Name)}, @@ -23,11 +22,12 @@ func (i *Insn) genCodeVdRs1mRs2Vm(pos int) []string { builder.WriteString(i.gWriteRandomData(LMUL(1))) builder.WriteString(i.gLoadDataIntoRegisterGroup(0, LMUL(1), SEW(32))) - lmul1 := LMUL(math.Max(float64(c.LMUL1)*float64(nfields), 1)) - vd, _, _ := getVRegs(lmul1, false, i.Name) - builder.WriteString(i.gWriteRandomData(lmul1)) - builder.WriteString(i.gLoadDataIntoRegisterGroup(vd, lmul1, c.SEW)) - builder.WriteString(i.gWriteIntegerTestData(lmul1, c.SEW, 0)) + vd := int(c.LMUL1) + builder.WriteString(i.gWriteRandomData(c.LMUL1)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gLoadDataIntoRegisterGroup(vd+(nf*int(c.LMUL1)), c.LMUL1, c.SEW)) + } + builder.WriteString(i.gWriteIntegerTestData(c.LMUL1*LMUL(nfields), c.SEW, 0)) builder.WriteString("# -------------- TEST BEGIN --------------\n") builder.WriteString(i.gVsetvli(c.Vl, c.SEW, c.LMUL)) @@ -35,15 +35,16 @@ func (i *Insn) genCodeVdRs1mRs2Vm(pos int) []string { builder.WriteString("# -------------- TEST END --------------\n") builder.WriteString(i.gResultDataAddr()) - builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd, lmul1, c.SEW)) - builder.WriteString(i.gMagicInsn(vd, lmul1)) + builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd, c.LMUL1, c.SEW)) + builder.WriteString(i.gMagicInsn(vd, c.LMUL1)) for _, stride := range []int{minStride, 0, 1, maxStride} { stride = stride * int(c.SEW) / 8 - builder.WriteString(i.gWriteRandomData(lmul1)) - builder.WriteString(i.gLoadDataIntoRegisterGroup(vd, lmul1, c.SEW)) - builder.WriteString(i.gWriteIntegerTestData(lmul1*strides, c.SEW, 0)) - + builder.WriteString(i.gWriteRandomData(c.LMUL1)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gLoadDataIntoRegisterGroup(vd+(nf*int(c.LMUL1)), c.LMUL1, c.SEW)) + } + builder.WriteString(i.gWriteIntegerTestData(c.LMUL1*LMUL(nfields*stride), c.SEW, 0)) builder.WriteString(fmt.Sprintf("li a5, %d\n", -minStride*i.vlenb()*int(c.LMUL1))) builder.WriteString("add a0, a0, a5\n") @@ -54,8 +55,10 @@ func (i *Insn) genCodeVdRs1mRs2Vm(pos int) []string { builder.WriteString("# -------------- TEST END --------------\n") builder.WriteString(i.gResultDataAddr()) - builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd, lmul1, c.SEW)) - builder.WriteString(i.gMagicInsn(vd, lmul1)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd+(nf*int(c.LMUL1)), c.LMUL1, c.SEW)) + builder.WriteString(i.gMagicInsn(vd+(nf*int(c.LMUL1)), c.LMUL1)) + } } res = append(res, builder.String()) } diff --git a/generator/insn_vdrs1mvm.go b/generator/insn_vdrs1mvm.go index 446023b..09ba259 100644 --- a/generator/insn_vdrs1mvm.go +++ b/generator/insn_vdrs1mvm.go @@ -2,12 +2,11 @@ package generator import ( "fmt" - "math" "strings" ) func (i *Insn) genCodeVdRs1mVm(pos int) []string { - nfields := getNfieldsRoundedUp(i.Name) + nfields := getNfields(i.Name) combinations := i.combinations( nfieldsLMULs(nfields), []SEW{getEEW(i.Name)}, @@ -23,11 +22,12 @@ func (i *Insn) genCodeVdRs1mVm(pos int) []string { builder.WriteString(i.gWriteRandomData(LMUL(1))) builder.WriteString(i.gLoadDataIntoRegisterGroup(0, LMUL(1), SEW(32))) - lmul1 := LMUL(math.Max(float64(c.LMUL1)*float64(nfields), 1)) - vd, _, _ := getVRegs(lmul1, false, i.Name) - builder.WriteString(i.gWriteRandomData(lmul1)) - builder.WriteString(i.gLoadDataIntoRegisterGroup(vd, lmul1, c.SEW)) - builder.WriteString(i.gWriteIntegerTestData(lmul1, c.SEW, 0)) + vd := int(c.LMUL1) + builder.WriteString(i.gWriteRandomData(c.LMUL1)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gLoadDataIntoRegisterGroup(vd+(nf*int(c.LMUL1)), c.LMUL1, c.SEW)) + } + builder.WriteString(i.gWriteIntegerTestData(c.LMUL1*LMUL(nfields), c.SEW, 0)) builder.WriteString("# -------------- TEST BEGIN --------------\n") builder.WriteString(i.gVsetvli(c.Vl, c.SEW, c.LMUL)) @@ -35,8 +35,10 @@ func (i *Insn) genCodeVdRs1mVm(pos int) []string { builder.WriteString("# -------------- TEST END --------------\n") builder.WriteString(i.gResultDataAddr()) - builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd, lmul1, c.SEW)) - builder.WriteString(i.gMagicInsn(vd, lmul1)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd+(nf*int(c.LMUL1)), c.LMUL1, c.SEW)) + builder.WriteString(i.gMagicInsn(vd+(nf*int(c.LMUL1)), c.LMUL1)) + } res = append(res, builder.String()) } diff --git a/generator/insn_vdrs1mvs2vm.go b/generator/insn_vdrs1mvs2vm.go index 9fad7f5..881b0a1 100644 --- a/generator/insn_vdrs1mvs2vm.go +++ b/generator/insn_vdrs1mvs2vm.go @@ -7,7 +7,7 @@ import ( ) func (i *Insn) genCodeVdRs1mVs2Vm(pos int) []string { - nfields := getNfieldsRoundedUp(i.Name) + nfields := getNfields(i.Name) combinations := i.combinations( nfieldsLMULs(nfields), []SEW{getEEW(i.Name)}, @@ -27,21 +27,29 @@ func (i *Insn) genCodeVdRs1mVs2Vm(pos int) []string { if emul > 8 || emul < 1./8 { continue } - emul = math.Max(emul, 1) + emul = math.Max(emul, 1) // offset lmul builder.WriteString(c.initialize()) builder.WriteString(i.gWriteRandomData(LMUL(1))) builder.WriteString(i.gLoadDataIntoRegisterGroup(0, LMUL(1), SEW(32))) - lmul1 := LMUL(math.Max(float64(c.LMUL)*float64(nfields), 1)) - vd := int(lmul1) - vs2 := 2 * int(math.Max(emul, float64(int(c.LMUL1)*nfields))) + vd := int(c.LMUL1) - builder.WriteString(i.gWriteIndexData(lmul1, LMUL(emul), c.Vl, sew, c.SEW)) + vs2 := 0 + for k := vd+int(c.LMUL1)*nfields; true; k += 1 { + if k % int(emul) == 0 { + vs2 = k + break + } + } + + builder.WriteString(i.gWriteIndexData(c.LMUL1, LMUL(emul), c.Vl, sew, c.SEW)) builder.WriteString(i.gLoadDataIntoRegisterGroup(vs2, LMUL(emul), c.SEW)) - builder.WriteString(i.gWriteRandomData(lmul1)) - builder.WriteString(i.gLoadDataIntoRegisterGroup(vd, lmul1, sew)) - builder.WriteString(i.gWriteIntegerTestData(lmul1, sew, 0)) + builder.WriteString(i.gWriteRandomData(c.LMUL1)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gLoadDataIntoRegisterGroup(vd+(nf*int(c.LMUL1)), c.LMUL1, sew)) + } + builder.WriteString(i.gWriteIntegerTestData(c.LMUL1*LMUL(nfields), sew, 0)) builder.WriteString("# -------------- TEST BEGIN --------------\n") builder.WriteString(i.gVsetvli(c.Vl, sew, c.LMUL)) @@ -49,8 +57,10 @@ func (i *Insn) genCodeVdRs1mVs2Vm(pos int) []string { builder.WriteString("# -------------- TEST END --------------\n") builder.WriteString(i.gResultDataAddr()) - builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd, lmul1, sew)) - builder.WriteString(i.gMagicInsn(vd, lmul1)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gStoreRegisterGroupIntoResultData(vd+(nf*int(c.LMUL1)), c.LMUL1, sew)) + builder.WriteString(i.gMagicInsn(vd+(nf*int(c.LMUL1)), c.LMUL1)) + } } res = append(res, builder.String()) } diff --git a/generator/insn_vs3rs1mrs2vm.go b/generator/insn_vs3rs1mrs2vm.go index d075f43..4b46bf4 100644 --- a/generator/insn_vs3rs1mrs2vm.go +++ b/generator/insn_vs3rs1mrs2vm.go @@ -2,12 +2,11 @@ package generator import ( "fmt" - "math" "strings" ) func (i *Insn) genCodeVs3Rs1mRs2Vm(pos int) []string { - nfields := getNfieldsRoundedUp(i.Name) + nfields := getNfields(i.Name) combinations := i.combinations( nfieldsLMULs(nfields), []SEW{getEEW(i.Name)}, @@ -23,12 +22,16 @@ func (i *Insn) genCodeVs3Rs1mRs2Vm(pos int) []string { builder.WriteString(i.gWriteRandomData(LMUL(1))) builder.WriteString(i.gLoadDataIntoRegisterGroup(0, LMUL(1), SEW(32))) - lmul1 := LMUL(math.Max(float64(c.LMUL1)*float64(nfields), 1)) - vs3, _, _ := getVRegs(lmul1, false, i.Name) + vs3 := int(c.LMUL1) for _, s := range []int{minStride, 0, 1, maxStride} { stride := s * int(c.SEW) / 8 - builder.WriteString(i.gWriteIntegerTestData(lmul1, c.SEW, 0)) - builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, lmul1, c.SEW)) + + builder.WriteString(i.gWriteIntegerTestData(c.LMUL1*LMUL(nfields), c.SEW, 0)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3+(nf*int(c.LMUL1)), c.LMUL1, c.SEW)) + builder.WriteString(fmt.Sprintf("li a5, %d\n", stride*i.vlenb()*int(c.LMUL1))) + builder.WriteString("add a0, a0, a5\n") + } builder.WriteString(i.gResultDataAddr()) builder.WriteString(fmt.Sprintf("li a5, %d\n", -minStride*i.vlenb()*int(c.LMUL1))) @@ -45,8 +48,8 @@ func (i *Insn) genCodeVs3Rs1mRs2Vm(pos int) []string { builder.WriteString("mv a4, a0\n") for a := 0; a < strides; a++ { - builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, lmul1, c.SEW)) - builder.WriteString(i.gMagicInsn(vs3, lmul1)) + builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, c.LMUL1, c.SEW)) + builder.WriteString(i.gMagicInsn(vs3, c.LMUL1)) builder.WriteString(fmt.Sprintf("li a5, %d\n", i.vlenb()*int(c.LMUL1))) builder.WriteString(fmt.Sprintf("add a4, a4, a5\n")) builder.WriteString("mv a0, a4\n") diff --git a/generator/insn_vs3rs1mvm.go b/generator/insn_vs3rs1mvm.go index 4b9afa6..bd2cd4c 100644 --- a/generator/insn_vs3rs1mvm.go +++ b/generator/insn_vs3rs1mvm.go @@ -2,12 +2,11 @@ package generator import ( "fmt" - "math" "strings" ) func (i *Insn) genCodeVs3Rs1mVm(pos int) []string { - nfields := getNfieldsRoundedUp(i.Name) + nfields := getNfields(i.Name) combinations := i.combinations( nfieldsLMULs(nfields), []SEW{getEEW(i.Name)}, @@ -23,10 +22,14 @@ func (i *Insn) genCodeVs3Rs1mVm(pos int) []string { builder.WriteString(i.gWriteRandomData(LMUL(1))) builder.WriteString(i.gLoadDataIntoRegisterGroup(0, LMUL(1), SEW(32))) - lmul1 := LMUL(math.Max(float64(c.LMUL1)*float64(nfields), 1)) - vs3, _, _ := getVRegs(lmul1, false, i.Name) - builder.WriteString(i.gWriteIntegerTestData(lmul1, c.SEW, 0)) - builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, lmul1, c.SEW)) + vs3 := int(c.LMUL1) + + builder.WriteString(i.gWriteIntegerTestData(c.LMUL1*LMUL(nfields), c.SEW, 0)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3+(nf*int(c.LMUL1)), c.LMUL1, c.SEW)) + builder.WriteString(fmt.Sprintf("li a5, %d\n", i.vlenb()*int(c.LMUL1))) + builder.WriteString("add a0, a0, a5\n") + } builder.WriteString(i.gResultDataAddr()) @@ -35,8 +38,8 @@ func (i *Insn) genCodeVs3Rs1mVm(pos int) []string { builder.WriteString(fmt.Sprintf("%s v%d, (a0)%s\n", i.Name, vs3, v0t(c.Mask))) builder.WriteString("# -------------- TEST END --------------\n") - builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, lmul1, c.SEW)) - builder.WriteString(i.gMagicInsn(vs3, lmul1)) + builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, c.LMUL1, c.SEW)) + builder.WriteString(i.gMagicInsn(vs3, c.LMUL1)) res = append(res, builder.String()) } diff --git a/generator/insn_vs3rs1mvs2vm.go b/generator/insn_vs3rs1mvs2vm.go index c23c8f6..9a9ac41 100644 --- a/generator/insn_vs3rs1mvs2vm.go +++ b/generator/insn_vs3rs1mvs2vm.go @@ -7,7 +7,7 @@ import ( ) func (i *Insn) genCodeVs3Rs1mVs2Vm(pos int) []string { - nfields := getNfieldsRoundedUp(i.Name) + nfields := getNfields(i.Name) combinations := i.combinations( nfieldsLMULs(nfields), []SEW{getEEW(i.Name)}, @@ -28,18 +28,30 @@ func (i *Insn) genCodeVs3Rs1mVs2Vm(pos int) []string { if emul > 8 || emul < 1./8 { continue } - emul = math.Max(emul, 1) + emul = math.Max(emul, 1) // offset lmul builder.WriteString(c.initialize()) builder.WriteString(i.gWriteRandomData(LMUL(1))) builder.WriteString(i.gLoadDataIntoRegisterGroup(0, LMUL(1), SEW(32))) - lmul1 := LMUL(math.Max(float64(c.LMUL1)*float64(nfields), 1)) - vs3 := int(lmul1) - vs1 := 2 * int(math.Max(emul, float64(int(c.LMUL1)*nfields))) - builder.WriteString(i.gWriteIntegerTestData(lmul1, sew, 0)) - builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, lmul1, sew)) - builder.WriteString(i.gWriteIndexData(lmul1, LMUL(emul), c.Vl, sew, c.SEW)) + vs3 := int(c.LMUL1) + + vs1 := 0 + for k := vs3+int(c.LMUL1)*nfields; true; k += 1 { + if k % int(emul) == 0 { + vs1 = k + break + } + } + + builder.WriteString(i.gWriteIntegerTestData(c.LMUL1*LMUL(nfields), sew, 0)) + for nf := 0; nf < nfields; nf++ { + builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3+(nf*int(c.LMUL1)), c.LMUL1, sew)) + builder.WriteString(fmt.Sprintf("li a5, %d\n", i.vlenb()*int(c.LMUL1))) + builder.WriteString("add a0, a0, a5\n") + } + + builder.WriteString(i.gWriteIndexData(c.LMUL1, LMUL(emul), c.Vl, sew, c.SEW)) builder.WriteString(i.gLoadDataIntoRegisterGroup(vs1, LMUL(emul), c.SEW)) builder.WriteString(i.gResultDataAddr()) @@ -48,8 +60,8 @@ func (i *Insn) genCodeVs3Rs1mVs2Vm(pos int) []string { builder.WriteString(fmt.Sprintf("%s v%d, (a0), v%d%s\n", i.Name, vs3, vs1, v0t(c.Mask))) builder.WriteString("# -------------- TEST END --------------\n") - builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, lmul1, sew)) - builder.WriteString(i.gMagicInsn(vs3, lmul1)) + builder.WriteString(i.gLoadDataIntoRegisterGroup(vs3, c.LMUL1, sew)) + builder.WriteString(i.gMagicInsn(vs3, c.LMUL1)) } res = append(res, builder.String()) }