Skip to content

Commit e00b732

Browse files
Replaced all latexmath calls with built-in AsciiDoc substitutes. Done to make normative rule extraction provide better results (i.e., rules without images, just normal characters). (#2411)
Signed-off-by: James Ball <[email protected]> Co-authored-by: James Ball <[email protected]>
1 parent 4e54026 commit e00b732

18 files changed

+366
-374
lines changed

src/bfloat16.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ as well as in the `frm` CSR
219219
[cols = "1,1,1"]
220220
|===
221221
|Rounding Mode | Mnemonic | Meaning
222-
|000 | RNE | Round to Nearest, ties to Even
223-
|001 | RTZ | Round towards Zero
224-
|010 | RDN | Round Down (towards −)
225-
|011 | RUP | Round Up (towards +)
222+
| 000 | RNE | Round to Nearest, ties to Even
223+
| 001 | RTZ | Round towards Zero
224+
| 010 | RDN | Round Down (towards −{inf})
225+
| 011 | RUP | Round Up (towards +{inf})
226226
|100 | RMM | Round to Nearest, ties to Max Magnitude
227227
|===
228228

src/colophon.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ instructions, which had suggested the incorrect sign of a zero result.
361361
* Instructions `FMV.S.X` and `FMV.X.S` were renamed to `FMV.W.X` and `FMV.X.W`
362362
respectively to be more consistent with their semantics, which did not
363363
change. The old names will continue to be supported in the tools.
364-
* Specified behavior of narrower (latexmath:[$<$]FLEN) floating-point
364+
* Specified behavior of narrower (<FLEN) floating-point
365365
values held in wider `f` registers using NaN-boxing model.
366-
* Defined the exception behavior of FMA(latexmath:[$\infty$], 0, qNaN).
366+
* Defined the exception behavior of FMA({inf}, 0, qNaN).
367367
* Added note indicating that the `P` extension might be reworked into an
368368
integer packed-SIMD proposal for fixed-point operations using the
369369
integer registers.
@@ -385,7 +385,7 @@ software conventions.
385385

386386
* Numerous additions and improvements to the commentary sections.
387387
* Separate version numbers for each chapter.
388-
* Modification to long instruction encodings latexmath:[$>$]64 bits to
388+
* Modification to long instruction encodings >64 bits to
389389
avoid moving the _rd_ specifier in very long instruction formats.
390390
* CSR instructions are now described in the base integer format where
391391
the counter registers are introduced, as opposed to only being
@@ -456,7 +456,7 @@ added.
456456
64-bits wide, with separate read access to the upper and lower 32 bits.
457457
* Canonical `NOP` and `MV` encodings have been defined.
458458
* Standard instruction-length encodings have been defined for 48-bit,
459-
64-bit, and latexmath:[$>$]64-bit instructions.
459+
64-bit, and >64-bit instructions.
460460
* Description of a 128-bit address space variant, `RV128`, has been added.
461461
* Major opcodes in the 32-bit base instruction format have been
462462
allocated for user-defined custom extensions.

src/f-st-ext.adoc

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ particular, with regard to decoding legal vs. reserved encodings).
127127
|Rounding Mode |Mnemonic |Meaning
128128
|000 |RNE |Round to Nearest, ties to Even
129129
|001 |RTZ |Round towards Zero
130-
|010 |RDN |Round Down (towards latexmath:[$-\infty$])
131-
|011 |RUP |Round Up (towards latexmath:[$+\infty$])
130+
|010 |RDN |Round Down (towards −{inf})
131+
|011 |RUP |Round Up (towards +{inf})
132132
|100 |RMM |Round to Nearest, ties to Max Magnitude
133133
|101 | |_Reserved for future use._
134134
|110 | |_Reserved for future use._
@@ -270,8 +270,8 @@ rounding mode using the _rm_ field with the encoding shown in
270270
<<rm>>.
271271

272272
Floating-point minimum-number and maximum-number instructions FMIN.S and FMAX.S write, respectively, the smaller or larger of _rs1_ and _rs2_ to _rd_. For the purposes of these instructions only, the value
273-
latexmath:[$-0.0$] is considered to be less than the value
274-
latexmath:[$+0.0$]. If both inputs are NaNs, the result is the canonical NaN. If only one operand is a NaN, the result is the non-NaN operand.
273+
0.0 is considered to be less than the value
274+
+0.0. If both inputs are NaNs, the result is the canonical NaN. If only one operand is a NaN, the result is the non-NaN operand.
275275
Signaling NaN inputs set the invalid operation exception flag, even when the result is not NaN.
276276

277277
[NOTE]
@@ -293,14 +293,14 @@ instruction format. R4-type instructions specify three source registers (_rs1_,
293293

294294
FMADD.S multiplies the values in _rs1_ and _rs2_, adds the value in
295295
_rs3_, and writes the final result to _rd_. FMADD.S computes
296-
_(rs1latexmath:[$\times$]rs2)latexmath:[$\+$]rs3_.
296+
_(rs1×rs2)+rs3_.
297297

298298
FMSUB.S multiplies the values in _rs1_ and _rs2_, subtracts the value in _rs3_, and writes the final result to _rd_. FMSUB.S computes
299-
_(rs1latexmath:[$\times$]rs2)latexmath:[$\-$]rs3_.
299+
_(rs1×rs2)rs3_.
300300

301-
FNMSUB.S multiplies the values in _rs1_ and _rs2_, negates the product, adds the value in _rs3_, and writes the final result to _rd_. FNMSUB.S computes _-(rs1latexmath:[$\times$]rs2)latexmath:[$\+$]rs3_.
301+
FNMSUB.S multiplies the values in _rs1_ and _rs2_, negates the product, adds the value in _rs3_, and writes the final result to _rd_. FNMSUB.S computes _−(rs1×rs2)+rs3_.
302302

303-
FNMADD.S multiplies the values in _rs1_ and _rs2_, negates the product, subtracts the value in _rs3_, and writes the final result to _rd_. FNMADD.S computes _-(rs1latexmath:[$\times$]rs2)latexmath:[$\-$]rs3_.
303+
FNMADD.S multiplies the values in _rs1_ and _rs2_, negates the product, subtracts the value in _rs3_, and writes the final result to _rd_. FNMADD.S computes _−(rs1×rs2)rs3_.
304304

305305
[NOTE]
306306
====
@@ -331,12 +331,12 @@ would require additional move instructions in some common sequences. The current
331331
====
332332

333333
The fused multiply-add instructions must set the invalid operation
334-
exception flag when the multiplicands are latexmath:[$\infty$] and zero, even when the addend is a quiet NaN.
334+
exception flag when the multiplicands are {inf} and zero, even when the addend is a quiet NaN.
335335

336336
[NOTE]
337337
====
338338
The IEEE 754-2008 standard permits, but does not require, raising the
339-
invalid exception for the operation latexmath:[$\infty\times 0\ +$]qNaN.
339+
invalid exception for the operation {inf}×0 + qNaN.
340340
====
341341

342342
=== Single-Precision Floating-Point Conversion and Move Instructions
@@ -349,7 +349,7 @@ register _rd_. FCVT.S.W or FCVT.S.L converts a 32-bit or 64-bit signed
349349
integer, respectively, in integer register _rs1_ into a floating-point
350350
number in floating-point register _rd_. FCVT.WU.S, FCVT.LU.S, FCVT.S.WU,
351351
and FCVT.S.LU variants convert to or from unsigned integer values. For
352-
XLENlatexmath:[$>32$], FCVT.W[U].S sign-extends the 32-bit result to the
352+
XLEN>32, FCVT.W[U].S sign-extends the 32-bit result to the
353353
destination register width. FCVT.L[U].S and FCVT.S.L[U] are RV64-only
354354
instructions. If the rounded result is not representable in the
355355
destination format, it is clipped to the nearest value and the invalid
@@ -367,23 +367,23 @@ FCVT.S.W _rd_, `x0`, which will never set any exception flags.
367367
[%autowidth,float="center",align="center",cols="<,>,>,>,>",options="header",]
368368
|===
369369
| |FCVT.W.S |FCVT.WU.S |FCVT.L.S |FCVT.LU.S
370-
|Minimum valid input (after rounding) |latexmath:[$-2^{31}$] |0
371-
|latexmath:[$-2^{63}$] |0
370+
|Minimum valid input (after rounding) |−2^31^ |0
371+
|−2^63^ |0
372372

373-
|Maximum valid input (after rounding) |latexmath:[$2^{31}-1$]
374-
|latexmath:[$2^{32}-1$] |latexmath:[$2^{63}-1$] |latexmath:[$2^{64}-1$]
373+
|Maximum valid input (after rounding) |2^31^−1
374+
|2^32^−1 |2^63^−1 |2^64^−1
375375

376-
|Output for out-of-range negative input |latexmath:[$-2^{31}$] |0
377-
|latexmath:[$-2^{63}$] |0
376+
|Output for out-of-range negative input |−2^31^ |0
377+
|−2^63^ |0
378378

379-
|Output for latexmath:[$-\infty$] |latexmath:[$-2^{31}$] |0
380-
|latexmath:[$-2^{63}$] |0
379+
|Output for -{inf} |−2^31^ |0
380+
|−2^63^ |0
381381

382-
|Output for out-of-range positive input |latexmath:[$2^{31}-1$]
383-
|latexmath:[$2^{32}-1$] |latexmath:[$2^{63}-1$] |latexmath:[$2^{64}-1$]
382+
|Output for out-of-range positive input |2^31^−1
383+
|2^32^−1 |2^63^−1 |2^64^−1
384384

385-
|Output for latexmath:[$+\infty$] or NaN |latexmath:[$2^{31}-1$]
386-
|latexmath:[$2^{32}-1$] |latexmath:[$2^{63}-1$] |latexmath:[$2^{64}-1$]
385+
|Output for +{inf} or NaN |2^31^−1
386+
|2^32^−1 |2^63^−1 |2^64^−1
387387
|===
388388

389389
All floating-point conversion instructions set the Inexact exception
@@ -444,10 +444,8 @@ representing integer values in the floating-point registers by defining conversi
444444

445445
Floating-point compare instructions (FEQ.S, FLT.S, FLE.S) perform the
446446
specified comparison between floating-point registers
447-
(latexmath:[$\mbox{\em rs1}
448-
= \mbox{\em rs2}$], latexmath:[$\mbox{\em rs1} < \mbox{\em rs2}$],
449-
latexmath:[$\mbox{\em rs1} \leq
450-
\mbox{\em rs2}$]) writing 1 to the integer register _rd_ if the
447+
(_rs1_ = _rs2_, _rs1_ < _rs2_,
448+
_rs1_ {le} _rs2_) writing 1 to the integer register _rd_ if the
451449
condition holds, and 0 otherwise.
452450

453451
FLT.S and FLE.S perform what the IEEE 754-2008 standard refers to as
@@ -461,9 +459,9 @@ include::images/wavedrom/spfloat-comp.edn[]
461459

462460
[NOTE]
463461
====
464-
The F extension provides a latexmath:[$\leq$] comparison, whereas the
465-
base ISAs provide a latexmath:[$\geq$] branch comparison. Because
466-
latexmath:[$\leq$] can be synthesized from latexmath:[$\geq$] and
462+
The F extension provides a {le} comparison, whereas the
463+
base ISAs provide a {ge} branch comparison. Because
464+
{le} can be synthesized from {ge} and
467465
vice-versa, there is no performance implication to this inconsistency,
468466
but it is nevertheless an unfortunate incongruity in the ISA.
469467
====
@@ -488,14 +486,14 @@ include::images/wavedrom/spfloat-classify.edn[]
488486
[%autowidth,float="center",align="center",cols="^,<",options="header",]
489487
|===
490488
|_rd_ bit |Meaning
491-
|0 |_rs1_ is latexmath:[$-\infty$].
489+
|0 |_rs1_ is −{inf}.
492490
|1 |_rs1_ is a negative normal number.
493491
|2 |_rs1_ is a negative subnormal number.
494-
|3 |_rs1_ is latexmath:[$-0$].
495-
|4 |_rs1_ is latexmath:[$+0$].
492+
|3 |_rs1_ is −0.
493+
|4 |_rs1_ is +0.
496494
|5 |_rs1_ is a positive subnormal number.
497495
|6 |_rs1_ is a positive normal number.
498-
|7 |_rs1_ is latexmath:[$+\infty$].
496+
|7 |_rs1_ is +{inf}.
499497
|8 |_rs1_ is a signaling NaN.
500498
|9 |_rs1_ is a quiet NaN.
501499
|===

src/hypervisor.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ counters to the guest virtual machine.
729729
.Hypervisor counter-enable register (`hcounteren`).
730730
include::images/bytefield/hcounterenreg.edn[]
731731

732-
When the CY, TM, IR, or HPM_n_ bit in the `hcounteren` register is
732+
When the CY, TM, IR, or HPM__n__ bit in the `hcounteren` register is
733733
clear, attempts to read the `cycle`, `time`, `instret`, or
734734
`hpmcounter` _n_ register while V=1 will cause a virtual-instruction
735735
exception if the same bit in `mcounteren` is 1. When one of these bits

src/intro.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,13 @@ regardless of any subsequent extensions.
355355

356356

357357
A RISC-V hart has a single byte-addressable address space of
358-
latexmath:[$2^{\text{XLEN}}$] bytes for all memory accesses. A _word_ of
358+
2^XLEN^ bytes for all memory accesses. A _word_ of
359359
memory is defined as 32{nbsp}bits (4{nbsp}bytes). Correspondingly, a _halfword_ is 16{nbsp}bits (2{nbsp}bytes), a
360360
_doubleword_ is 64{nbsp}bits (8{nbsp}bytes), and a _quadword_ is 128{nbsp}bits (16{nbsp}bytes). The memory address space is
361-
circular, so that the byte at address latexmath:[$2^{\text{XLEN}}-1$] is
361+
circular, so that the byte at address 2^XLEN^−1 is
362362
adjacent to the byte at address zero. Accordingly, memory address
363363
computations done by the hardware ignore overflow and instead wrap
364-
around modulo latexmath:[$2^{\text{XLEN}}$].
364+
around modulo 2^XLEN^.
365365

366366
The execution environment determines the mapping of hardware resources
367367
into a hart's address space. Different address ranges of a hart's

src/m-st-ext.adoc

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ the sign of a nonzero result equals the sign of the dividend.#
6666
[NOTE]
6767
====
6868
For both signed and unsigned division, except in the case of overflow, it holds
69-
that
70-
latexmath:[$\textrm{dividend} = \textrm{divisor} \times \textrm{quotient} + \textrm{remainder}$].
69+
that dividend = divisor {times} quotient + remainder.
7170
====
7271

7372
If both the quotient and remainder are required from the same division,
@@ -89,7 +88,7 @@ The semantics for division by zero and division overflow are summarized
8988
in <<divby0>>. [#norm:div_by_zero]#The quotient of division by zero has all bits
9089
set#, and [#norm:rem_by_zero]#the remainder of division by zero equals the dividend.#
9190
[#norm:signed_div_overflow]#Signed division overflow occurs only when the most-negative integer is divided
92-
by latexmath:[$-1$]. The quotient of a signed division with overflow is
91+
by −1. The quotient of a signed division with overflow is
9392
equal to the dividend, and the remainder is zero.# Unsigned division
9493
overflow cannot occur.
9594

@@ -100,17 +99,17 @@ overflow cannot occur.
10099
|Condition |Dividend |Divisor |DIVU[W] |REMU[W] |DIV[W] |REM[W]
101100

102101
|Division by zero +
103-
Overflow (signed only) |latexmath:[$x$] +
104-
latexmath:[$-2^{L-1}$] |0 +
105-
latexmath:[$-1$] |latexmath:[$2^{L}-1$] +
106-
- |latexmath:[$x$] +
107-
- |latexmath:[$-1$] +
108-
latexmath:[$-2^{L-1}$] +
109-
|latexmath:[$x$] +
102+
Overflow (signed only) |_x_ +
103+
-2^L-1^ |0 +
104+
−1 |2^L^-1 +
105+
- |_x_ +
106+
- |−1 +
107+
-2^L-1^ +
108+
|_x_ +
110109
0
111110
|===
112111

113-
//|Overflow (signed only) |latexmath:[$-2^{L-1}$] |latexmath:[$-1$] |– |– |latexmath:[$-2^{L-1}$] |0
112+
//|Overflow (signed only) |−2^L−1^ |−1 |– |– |−2^L−1^ |0
114113
//|===
115114

116115
[NOTE]

src/machine.adoc

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ S-mode respectively. When executing an __x__RET instruction, supposing
456456
__x__PP holds the value _y_, __x__IE is set to __x__PIE; the privilege mode is
457457
changed to _y_; __x__PIE is set to 1; and __x__PP is set to the
458458
least-privileged supported mode (U if U-mode is implemented, else M). If
459-
__y__&#8800;M, __x__RET also sets MPRV=0.
459+
__y__{ne}M, __x__RET also sets MPRV=0.
460460

461461
[NOTE]
462462
====
@@ -1626,7 +1626,7 @@ of this register.
16261626

16271627
When the CY, IR, or HPM__n__ bit in the `mcountinhibit` register is clear,
16281628
the `mcycle`, `minstret`, or `mhpmcountern` register increments as usual.
1629-
When the CY, IR, or HPM_n_ bit is set, the corresponding counter does
1629+
When the CY, IR, or HPM__n__ bit is set, the corresponding counter does
16301630
not increment.
16311631

16321632
The `mcycle` CSR may be shared between harts on the same core, in which
@@ -2101,7 +2101,7 @@ include::images/bytefield/mconfigptrreg.edn[]
21012101

21022102
The pointer alignment in bits must be no smaller than MXLEN:
21032103
i.e., if MXLEN is
2104-
latexmath:[$8\times n$], then `mconfigptr`[latexmath:[$\log_2n$]-1:0]
2104+
8{times}__n__, then `mconfigptr`[log~2n~-1:0]
21052105
must be zero.
21062106

21072107
The `mconfigptr` register must be implemented, but it may be zero to indicate the
@@ -3225,20 +3225,19 @@ If `pmpaddr~i-1~&#8805;``pmpaddr~i~``` and `pmpcfg~i~.A`=TOR, then PMP entry _i
32253225

32263226
Although the PMP mechanism supports regions as small as four bytes,
32273227
platforms may specify coarser PMP regions. In general, the PMP grain is
3228-
latexmath:[$2^{G+2}$] bytes and must be the same across all PMP regions.
3229-
When latexmath:[$G \geq 1$], the NA4 mode is not selectable. When
3230-
latexmath:[$G \geq 2$] and latexmath:[${\tt pmpcfg}_i$].A[1] is set,
3231-
i.e. the mode is NAPOT, then bits latexmath:[${\tt pmpaddr}_i$][G-2:0]
3232-
read as all ones. When latexmath:[$G \geq 1$] and
3233-
latexmath:[${\tt pmpcfg}_i$].A[1] is clear, i.e. the mode is OFF or TOR,
3234-
then bits latexmath:[${\tt pmpaddr}_i$][G-1:0] read as all zeros. Bits
3235-
latexmath:[${\tt
3236-
pmpaddr}_i$][G-1:0] do not affect the TOR address-matching logic.
3237-
Although changing latexmath:[${\tt pmpcfg}_i$].A[1] affects the value
3238-
read from latexmath:[${\tt pmpaddr}_i$], it does not affect the
3228+
2^G+2^ bytes and must be the same across all PMP regions.
3229+
When G {ge} 1, the NA4 mode is not selectable. When
3230+
G {ge} 2 and pmpcfg~i~.A[1] is set,
3231+
i.e. the mode is NAPOT, then bits pmpaddr~i~[G-2:0]
3232+
read as all ones. When G {ge} 1 and
3233+
pmpcfg~i~.A[1] is clear, i.e. the mode is OFF or TOR,
3234+
then bits pmpaddr~i~[G-1:0] read as all zeros. Bits
3235+
pmpaddr~i~[G-1:0] do not affect the TOR address-matching logic.
3236+
Although changing pmpcfg~i~.A[1] affects the value
3237+
read from pmpaddr~i~, it does not affect the
32393238
underlying value stored in that register—in particular,
3240-
latexmath:[${\tt pmpaddr}_i$][G-1] retains its original value when
3241-
latexmath:[${\tt pmpcfg}_i$].A is changed from NAPOT to TOR/OFF then
3239+
pmpaddr~i~[G-1] retains its original value when
3240+
pmpcfg~i~.A is changed from NAPOT to TOR/OFF then
32423241
back to NAPOT.
32433242

32443243
[NOTE]

0 commit comments

Comments
 (0)