Skip to content

Commit

Permalink
Fix a large imm issue for vlen 4096
Browse files Browse the repository at this point in the history
  • Loading branch information
ksco committed Jan 24, 2024
1 parent e19651b commit 01c2ca1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions generator/insn_rdvs2vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ func (i *Insn) genCodeRdVs2Vm(pos int) []string {
builder.WriteString(i.gWriteRandomData(LMUL(3)))
builder.WriteString(i.gLoadDataIntoRegisterGroup(0, c.LMUL1, SEW(8)))

builder.WriteString(fmt.Sprintf("addi a0, a0, %d\n", 1*i.vlenb()))
builder.WriteString(fmt.Sprintf("li t1, %d\n", 1*i.vlenb()))
builder.WriteString(fmt.Sprintf("add a0, a0, t1\n"))
builder.WriteString(i.gLoadDataIntoRegisterGroup(vd, c.LMUL1, SEW(8)))

builder.WriteString(fmt.Sprintf("addi a0, a0, %d\n", 1*i.vlenb()))
builder.WriteString(fmt.Sprintf("li t1, %d\n", 1*i.vlenb()))
builder.WriteString(fmt.Sprintf("add a0, a0, t1\n"))
builder.WriteString(i.gLoadDataIntoRegisterGroup(vs2, c.LMUL1, SEW(8)))

builder.WriteString("# -------------- TEST BEGIN --------------\n")
Expand Down
3 changes: 2 additions & 1 deletion generator/insn_vdvs2.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func (i *Insn) genCodeVdVs2(pos int) []string {
builder.WriteString(i.gWriteRandomData(c.LMUL * 2))

builder.WriteString(i.gLoadDataIntoRegisterGroup(vd, c.LMUL, c.SEW))
builder.WriteString(fmt.Sprintf("addi a0, a0, %d\n", int(c.LMUL)*i.vlenb()))
builder.WriteString(fmt.Sprintf("li t1, %d\n", int(c.LMUL)*i.vlenb()))
builder.WriteString(fmt.Sprintf("add a0, a0, t1\n"))
builder.WriteString(i.gLoadDataIntoRegisterGroup(vs2, c.LMUL, c.SEW))

builder.WriteString("# -------------- TEST BEGIN --------------\n")
Expand Down
3 changes: 2 additions & 1 deletion generator/insn_vdvs2vmp2.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func (i *Insn) genCodeVdVs2VmP2(pos int) []string {
vs2 := 2 * int(c.LMUL1)
builder.WriteString(i.gWriteRandomData(LMUL(1) * 2))
builder.WriteString(i.gLoadDataIntoRegisterGroup(0, c.LMUL1, c.SEW))
builder.WriteString(fmt.Sprintf("addi a0, a0, %d\n", 1*i.vlenb()))
builder.WriteString(fmt.Sprintf("li t1, %d\n", 1*i.vlenb()))
builder.WriteString(fmt.Sprintf("add a0, a0, t1\n"))
builder.WriteString(i.gLoadDataIntoRegisterGroup(vs2, c.LMUL1, c.SEW))

builder.WriteString(i.gWriteRandomData(c.LMUL1))
Expand Down

0 comments on commit 01c2ca1

Please sign in to comment.