Skip to content

Commit 6f69218

Browse files
authored
Applying style guidelines and spelling to M (riscv#1835)
* Update M extension with style guidelines This PR contains changes for the style guidelines that were discussed in the doc-sig. Style guidelines say that extension names an registers should be in back tics. This also fixes the old spelling of "implementors". Signed-off-by: Kersten Richter <[email protected]> * Update m-st-ext.adoc Signed-off-by: Kersten Richter <[email protected]> * Update src/m-st-ext.adoc Signed-off-by: Kersten Richter <[email protected]> * Update src/m-st-ext.adoc Signed-off-by: Kersten Richter <[email protected]> * Update src/m-st-ext.adoc Signed-off-by: Kersten Richter <[email protected]> * Update src/m-st-ext.adoc Signed-off-by: Kersten Richter <[email protected]> --------- Signed-off-by: Kersten Richter <[email protected]>
1 parent 4e3a60b commit 6f69218

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/m-st-ext.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[[mstandard]]
2-
== "M" Extension for Integer Multiplication and Division, Version 2.0
2+
== `M` Extension for Integer Multiplication and Division, Version 2.0
33

44
This chapter describes the standard integer multiplication and division
5-
instruction extension, which is named "M" and contains instructions
5+
instruction extension, which is named `M` and contains instructions
66
that multiply or divide values held in two integer registers.
77

88
[NOTE]
@@ -23,12 +23,12 @@ include::images/wavedrom/m-st-ext-for-int-mult.edn[]
2323
(((MUL, MULHSU)))
2424

2525
MUL performs an XLEN-bit×XLEN-bit multiplication of
26-
_rs1_ by _rs2_ and places the lower XLEN bits in the destination
26+
`rs1` by `rs2` and places the lower XLEN bits in the destination
2727
register. MULH, MULHU, and MULHSU perform the same multiplication but
2828
return the upper XLEN bits of the full 2×XLEN-bit
2929
product, for signed×signed,
30-
unsigned×unsigned, and _rs1_×unsigned _rs2_ multiplication, respectively.
31-
If both the high and low bits of the same product are required, then the recommended code sequence is: MULH[[S]U] _rdh, rs1, rs2_; MUL _rdl, rs1, rs2_ (source register specifiers must be in same order and _rdh_ cannot be the same as _rs1_ or _rs2_). Microarchitectures can then fuse these into a single multiply operation instead of performing two separate multiplies.
30+
unsigned×unsigned, and `rs1`×unsigned `rs2` multiplication.
31+
If both the high and low bits of the same product are required, then the recommended code sequence is: `MULH[[S]U] rdh, rs1, rs2; MUL rdl, rs1, rs2` (source register specifiers must be in same order and `rdh` cannot be the same as `rs1` or `rs2`). Microarchitectures can then fuse these into a single multiply operation instead of performing two separate multiplies.
3232

3333
[NOTE]
3434
====
@@ -59,7 +59,7 @@ include::images/wavedrom/division-op.edn[]
5959
(((MUL, DIVU)))
6060

6161
DIV and DIVU perform an XLEN bits by XLEN bits signed and unsigned
62-
integer division of _rs1_ by _rs2_, rounding towards zero. REM and REMU
62+
integer division of `rs1` by `rs2`, rounding towards zero. REM and REMU
6363
provide the remainder of the corresponding division operation. For REM,
6464
the sign of a nonzero result equals the sign of the dividend.
6565

@@ -71,17 +71,17 @@ latexmath:[$\textrm{dividend} = \textrm{divisor} \times \textrm{quotient} + \tex
7171
====
7272

7373
If both the quotient and remainder are required from the same division,
74-
the recommended code sequence is: DIV[U] _rdq, rs1, rs2_; REM[U] _rdr,
75-
rs1, rs2_ (_rdq_ cannot be the same as _rs1_ or _rs2_).
74+
the recommended code sequence is: `DIV[U] rdq, rs1, rs2; REM[U] rdr,`
75+
`rs1, rs2` (`rdq` cannot be the same as `rs1` or `rs2`).
7676
Microarchitectures can then fuse these into a single divide operation
7777
instead of performing two separate divides.
7878

7979
DIVW and DIVUW are RV64 instructions that divide the lower 32 bits of
80-
_rs1_ by the lower 32 bits of _rs2_, treating them as signed and
81-
unsigned integers respectively, placing the 32-bit quotient in _rd_,
80+
`rs1` by the lower 32 bits of `rs2`, treating them as signed and
81+
unsigned integers, placing the 32-bit quotient in `rd`,
8282
sign-extended to 64 bits. REMW and REMUW are RV64 instructions that
83-
provide the corresponding signed and unsigned remainder operations
84-
respectively. Both REMW and REMUW always sign-extend the 32-bit result
83+
provide the corresponding signed and unsigned remainder operations. Both
84+
REMW and REMUW always sign-extend the 32-bit result
8585
to 64 bits, including on a divide by zero.
8686
(((MUL, div by zero)))
8787

@@ -136,18 +136,18 @@ unsigned division circuit and specifying the same overflow result
136136
simplifies the hardware.
137137
====
138138

139-
=== Zmmul Extension, Version 1.0
139+
=== `Zmmul` Extension, Version 1.0
140140

141-
The Zmmul extension implements the multiplication subset of the M
141+
The `Zmmul` extension implements the multiplication subset of the M
142142
extension. It adds all of the instructions defined in
143143
<<Multiplication Operations>>, namely: MUL, MULH, MULHU,
144144
MULHSU, and (for RV64 only) MULW. The encodings are identical to those
145-
of the corresponding M-extension instructions. M implies Zmmul.
145+
of the corresponding M-extension instructions. `M` implies `Zmmul`.
146146
(((MUL, Zmmul)))
147147

148148
[NOTE]
149149
====
150-
The *Zmmul* extension enables low-cost implementations that require
150+
The `Zmmul` extension enables low-cost implementations that require
151151
multiplication operations but not division. For many microcontroller
152152
applications, division operations are too infrequent to justify the cost
153153
of divider hardware. By contrast, multiplication operations are more

0 commit comments

Comments
 (0)