Skip to content

Commit

Permalink
Merge pull request #2 from cmuellner/mulah-fix
Browse files Browse the repository at this point in the history
Small corrections and simplifications for xtheadmac and xtheadmemidx
  • Loading branch information
Cooper-Qu authored Sep 5, 2022
2 parents 26280ad + 6b3ebe1 commit c5cf5d7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion xtheadmac/mula.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Operation::
[source,sail]
--
M := reg[rs1] * reg[rs2]
reg[rd] := zext.d(reg[rd] + M)
reg[rd] := reg[rd] + M
--

Permission::
Expand Down
4 changes: 2 additions & 2 deletions xtheadmac/mulah.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ This instruction computes the multiply-add result of the provided half-word oper
Operation::
[source,sail]
--
M := zext.h(reg[rs1]) * zext.h(reg[rs2])
reg[rd] := sext.w(zext.w(reg[rd] + M))
M := sext.w(reg[rs1][15:0]) * sext.w(reg[rs2][15:0])
reg[rd] := sext.w(reg[rd] + M)
--

Permission::
Expand Down
4 changes: 2 additions & 2 deletions xtheadmac/mulaw.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ This instruction computes the multiply-add result of the provided word operands.
Operation::
[source,sail]
--
M := zext.w(reg[rs1]) * zext.w(reg[rs2])
reg[rd] := sext.w(zext.w(reg[rd] + M))
M := sext.w(reg[rs1]) * sext.w(reg[rs2])
reg[rd] := sext.w(reg[rd] + M)
--

Permission::
Expand Down
2 changes: 1 addition & 1 deletion xtheadmac/muls.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Operation::
[source,sail]
--
M := reg[rs1] * reg[rs2]
reg[rd] := zext.d(reg[rd] - M)
reg[rd] := reg[rd] - M
--

Permission::
Expand Down
4 changes: 2 additions & 2 deletions xtheadmac/mulsh.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ This instruction computes the multiply-subtract result of the provided half-word
Operation::
[source,sail]
--
M := zext.h(reg[rs1]) * zext.h(reg[rs2])
reg[rd] := sext.w(zext.w(reg[rd] - M))
M := sext.h(reg[rs1][15:0]) * sext.h(reg[rs2][15:0])
reg[rd] := sext.w(reg[rd] - M)
--

Permission::
Expand Down
4 changes: 2 additions & 2 deletions xtheadmac/mulsw.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ This instruction computes the multiply-subtract result of the provided word oper
Operation::
[source,sail]
--
M := zext.w(reg[rs1]) * zext.w(reg[rs2])
reg[rd] := sext.w(zext.w(reg[rd] - M))
M := sext.w(reg[rs1]) * sext.w(reg[rs2])
reg[rd] := sext.w(reg[rd] - M)
--

Permission::
Expand Down
2 changes: 1 addition & 1 deletion xtheadmemidx/lurwu.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Encoding::
....

Description::
This instruction loads a zero extended 16-bit value into GP register _rd_ from the address _rs1_ + (zero_extend(_rs2_) << _imm2_).
This instruction loads a zero extended 32-bit value into GP register _rd_ from the address _rs1_ + (zero_extend(_rs2_) << _imm2_).

Note, that this instruction is equivalent to a `zext.w _rs2_, _rs2_` followed by a `th.lrwu` with the same arguments.

Expand Down

0 comments on commit c5cf5d7

Please sign in to comment.