@@ -20,16 +20,15 @@ The mapping of numeric instructions to their underlying operators is expressed b
20
20
21
21
.. math ::
22
22
\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) \\
26
25
\end {array}
27
26
28
27
And for :ref: `conversion operators <exec-cvtop >`:
29
28
30
29
.. math ::
31
30
\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) \\
33
32
\end {array}
34
33
35
34
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
64
63
65
64
2. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
66
65
67
- 3. If :math: `\unop _t (c_1 )` is defined, then:
66
+ 3. If :math: `\unopF _t (c_1 )` is defined, then:
68
67
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 )`.
70
69
71
70
b. Push the value :math: `t.\CONST ~c` to the stack.
72
71
@@ -77,9 +76,9 @@ Where the underlying operators are non-deterministic, because they may return on
77
76
.. math ::
78
77
\begin {array}{lcl@{\qquad }l}
79
78
(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 )) \\
81
80
(t\K {.}\CONST ~c_1 )~t\K {.}\unop &\stepto & \TRAP
82
- & (\iff \unop _ {t}(c_1 ) = \{\})
81
+ & (\iff \unopF _ {t}(c_1 ) = \{\})
83
82
\end {array}
84
83
85
84
@@ -94,9 +93,9 @@ Where the underlying operators are non-deterministic, because they may return on
94
93
95
94
3. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
96
95
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:
98
97
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 )`.
100
99
101
100
b. Push the value :math: `t.\CONST ~c` to the stack.
102
101
@@ -107,9 +106,9 @@ Where the underlying operators are non-deterministic, because they may return on
107
106
.. math ::
108
107
\begin {array}{lcl@{\qquad }l}
109
108
(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 )) \\
111
110
(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 ) = \{\})
113
112
\end {array}
114
113
115
114
@@ -122,14 +121,14 @@ Where the underlying operators are non-deterministic, because they may return on
122
121
123
122
2. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
124
123
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 )`.
126
125
127
126
4. Push the value :math: `\I32 .\CONST ~c` to the stack.
128
127
129
128
.. math ::
130
129
\begin {array}{lcl@{\qquad }l}
131
130
(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 )) \\
133
132
\end {array}
134
133
135
134
@@ -144,14 +143,14 @@ Where the underlying operators are non-deterministic, because they may return on
144
143
145
144
3. Pop the value :math: `t.\CONST ~c_1 ` from the stack.
146
145
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 )`.
148
147
149
148
5. Push the value :math: `\I32 .\CONST ~c` to the stack.
150
149
151
150
.. math ::
152
151
\begin {array}{lcl@{\qquad }l}
153
152
(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 )) \\
155
154
\end {array}
156
155
157
156
@@ -256,20 +255,27 @@ Reference Instructions
256
255
Vector Instructions
257
256
~~~~~~~~~~~~~~~~~~~
258
257
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 .
260
259
261
260
.. math ::
262
261
\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}
263
269
\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) \\
265
271
\end {array}
266
272
267
273
.. 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 )`
273
279
respectively.
274
280
275
281
0 commit comments