Skip to content

Commit dda380b

Browse files
committed
Merge with upstream
2 parents 1638fad + b16745e commit dda380b

32 files changed

+828
-171
lines changed

document/core/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ publish-main: clean main bikeshed-keep deploy
8080
all: pdf html bikeshed
8181

8282
.PHONY: main
83-
main: pdf html
83+
main: macrosok pdf html
8484

8585
# Dirty hack to avoid rebuilding the Bikeshed version for every push.
8686
.PHONY: bikeshed-keep
@@ -97,6 +97,10 @@ GENERATED = appendix/index-instructions.rst
9797
%.rst: %.py
9898
(cd `dirname $@`; ./`basename $^`)
9999

100+
.PHONY: macrosok
101+
macrosok: $(GENERATED)
102+
sh util/check_macros.sh
103+
100104
.PHONY: pdf
101105
pdf: $(GENERATED) latexpdf
102106
mkdir -p $(BUILDDIR)/html/$(DOWNLOADDIR)

document/core/appendix/embedding.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,11 +652,12 @@ Globals
652652
\end{array}
653653
654654
655-
.. index:: reference, reference type
655+
.. index:: reference, reference type, value type, value
656656
.. _embed-ref-type:
657+
.. _embed-val-default:
657658

658-
References
659-
~~~~~~~~~~
659+
Values
660+
~~~~~~
660661

661662
:math:`\F{ref\_type}(\store, \reff) : \reftype`
662663
...............................................
@@ -678,6 +679,20 @@ References
678679
In such cases, this function may return a less precise supertype.
679680

680681

682+
:math:`\F{val\_default}(\valtype) : \val`
683+
...............................................
684+
685+
1. If :math:`\default_{valtype}` is not defined, then return :math:`\ERROR`.
686+
687+
1. Else, return the :ref:`value <syntax-val>` :math:`\default_{valtype}`.
688+
689+
.. math::
690+
\begin{array}{lclll}
691+
\F{val\_default}(t) &=& v && (\iff \default_t = v) \\
692+
\F{val\_default}(t) &=& \ERROR && (\iff \default_t = \epsilon) \\
693+
\end{array}
694+
695+
681696
.. index:: value type, external type, subtyping
682697
.. _embed-match-valtype:
683698
.. _embed-match-externtype:

document/core/appendix/index-instructions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def Instruction(name, opcode, type=None, validation=None, execution=None, operat
356356
Instruction(r'\BRONCASTFAIL~t_1~t_2', r'\hex{FB}~\hex{19}', r'[t_1] \to [t_2]', r'valid-br_on_cast_fail', r'exec-br_on_cast_fail'),
357357
Instruction(r'\ANYCONVERTEXTERN', r'\hex{FB}~\hex{1A}', r'[(\REF~\NULL~\EXTERN)] \to [(\REF~\NULL~\ANY)]', r'valid-any.convert_extern', r'exec-any.convert_extern'),
358358
Instruction(r'\EXTERNCONVERTANY', r'\hex{FB}~\hex{1B}', r'[(\REF~\NULL~\ANY)] \to [(\REF~\NULL~\EXTERN)]', r'valid-extern.convert_any', r'exec-extern.convert_any'),
359-
Instruction(r'\REFI31', r'\hex{FB}~\hex{1C}', r'[\I32] \to [\I31REF]', r'valid-ref.i31', r'exec-ref.i31'),
359+
Instruction(r'\REFI31', r'\hex{FB}~\hex{1C}', r'[\I32] \to [(\REF~\I31)]', r'valid-ref.i31', r'exec-ref.i31'),
360360
Instruction(r'\I31GETS', r'\hex{FB}~\hex{1D}', r'[\I31REF] \to [\I32]', r'valid-i31.get_sx', r'exec-i31.get_sx'),
361361
Instruction(r'\I31GETU', r'\hex{FB}~\hex{1E}', r'[\I31REF] \to [\I32]', r'valid-i31.get_sx', r'exec-i31.get_sx'),
362362
Instruction(None, r'\hex{FB}~\hex{1E} \dots'),

document/core/appendix/properties.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In order to state and prove soundness precisely, the typing rules must be extend
2121

2222

2323
.. index:: context, recursive type, recursive type index
24-
.. context-rec:
24+
.. _context-ext:
2525

2626
Contexts
2727
~~~~~~~~
@@ -832,7 +832,7 @@ where :math:`\val_1 \gg^+_S \val_2` denotes the transitive closure of the follow
832832
* Let :math:`x^\ast` be the sequence of :ref:`function indices <syntax-funcidx>` from :math:`0` to :math:`m-1`.
833833

834834
* Then the module instance is valid with :ref:`context <context>`
835-
:math:`\{\CTYPES~\deftype^\ast,` :math:`\CFUNCS~\functype^\ast,` :math:`\CTABLES~\tabletype^\ast,` :math:`\CMEMS~\memtype^\ast,` :math:`\CGLOBALS~\globaltype^\ast,` \CTAGS~\tagtype^\ast, :math:`\CELEMS~\reftype^\ast,` :math:`\CDATAS~{\ok}^n\}`.
835+
:math:`\{\CTYPES~\deftype^\ast,` :math:`\CFUNCS~\functype^\ast,` :math:`\CTABLES~\tabletype^\ast,` :math:`\CMEMS~\memtype^\ast,` :math:`\CGLOBALS~\globaltype^\ast,` \CTAGS~\tagtype^\ast, :math:`\CELEMS~\reftype^\ast,` :math:`\CDATAS~{\ok}^n,` :math:`\CREFS~x^\ast\}`.
836836

837837
.. math::
838838
~\\[-1ex]

document/core/binary/modules.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ It decodes into a vector of :ref:`element segments <syntax-elem>` that represent
350350
\production{element segment} & \Belem &::=&
351351
0{:}\Bu32~~e{:}\Bexpr~~y^\ast{:}\Bvec(\Bfuncidx)
352352
&\Rightarrow& \\&&&\quad
353-
\{ \ETYPE~(\REF~\NULL~\FUNC), \EINIT~((\REFFUNC~y)~\END)^\ast, \EMODE~\EACTIVE~\{ \ETABLE~0, \EOFFSET~e \} \} \\ &&|&
353+
\{ \ETYPE~(\REF~\FUNC), \EINIT~((\REFFUNC~y)~\END)^\ast, \EMODE~\EACTIVE~\{ \ETABLE~0, \EOFFSET~e \} \} \\ &&|&
354354
1{:}\Bu32~~\X{et}:\Belemkind~~y^\ast{:}\Bvec(\Bfuncidx)
355355
&\Rightarrow& \\&&&\quad
356356
\{ \ETYPE~\X{et}, \EINIT~((\REFFUNC~y)~\END)^\ast, \EMODE~\EPASSIVE \} \\ &&|&
@@ -362,7 +362,7 @@ It decodes into a vector of :ref:`element segments <syntax-elem>` that represent
362362
\{ \ETYPE~\X{et}, \EINIT~((\REFFUNC~y)~\END)^\ast, \EMODE~\EDECLARATIVE \} \\ &&|&
363363
4{:}\Bu32~~e{:}\Bexpr~~\X{el}^\ast{:}\Bvec(\Bexpr)
364364
&\Rightarrow& \\&&&\quad
365-
\{ \ETYPE~(\REF~\NULL~\FUNC), \EINIT~\X{el}^\ast, \EMODE~\EACTIVE~\{ \ETABLE~0, \EOFFSET~e \} \} \\ &&|&
365+
\{ \ETYPE~(\REF~\FUNC), \EINIT~\X{el}^\ast, \EMODE~\EACTIVE~\{ \ETABLE~0, \EOFFSET~e \} \} \\ &&|&
366366
5{:}\Bu32~~\X{et}:\Breftype~~\X{el}^\ast{:}\Bvec(\Bexpr)
367367
&\Rightarrow& \\&&&\quad
368368
\{ \ETYPE~et, \EINIT~\X{el}^\ast, \EMODE~\EPASSIVE \} \\ &&|&
@@ -373,7 +373,7 @@ It decodes into a vector of :ref:`element segments <syntax-elem>` that represent
373373
&\Rightarrow& \\&&&\quad
374374
\{ \ETYPE~et, \EINIT~\X{el}^\ast, \EMODE~\EDECLARATIVE \} \\
375375
\production{element kind} & \Belemkind &::=&
376-
\hex{00} &\Rightarrow& \FUNCREF \\
376+
\hex{00} &\Rightarrow& (\REF~\FUNC) \\
377377
\end{array}
378378
379379
.. note::

document/core/exec/instructions.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -819,14 +819,14 @@ Reference Instructions
819819
S; F; (\I32.\CONST~s)~(\I32.\CONST~n)~(\ARRAYNEWDATA~x~y) &\stepto& \TRAP
820820
\\&&
821821
\begin{array}[t]{@{}r@{~}l@{}}
822-
(\iff & \expanddt(F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft}^n \\
822+
(\iff & \expanddt(F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft} \\
823823
\land & s + n\cdot|\X{ft}|/8 > |S.\SDATAS[F.\AMODULE.\MIDATAS[y]].\DIDATA|)
824824
\end{array} \\
825825
\\[1ex]
826826
S; F; (\I32.\CONST~s)~(\I32.\CONST~n)~(\ARRAYNEWDATA~x~y) &\stepto& (t.\CONST~c)^n~(\ARRAYNEWFIXED~x~n)
827827
\\&&
828828
\begin{array}[t]{@{}r@{~}l@{}}
829-
(\iff & \expanddt(F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft}^n \\
829+
(\iff & \expanddt(F.\AMODULE.\MITYPES[x]) = \TARRAY~\X{ft} \\
830830
\land & t = \unpacktype(\X{ft}) \\
831831
\land & \concat((\bytes_{\X{ft}}(c))^n) = S.\SDATAS[F.\AMODULE.\MIDATAS[y]].\DIDATA[s \slice n\cdot|\X{ft}|/8] \\
832832
\end{array} \\
@@ -1065,7 +1065,7 @@ Reference Instructions
10651065

10661066
12. Assert: due to :ref:`validation <valid-array.fill>`, the :ref:`array instance <syntax-arrayinst>` :math:`S.\SARRAYS[a]` exists.
10671067

1068-
13. If :math:`d + n` is larger than or equal to the length of :math:`S.\SARRAYS[a].\AIFIELDS`, then:
1068+
13. If :math:`d + n` is larger than the length of :math:`S.\SARRAYS[a].\AIFIELDS`, then:
10691069

10701070
a. Trap.
10711071

@@ -1102,13 +1102,13 @@ Reference Instructions
11021102
(\iff d + n > |S.\SARRAYS[a].\AIFIELDS|)
11031103
\\[1ex]
11041104
S; (\REFARRAYADDR~a)~(\I32.\CONST~d)~\val~(\I32.\CONST~0)~(\ARRAYFILL~x)
1105-
\quad\stepto\quad S; \epsilon
1105+
\quad\stepto\quad \epsilon
11061106
\\ \qquad
11071107
(\otherwise)
11081108
\\[1ex]
11091109
S; (\REFARRAYADDR~a)~(\I32.\CONST~d)~\val~(\I32.\CONST~n+1)~(\ARRAYFILL~x)
11101110
\quad\stepto
1111-
\\ \quad S;
1111+
\\ \quad
11121112
\begin{array}[t]{@{}l@{}}
11131113
(\REFARRAYADDR~a)~(\I32.\CONST~d)~\val~(\ARRAYSET~x) \\
11141114
(\REFARRAYADDR~a)~(\I32.\CONST~d+1)~\val~(\I32.\CONST~n)~(\ARRAYFILL~x) \\
@@ -1175,11 +1175,11 @@ Reference Instructions
11751175

11761176
23. Assert: due to :ref:`validation <valid-array.copy>`, the :ref:`array instance <syntax-arrayinst>` :math:`S.\SARRAYS[a_2]` exists.
11771177

1178-
24. If :math:`d + n` is larger than or equal to the length of :math:`S.\SARRAYS[a_1].\AIFIELDS`, then:
1178+
24. If :math:`d + n` is larger than the length of :math:`S.\SARRAYS[a_1].\AIFIELDS`, then:
11791179

11801180
a. Trap.
11811181

1182-
25. If :math:`s + n` is larger than or equal to the length of :math:`S.\SARRAYS[a_2].\AIFIELDS`, then:
1182+
25. If :math:`s + n` is larger than the length of :math:`S.\SARRAYS[a_2].\AIFIELDS`, then:
11831183

11841184
a. Trap.
11851185

@@ -1252,7 +1252,7 @@ Reference Instructions
12521252
(\iff d + n > |S.\SARRAYS[a_1].\AIFIELDS| \vee s + n > |S.\SARRAYS[a_2].\AIFIELDS|)
12531253
\\[1ex]
12541254
S; F; (\REFARRAYADDR~a_1)~(\I32.\CONST~d)~(\REFARRAYADDR~a_2)~(\I32.\CONST~s)~(\I32.\CONST~0)~(\ARRAYCOPY~x~y)
1255-
\quad\stepto\quad S; \epsilon
1255+
\quad\stepto\quad \epsilon
12561256
\\ \qquad
12571257
(\otherwise)
12581258
\\[1ex]
@@ -1391,13 +1391,13 @@ Where:
13911391
\end{array}
13921392
\\[1ex]
13931393
S; F; (\REFARRAYADDR~a)~(\I32.\CONST~d)~(\I32.\CONST~s)~(\I32.\CONST~0)~(\ARRAYINITDATA~x~y)
1394-
\quad\stepto\quad S; F; \epsilon
1394+
\quad\stepto\quad \epsilon
13951395
\\ \qquad
13961396
(\otherwise)
13971397
\\[1ex]
13981398
S; F; (\REFARRAYADDR~a)~(\I32.\CONST~d)~(\I32.\CONST~s)~(\I32.\CONST~n+1)~(\ARRAYINITDATA~x~y)
13991399
\quad\stepto
1400-
\\ \quad S; F;
1400+
\\ \quad
14011401
\begin{array}[t]{@{}l@{}}
14021402
(\REFARRAYADDR~a)~(\I32.\CONST~d)~(t.\CONST~c)~(\ARRAYSET~x) \\
14031403
(\REFARRAYADDR~a)~(\I32.\CONST~d+1)~(\I32.\CONST~s+|\X{ft}|/8)~(\I32.\CONST~n)~(\ARRAYINITDATA~x~y) \\
@@ -1497,13 +1497,13 @@ Where:
14971497
\end{array}
14981498
\\[1ex]
14991499
S; F; (\REFARRAYADDR~a)~(\I32.\CONST~d)~(\I32.\CONST~s)~(\I32.\CONST~0)~(\ARRAYINITELEM~x~y)
1500-
\quad\stepto\quad S; F; \epsilon
1500+
\quad\stepto\quad \epsilon
15011501
\\ \qquad
15021502
(\otherwise)
15031503
\\[1ex]
15041504
S; F; (\REFARRAYADDR~a)~(\I32.\CONST~d)~(\I32.\CONST~s)~(\I32.\CONST~n+1)~(\ARRAYINITELEM~x~y)
15051505
\quad\stepto
1506-
\\ \quad S; F;
1506+
\\ \quad
15071507
\begin{array}[t]{@{}l@{}}
15081508
(\REFARRAYADDR~a)~(\I32.\CONST~d)~\REF~(\ARRAYSET~x) \\
15091509
(\REFARRAYADDR~a)~(\I32.\CONST~d+1)~(\I32.\CONST~s+1)~(\I32.\CONST~n)~(\ARRAYINITELEM~x~y) \\
@@ -1538,7 +1538,7 @@ Where:
15381538

15391539
.. math::
15401540
\begin{array}{lcl@{\qquad}l}
1541-
(\REFNULL \X{ht})~\ANYCONVERTEXTERN &\stepto& (\REFNULL~\ANY) \\
1541+
(\REFNULL~\X{ht})~\ANYCONVERTEXTERN &\stepto& (\REFNULL~\ANY) \\
15421542
(\REFEXTERN~\reff)~\ANYCONVERTEXTERN &\stepto& \reff \\
15431543
\end{array}
15441544
@@ -1564,8 +1564,8 @@ Where:
15641564

15651565
.. math::
15661566
\begin{array}{lcl@{\qquad}l}
1567-
(\REFNULL \X{ht})~\EXTERNCONVERTANY &\stepto& (\REFNULL~\EXTERN) \\
1568-
\reff~\EXTERNCONVERTANY &\stepto& (\REFEXTERN~\reff) & (\iff \reff \neq (\REFNULL \X{ht})) \\
1567+
(\REFNULL~\X{ht})~\EXTERNCONVERTANY &\stepto& (\REFNULL~\EXTERN) \\
1568+
\reff~\EXTERNCONVERTANY &\stepto& (\REFEXTERN~\reff) & (\iff \reff \neq (\REFNULL~\X{ht})) \\
15691569
\end{array}
15701570
15711571
@@ -1776,7 +1776,7 @@ Most other vector instructions are defined in terms of numeric operators that ar
17761776
:math:`\shape\K{.}\SPLAT`
17771777
.........................
17781778

1779-
1. Let :math:`t` be the type :math:`\unpacked(\shape)`.
1779+
1. Let :math:`t` be the type :math:`\unpackshape(\shape)`.
17801780

17811781
2. Assert: due to :ref:`validation <valid-vec-splat>`, a value of :ref:`value type <syntax-valtype>` :math:`t` is on the top of the stack.
17821782

@@ -1791,7 +1791,7 @@ Most other vector instructions are defined in terms of numeric operators that ar
17911791
.. math::
17921792
\begin{array}{lcl@{\qquad}l}
17931793
(t\K{.}\CONST~c_1)~\shape\K{.}\SPLAT &\stepto& (\V128\K{.}\VCONST~c)
1794-
& (\iff t = \unpacked(\shape)
1794+
& (\iff t = \unpackshape(\shape)
17951795
\wedge c = \lanes^{-1}_{\shape}(c_1^{\dim(\shape)}))
17961796
\\
17971797
\end{array}
@@ -1810,7 +1810,7 @@ Most other vector instructions are defined in terms of numeric operators that ar
18101810

18111811
4. Let :math:`i^\ast` be the result of computing :math:`\lanes_{t_1\K{x}N}(c_1)`.
18121812

1813-
5. Let :math:`t_2` be the type :math:`\unpacked(t_1\K{x}N)`.
1813+
5. Let :math:`t_2` be the type :math:`\unpackshape(t_1\K{x}N)`.
18141814

18151815
6. Let :math:`c_2` be the result of computing :math:`\extend^{sx^?}_{t_1,t_2}(i^\ast[x])`.
18161816

@@ -1823,7 +1823,7 @@ Most other vector instructions are defined in terms of numeric operators that ar
18231823
\end{array}
18241824
\\ \qquad
18251825
\begin{array}[t]{@{}r@{~}l@{}}
1826-
(\iff & t_2 = \unpacked(t_1\K{x}N) \\
1826+
(\iff & t_2 = \unpackshape(t_1\K{x}N) \\
18271827
\wedge & c_2 = \extend^{sx^?}_{t_1,t_2}(\lanes_{t_1\K{x}N}(c_1)[x]))
18281828
\end{array}
18291829
\end{array}
@@ -1836,7 +1836,7 @@ Most other vector instructions are defined in terms of numeric operators that ar
18361836

18371837
1. Assert: due to :ref:`validation <valid-vec-replace_lane>`, :math:`x < \dim(\shape)`.
18381838

1839-
2. Let :math:`t_2` be the type :math:`\unpacked(\shape)`.
1839+
2. Let :math:`t_2` be the type :math:`\unpackshape(\shape)`.
18401840

18411841
3. Assert: due to :ref:`validation <valid-vec-replace_lane>`, a value of :ref:`value type <syntax-valtype>` :math:`t_1` is on the top of the stack.
18421842

@@ -4377,7 +4377,7 @@ Control Instructions
43774377
\begin{array}{lcl@{\qquad}l}
43784378
S; F; \reff~(\BRONCAST~l~\X{rt}_1~\X{rt}_2) &\stepto& \reff~(\BR~l)
43794379
& (\iff S \vdashval \reff : \X{rt}
4380-
\land \vdashreftypematch \X{rt} \matchesreftype \insttype_{F.\AMODULE}(\X{rt}_2)) \\
4380+
\land {} \vdashreftypematch \X{rt} \matchesreftype \insttype_{F.\AMODULE}(\X{rt}_2)) \\
43814381
S; F; \reff~(\BRONCAST~l~\X{rt}_1~\X{rt}_2) &\stepto& \reff
43824382
& (\otherwise) \\
43834383
\end{array}
@@ -4412,7 +4412,7 @@ Control Instructions
44124412
\begin{array}{lcl@{\qquad}l}
44134413
S; F; \reff~(\BRONCASTFAIL~l~\X{rt}_1~\X{rt}_2) &\stepto& \reff
44144414
& (\iff S \vdashval \reff : \X{rt}
4415-
\land \vdashreftypematch \X{rt} \matchesreftype \insttype_{F.\AMODULE}(\X{rt}_2)) \\
4415+
\land {} \vdashreftypematch \X{rt} \matchesreftype \insttype_{F.\AMODULE}(\X{rt}_2)) \\
44164416
S; F; \reff~(\BRONCASTFAIL~l~\X{rt}_1~\X{rt}_2) &\stepto& \reff~(\BR~l)
44174417
& (\otherwise) \\
44184418
\end{array}

document/core/exec/runtime.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ Conventions
572572
.. math::
573573
\begin{array}{@{}lcl}
574574
\packval_{\valtype}(\val) &=& \val \\
575-
\packval_{\packedtype}(\I32.\CONST~i) &=& \packedtype.\PACK~(\wrap_{32,|\packtype|}(i))
575+
\packval_{\packedtype}(\I32.\CONST~i) &=& \packedtype.\PACK~(\wrap_{32,|\packedtype|}(i))
576576
\end{array}
577577
578578
* The inverse conversion of a :ref:`field value <syntax-fieldval>` to a regular :ref:`value <syntax-val>` is defined as follows:
@@ -726,6 +726,7 @@ Conventions
726726
pair:: abstract syntax; administrative instruction
727727
.. _syntax-trap:
728728
.. _syntax-invoke:
729+
.. _syntax-return_invoke:
729730
.. _syntax-instr-admin:
730731

731732
Administrative Instructions

document/core/exec/values.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following auxiliary typing rules specify this typing relation relative to a
4848

4949
* The :ref:`heap type <syntax-heaptype>` must be :ref:`valid <valid-heaptype>` under the empty :ref:`context <context>`.
5050

51-
* Then value is valid with :ref:`reference type <syntax-reftype>` :math:`(\REF~\NULL~t')`, where the :ref:`heap type <syntax-heaptype>` :math:`t'` that is the least type that :ref:`matches <match-heaptype>` :math:`t`.
51+
* Then the value is valid with :ref:`reference type <syntax-reftype>` :math:`(\REF~\NULL~t')`, where the :ref:`heap type <syntax-heaptype>` :math:`t'` is the least type that :ref:`matches <match-heaptype>` :math:`t`.
5252

5353
.. math::
5454
\frac{

document/core/syntax/types.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Conventions
8181
.. _type-concrete:
8282
.. _syntax-i31:
8383
.. _syntax-heaptype:
84+
.. _syntax-absheaptype:
8485

8586
Heap Types
8687
~~~~~~~~~~
@@ -298,12 +299,21 @@ Structures are heterogeneous, but require static indexing, while arrays need to
298299
\end{array}
299300
300301
.. _bitwidth-fieldtype:
302+
.. _aux-unpacktype:
301303

302304
Conventions
303305
...........
304306

305307
* The notation :math:`|t|` for :ref:`bit width <bitwidth-valtype>` extends to packed types as well, that is, :math:`|\I8| = 8` and :math:`|\I16| = 16`.
306308

309+
* The auxiliary function :math:`\unpacktype` maps a storage type to the :ref:`value type <syntax-valtype>` obtained when accessing a field:
310+
311+
.. math::
312+
\begin{array}{lll}
313+
\unpacktype(\valtype) &=& \valtype \\
314+
\unpacktype(\packedtype) &=& \I32 \\
315+
\end{array}
316+
307317
308318
.. index:: ! composite type, function type, aggreagate type, structure type, array type
309319
pair: abstract syntax; composite type

document/core/text/lexical.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ Any token that does not fall into any of the other categories is considered *res
7171

7272
.. index:: ! white space, character, ASCII
7373
single: text format; white space
74-
.. _text-format:
7574
.. _text-space:
75+
.. _text-format:
76+
.. _text-newline:
7677

7778
White Space
7879
~~~~~~~~~~~

0 commit comments

Comments
 (0)