@@ -20,16 +20,15 @@ The mapping of numeric instructions to their underlying operators is expressed b
2020
2121.. math ::
2222 \begin {array}{lll@{\qquad }l}
23- \X {op}_{\IN }(i_1 ,\dots ,i_k) &=& \F {i}\X {op}_N(i_1 ,\dots ,i_k) \\
24- \X {op}_{\FN }(z_1 ,\dots ,z_k) &=& \F {f}\X {op}_N(z_1 ,\dots ,z_k) \\
25- \X {op}_{\VN }(i_1 ,\dots ,i_k) &=& \F {i}\X {op}_N(i_1 ,\dots ,i_k) \\
23+ \X {op}_{\IN }(i_1 ,\dots ,i_k) &=& \xref {exec/numerics}{int-ops}{\F {i}\X {op}}_N(i_1 ,\dots ,i_k) \\
24+ \X {op}_{\FN }(z_1 ,\dots ,z_k) &=& \xref {exec/numerics}{float-ops}{\F {f}\X {op}}_N(z_1 ,\dots ,z_k) \\
2625 \end {array}
2726
2827 And for :ref: `conversion operators <exec-cvtop >`:
2928
3029.. math ::
3130 \begin {array}{lll@{\qquad }l}
32- \X { cvtop} ^{\sx ^?}_{t_1 ,t_2 }(c) &=& \X {cvtop}^{\sx ^?}_{|t_1 |,|t_2 |}(c) \\
31+ \cvtop ^{\sx ^?}_{t_1 ,t_2 }(c) &=& \xref {exec/numerics}{convert-ops}{ \ X {cvtop} }^{\sx ^?}_{|t_1 |,|t_2 |}(c) \\
3332 \end {array}
3433
3534 Where the underlying operators are partial, the corresponding instruction will :ref: `trap <trap >` when the result is not defined.
@@ -64,9 +63,9 @@ Where the underlying operators are non-deterministic, because they may return on
6463
65642. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
6665
67- 3. If :math: `\unop _t (c_1 )` is defined, then:
66+ 3. If :math: `\unopF _t (c_1 )` is defined, then:
6867
69- a. Let :math: `c` be a possible result of computing :math: `\unop _t (c_1 )`.
68+ a. Let :math: `c` be a possible result of computing :math: `\unopF _t (c_1 )`.
7069
7170 b. Push the value :math: `t.\CONST ~c` to the stack.
7271
@@ -77,9 +76,9 @@ Where the underlying operators are non-deterministic, because they may return on
7776.. math ::
7877 \begin {array}{lcl@{\qquad }l}
7978 (t\K {.}\CONST ~c_1 )~t\K {.}\unop &\stepto & (t\K {.}\CONST ~c)
80- & (\iff c \in \unop _t (c_1 )) \\
79+ & (\iff c \in \unopF _t (c_1 )) \\
8180 (t\K {.}\CONST ~c_1 )~t\K {.}\unop &\stepto & \TRAP
82- & (\iff \unop _ {t}(c_1 ) = \{\})
81+ & (\iff \unopF _ {t}(c_1 ) = \{\})
8382 \end {array}
8483
8584
@@ -94,9 +93,9 @@ Where the underlying operators are non-deterministic, because they may return on
9493
95943. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
9695
97- 4. If :math: `\binop _t (c_1 , c_2 )` is defined, then:
96+ 4. If :math: `\binopF _t (c_1 , c_2 )` is defined, then:
9897
99- a. Let :math: `c` be a possible result of computing :math: `\binop _t (c_1 , c_2 )`.
98+ a. Let :math: `c` be a possible result of computing :math: `\binopF _t (c_1 , c_2 )`.
10099
101100 b. Push the value :math: `t.\CONST ~c` to the stack.
102101
@@ -107,9 +106,9 @@ Where the underlying operators are non-deterministic, because they may return on
107106.. math ::
108107 \begin {array}{lcl@{\qquad }l}
109108 (t\K {.}\CONST ~c_1 )~(t\K {.}\CONST ~c_2 )~t\K {.}\binop &\stepto & (t\K {.}\CONST ~c)
110- & (\iff c \in \binop _t (c_1 ,c_2 )) \\
109+ & (\iff c \in \binopF _t (c_1 ,c_2 )) \\
111110 (t\K {.}\CONST ~c_1 )~(t\K {.}\CONST ~c_2 )~t\K {.}\binop &\stepto & \TRAP
112- & (\iff \binop _ {t}(c_1 ,c_2 ) = \{\})
111+ & (\iff \binopF _ {t}(c_1 ,c_2 ) = \{\})
113112 \end {array}
114113
115114
@@ -122,14 +121,14 @@ Where the underlying operators are non-deterministic, because they may return on
122121
1231222. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
124123
125- 3. Let :math: `c` be the result of computing :math: `\testop _t (c_1 )`.
124+ 3. Let :math: `c` be the result of computing :math: `\testopF _t (c_1 )`.
126125
1271264. Push the value :math: `\I32 .\CONST ~c` to the stack.
128127
129128.. math ::
130129 \begin {array}{lcl@{\qquad }l}
131130 (t\K {.}\CONST ~c_1 )~t\K {.}\testop &\stepto & (\I32 \K {.}\CONST ~c)
132- & (\iff c = \testop _t (c_1 )) \\
131+ & (\iff c = \testopF _t (c_1 )) \\
133132 \end {array}
134133
135134
@@ -144,14 +143,14 @@ Where the underlying operators are non-deterministic, because they may return on
144143
1451443. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
146145
147- 4. Let :math: `c` be the result of computing :math: `\relop _t (c_1 , c_2 )`.
146+ 4. Let :math: `c` be the result of computing :math: `\relopF _t (c_1 , c_2 )`.
148147
1491485. Push the value :math: `\I32 .\CONST ~c` to the stack.
150149
151150.. math ::
152151 \begin {array}{lcl@{\qquad }l}
153152 (t\K {.}\CONST ~c_1 )~(t\K {.}\CONST ~c_2 )~t\K {.}\relop &\stepto & (\I32 \K {.}\CONST ~c)
154- & (\iff c = \relop _t (c_1 ,c_2 )) \\
153+ & (\iff c = \relopF _t (c_1 ,c_2 )) \\
155154 \end {array}
156155
157156
@@ -256,20 +255,27 @@ Reference Instructions
256255Vector Instructions
257256~~~~~~~~~~~~~~~~~~~
258257
259- Most vector instructions are defined in terms of generic numeric operators applied lane-wise based on the :ref: ` shape < syntax-vec-shape >` .
258+ Vector instructions that operate bitwise are handled as integer operations of respective width .
260259
261260.. math ::
262261 \begin {array}{lll@{\qquad }l}
262+ \X {op}_{\VN }(i_1 ,\dots ,i_k) &=& \xref {exec/numerics}{int-ops}{\F {i}\X {op}}_N(i_1 ,\dots ,i_k) \\
263+ \end {array}
264+
265+ Most other vector instructions are defined in terms of numeric operators that are applied lane-wise according to the given :ref: `shape <syntax-vec-shape >`.
266+
267+ .. math ::
268+ \begin {array}{llll}
263269 \X {op}_{t\K {x}N}(n_1 ,\dots ,n_k) &=&
264- \lanes ^{-1 }_{t\K {x}N}(op_t( \ lanes _{t\K {x}N}(n_1 ) ~ \ dots~ \ lanes _{t\K {x}N}(n_k))
270+ \lanes ^{-1 }_{t\K {x}N}(\xref {exec/instructions}{exec-instr-numeric}{ \X {op}}_t(i_ 1 , \dots ,i_k)^ \ast ) & \qquad ( \iff i_ 1 ^ \ast = \ lanes _{t\K {x}N}(n_1 ) \land \ dots \land i_k^ \ast = \ lanes _{t\K {x}N}(n_k) \\
265271 \end {array}
266272
267273 .. note ::
268- For example, the result of instruction :math: `\K {i32 x4 }.\ADD ` applied to operands :math: `i_ 1 , i_ 2 `
269- invokes :math: `\ADD _{\K {i32 x4 }}(i_ 1 , i_ 2 )`, which maps to
270- :math: `\lanes ^{-1 }_{\K {i32 x4 }}(\ADD _{\I32 }(i_1 ^+ , i_2 ^+) )`,
271- where :math: `i_1 ^+ ` and :math: `i_2 ^+ ` are sequences resulting from invoking
272- :math: `\lanes _{\K {i32 x4 }}(i_ 1 )` and :math: `\lanes _{\K {i32 x4 }}(i_ 2 )`
274+ For example, the result of instruction :math: `\K {i32 x4 }.\ADD ` applied to operands :math: `v_ 1 , v_ 2 `
275+ invokes :math: `\ADD _{\K {i32 x4 }}(v_ 1 , v_ 2 )`, which maps to
276+ :math: `\lanes ^{-1 }_{\K {i32 x4 }}(\ADD _{\I32 }(i_1 , i_2 )^ \ast )`,
277+ where :math: `i_1 ^\ast ` and :math: `i_2 ^\ast ` are sequences resulting from invoking
278+ :math: `\lanes _{\K {i32 x4 }}(v_ 1 )` and :math: `\lanes _{\K {i32 x4 }}(v_ 2 )`
273279 respectively.
274280
275281
0 commit comments