Align factorisation of spec and interpreter (to the extent possible). Concretely:
Separate simd type from num_type in spec.
Remove some duplication in syntax and rules by defining side ::= low | high as an auxiliary nonterminal (not too happy with the name, suggestions welcome).
Group and name operator classes in the same way in both spec and interpreter, i.e., \vxyzop in spec corresponds to type V128Op.xyzop in interpreter.
There are few cases where the match isn't 1:1, because the spec splits a group up further for technical reasons (mostly, because execution cannot be defined uniformly):
\viunop does not include popcnt
\vibinop does not include min-max, avgr_u, sat binops, and a bunch of others
\vbinop does not include dot_s, extmul, swizzle, shuffle, and narrow_s/u
\vcvtop does not include extadd_pairwise ops
I might give it another try to unify these as well in a follow-up, but for now I'm not sure how to do it nicely.
Most of these adjustments are changes to the spec, but in two cases I modified the interpreter, namely by introducing relop and cvtop (which also is more symmetric to numeric types).
Added a missing typing rule for swizzle.
Removed an unused typing rule for non-bitwise ternary ops (which don't exist).
Align factorisation of spec and interpreter (to the extent possible). Concretely:
Separate simd type from num_type in spec.
Remove some duplication in syntax and rules by defining
side ::= low | high
as an auxiliary nonterminal (not too happy with the name, suggestions welcome).Group and name operator classes in the same way in both spec and interpreter, i.e.,
\vxyzop
in spec corresponds to typeV128Op.xyzop
in interpreter. There are few cases where the match isn't 1:1, because the spec splits a group up further for technical reasons (mostly, because execution cannot be defined uniformly):\viunop
does not includepopcnt
\vibinop
does not include min-max,avgr_u
, sat binops, and a bunch of others\vbinop
does not includedot_s
,extmul
,swizzle
,shuffle
, andnarrow_s/u
\vcvtop
does not includeextadd_pairwise
opsI might give it another try to unify these as well in a follow-up, but for now I'm not sure how to do it nicely.
Most of these adjustments are changes to the spec, but in two cases I modified the interpreter, namely by introducing
relop
andcvtop
(which also is more symmetric to numeric types).Added a missing typing rule for swizzle.
Removed an unused typing rule for non-bitwise ternary ops (which don't exist).
Fixed a bunch of c&p errors in xrefs.