Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 71d4fa7

Browse files
authored
Specify binary format for SIMD (#333)
1 parent 7076939 commit 71d4fa7

File tree

4 files changed

+358
-13
lines changed

4 files changed

+358
-13
lines changed

document/core/binary/conventions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ In order to distinguish symbols of the binary syntax from symbols of the abstrac
6868
\hex{7F} &\Rightarrow& \I32 \\ &&|&
6969
\hex{7E} &\Rightarrow& \I64 \\ &&|&
7070
\hex{7D} &\Rightarrow& \F32 \\ &&|&
71-
\hex{7C} &\Rightarrow& \F64 \\
71+
\hex{7C} &\Rightarrow& \F64 \\ &&|&
72+
\hex{7B} &\Rightarrow& \V128 \\
7273
\end{array}
7374
7475
Consequently, the byte :math:`\hex{7F}` encodes the type |I32|,

document/core/binary/instructions.rst

Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,316 @@ whereas the actual opcode is encoded by a variable-length :ref:`unsigned integer
403403
\end{array}
404404
405405
406+
.. index:: simd instruction
407+
pair: binary format; instruction
408+
.. _binary-instr-simd:
409+
410+
SIMD Instructions
411+
~~~~~~~~~~~~~~~~~~~~
412+
413+
All variants of :ref:`SIMD instructions <syntax-instr-simd>` are represented by separate byte codes.
414+
The all have a one byte prefix, whereas the actual opcode is encoded by a variable-length :ref:`unsigned integer <binary-uint>`.
415+
416+
SIMD loads and stores are followed by the encoding of their |memarg| immediate.
417+
418+
.. math::
419+
\begin{array}{llclll}
420+
\production{instruction} & \Binstr &::=& \dots \\&&|&
421+
\hex{FD}~~0{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD~m \\ &&|&
422+
\hex{FD}~~1{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I16X8.\LOAD\K{8x8\_s}~m \\ &&|&
423+
\hex{FD}~~2{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I16X8.\LOAD\K{8x8\_u}~m \\ &&|&
424+
\hex{FD}~~3{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I32X4.\LOAD\K{16x4\_s}~m \\ &&|&
425+
\hex{FD}~~4{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I32X4.\LOAD\K{16x4\_u}~m \\ &&|&
426+
\hex{FD}~~5{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I64X2.\LOAD\K{32x2\_s}~m \\ &&|&
427+
\hex{FD}~~6{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I64X2.\LOAD\K{32x2\_u}~m \\ &&|&
428+
\hex{FD}~~7{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I8X16.\LOAD\K{\_splat}~m \\ &&|&
429+
\hex{FD}~~8{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I16X8.\LOAD\K{\_splat}~m \\ &&|&
430+
\hex{FD}~~9{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I32X4.\LOAD\K{\_splat}~m \\ &&|&
431+
\hex{FD}~~10{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \I64X2.\LOAD\K{\_splat}~m \\ &&|&
432+
\hex{FD}~~11{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\STORE~m \\
433+
\end{array}
434+
435+
The |VCONST| instruction is followed by 16 immediate bytes, which are converted into a |i128| in |littleendian| byte order:
436+
437+
.. math::
438+
\begin{array}{llclll}
439+
\production{instruction} & \Binstr &::=& \dots \\&&|&
440+
\hex{FD}~~12{:}\Bu32~~(b{:}\Bbyte)^{16} &\Rightarrow& \V128.\VCONST~
441+
bytes_{\K{i128}}^{-1}(b_{0}~\dots~b_{15}) \\
442+
\end{array}
443+
444+
.. _binary-vternop:
445+
446+
The |SHUFFLE| instruction is also followed by 16 immediate bytes:
447+
448+
.. math::
449+
\begin{array}{llclll}
450+
\production{instruction} & \Binstr &::=& \dots \\&&|&
451+
\hex{FD}~~13{:}\Bu32~~(b{:}\Bbyte)^{16} &\Rightarrow& \I8X16.\SHUFFLE~b^{16} \\
452+
\end{array}
453+
454+
|EXTRACTLANE| and |REPLACELANE| instructions are followed by 1 immediate byte.
455+
456+
.. math::
457+
\begin{array}{llclll}
458+
\production{instruction} & \Binstr &::=& \dots \\&&|&
459+
\hex{FD}~~21{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I8X16.\EXTRACTLANE\K{\_s}~b \\ &&|&
460+
\hex{FD}~~22{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I8X16.\EXTRACTLANE\K{\_u}~b \\ &&|&
461+
\hex{FD}~~23{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I8X16.\REPLACELANE~b \\ &&|&
462+
\hex{FD}~~24{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I16X8.\EXTRACTLANE\K{\_s}~b \\ &&|&
463+
\hex{FD}~~25{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I16X8.\EXTRACTLANE\K{\_u}~b \\ &&|&
464+
\hex{FD}~~26{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I16X8.\REPLACELANE~b \\ &&|&
465+
\hex{FD}~~27{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I32X4.\EXTRACTLANE~b \\ &&|&
466+
\hex{FD}~~28{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I32X4.\REPLACELANE~b \\ &&|&
467+
\hex{FD}~~29{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I64X2.\EXTRACTLANE~b \\ &&|&
468+
\hex{FD}~~30{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \I64X2.\REPLACELANE~b \\ &&|&
469+
\hex{FD}~~31{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \F32X4.\EXTRACTLANE~b \\ &&|&
470+
\hex{FD}~~32{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \F32X4.\REPLACELANE~b \\ &&|&
471+
\hex{FD}~~33{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \F64X2.\EXTRACTLANE~b \\ &&|&
472+
\hex{FD}~~34{:}\Bu32~~b{:}\Bbyte &\Rightarrow& \F64X2.\REPLACELANE~b \\
473+
\end{array}
474+
475+
All other SIMD instructions are plain opcodes without any immediates.
476+
477+
.. math::
478+
\begin{array}{llclll}
479+
\production{instruction} & \Binstr &::=& \dots && \phantom{simdhaslongerinstructionnames} \\&&|&
480+
\hex{FD}~~14{:}\Bu32 &\Rightarrow& \I8X16.\SWIZZLE \\ &&|&
481+
\hex{FD}~~15{:}\Bu32 &\Rightarrow& \I8X16.\SPLAT \\ &&|&
482+
\hex{FD}~~16{:}\Bu32 &\Rightarrow& \I16X8.\SPLAT \\ &&|&
483+
\hex{FD}~~17{:}\Bu32 &\Rightarrow& \I32X4.\SPLAT \\ &&|&
484+
\hex{FD}~~18{:}\Bu32 &\Rightarrow& \I64X2.\SPLAT \\ &&|&
485+
\hex{FD}~~19{:}\Bu32 &\Rightarrow& \F32X4.\SPLAT \\ &&|&
486+
\hex{FD}~~20{:}\Bu32 &\Rightarrow& \F64X2.\SPLAT \\
487+
\end{array}
488+
489+
.. _binary-virelop:
490+
491+
.. math::
492+
\begin{array}{llclll}
493+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
494+
\hex{FD}~~35{:}\Bu32 &\Rightarrow& \I8X16.\VEQ \\ &&|&
495+
\hex{FD}~~36{:}\Bu32 &\Rightarrow& \I8X16.\VNE \\ &&|&
496+
\hex{FD}~~37{:}\Bu32 &\Rightarrow& \I8X16.\VLT\K{\_s} \\ &&|&
497+
\hex{FD}~~38{:}\Bu32 &\Rightarrow& \I8X16.\VLT\K{\_u} \\ &&|&
498+
\hex{FD}~~39{:}\Bu32 &\Rightarrow& \I8X16.\VGT\K{\_s} \\ &&|&
499+
\hex{FD}~~40{:}\Bu32 &\Rightarrow& \I8X16.\VGT\K{\_u} \\ &&|&
500+
\hex{FD}~~41{:}\Bu32 &\Rightarrow& \I8X16.\VLE\K{\_s} \\ &&|&
501+
\hex{FD}~~42{:}\Bu32 &\Rightarrow& \I8X16.\VLE\K{\_u} \\ &&|&
502+
\hex{FD}~~43{:}\Bu32 &\Rightarrow& \I8X16.\VGE\K{\_s} \\ &&|&
503+
\hex{FD}~~44{:}\Bu32 &\Rightarrow& \I8X16.\VGE\K{\_u} \\
504+
\end{array}
505+
506+
.. math::
507+
\begin{array}{llclll}
508+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
509+
\hex{FD}~~45{:}\Bu32 &\Rightarrow& \I16X8.\VEQ \\ &&|&
510+
\hex{FD}~~46{:}\Bu32 &\Rightarrow& \I16X8.\VNE \\ &&|&
511+
\hex{FD}~~47{:}\Bu32 &\Rightarrow& \I16X8.\VLT\K{\_s} \\ &&|&
512+
\hex{FD}~~48{:}\Bu32 &\Rightarrow& \I16X8.\VLT\K{\_u} \\ &&|&
513+
\hex{FD}~~49{:}\Bu32 &\Rightarrow& \I16X8.\VGT\K{\_s} \\ &&|&
514+
\hex{FD}~~50{:}\Bu32 &\Rightarrow& \I16X8.\VGT\K{\_u} \\ &&|&
515+
\hex{FD}~~51{:}\Bu32 &\Rightarrow& \I16X8.\VLE\K{\_s} \\ &&|&
516+
\hex{FD}~~52{:}\Bu32 &\Rightarrow& \I16X8.\VLE\K{\_u} \\ &&|&
517+
\hex{FD}~~53{:}\Bu32 &\Rightarrow& \I16X8.\VGE\K{\_s} \\ &&|&
518+
\hex{FD}~~54{:}\Bu32 &\Rightarrow& \I16X8.\VGE\K{\_u} \\
519+
\end{array}
520+
521+
.. math::
522+
\begin{array}{llclll}
523+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
524+
\hex{FD}~~55{:}\Bu32 &\Rightarrow& \I32X4.\VEQ \\ &&|&
525+
\hex{FD}~~56{:}\Bu32 &\Rightarrow& \I32X4.\VNE \\ &&|&
526+
\hex{FD}~~57{:}\Bu32 &\Rightarrow& \I32X4.\VLT\K{\_s} \\ &&|&
527+
\hex{FD}~~58{:}\Bu32 &\Rightarrow& \I32X4.\VLT\K{\_u} \\ &&|&
528+
\hex{FD}~~59{:}\Bu32 &\Rightarrow& \I32X4.\VGT\K{\_s} \\ &&|&
529+
\hex{FD}~~60{:}\Bu32 &\Rightarrow& \I32X4.\VGT\K{\_u} \\ &&|&
530+
\hex{FD}~~61{:}\Bu32 &\Rightarrow& \I32X4.\VLE\K{\_s} \\ &&|&
531+
\hex{FD}~~62{:}\Bu32 &\Rightarrow& \I32X4.\VLE\K{\_u} \\ &&|&
532+
\hex{FD}~~63{:}\Bu32 &\Rightarrow& \I32X4.\VGE\K{\_s} \\ &&|&
533+
\hex{FD}~~64{:}\Bu32 &\Rightarrow& \I32X4.\VGE\K{\_u} \\
534+
\end{array}
535+
536+
.. _binary-vfrelop:
537+
538+
.. math::
539+
\begin{array}{llclll}
540+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
541+
\hex{FD}~~65{:}\Bu32 &\Rightarrow& \F32X4.\VEQ \\ &&|&
542+
\hex{FD}~~66{:}\Bu32 &\Rightarrow& \F32X4.\VNE \\ &&|&
543+
\hex{FD}~~67{:}\Bu32 &\Rightarrow& \F32X4.\VLT \\ &&|&
544+
\hex{FD}~~68{:}\Bu32 &\Rightarrow& \F32X4.\VGT \\ &&|&
545+
\hex{FD}~~69{:}\Bu32 &\Rightarrow& \F32X4.\VLE \\ &&|&
546+
\hex{FD}~~70{:}\Bu32 &\Rightarrow& \F32X4.\VGE \\
547+
\end{array}
548+
549+
.. math::
550+
\begin{array}{llclll}
551+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
552+
\hex{FD}~~71{:}\Bu32 &\Rightarrow& \F64X2.\VEQ \\ &&|&
553+
\hex{FD}~~72{:}\Bu32 &\Rightarrow& \F64X2.\VNE \\ &&|&
554+
\hex{FD}~~73{:}\Bu32 &\Rightarrow& \F64X2.\VLT \\ &&|&
555+
\hex{FD}~~74{:}\Bu32 &\Rightarrow& \F64X2.\VGT \\ &&|&
556+
\hex{FD}~~75{:}\Bu32 &\Rightarrow& \F64X2.\VLE \\ &&|&
557+
\hex{FD}~~76{:}\Bu32 &\Rightarrow& \F64X2.\VGE \\
558+
\end{array}
559+
560+
.. _binary-vsunop:
561+
.. _binary-vsbinop:
562+
.. _binary-vsternop:
563+
564+
.. math::
565+
\begin{array}{llclll}
566+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
567+
\hex{FD}~~77{:}\Bu32 &\Rightarrow& \V128.\VNOT \\ &&|&
568+
\hex{FD}~~78{:}\Bu32 &\Rightarrow& \V128.\VAND \\ &&|&
569+
\hex{FD}~~79{:}\Bu32 &\Rightarrow& \V128.\VANDNOT \\ &&|&
570+
\hex{FD}~~80{:}\Bu32 &\Rightarrow& \V128.\VOR \\ &&|&
571+
\hex{FD}~~81{:}\Bu32 &\Rightarrow& \V128.\VXOR \\ &&|&
572+
\hex{FD}~~82{:}\Bu32 &\Rightarrow& \V128.\BITSELECT
573+
\end{array}
574+
575+
.. _binary-vtestop:
576+
.. _binary-vshiftop:
577+
.. _binary-viunop:
578+
.. _binary-vibinop:
579+
.. _binary-viminmaxop:
580+
.. _binary-vsatbinop:
581+
582+
.. math::
583+
\begin{array}{llclll}
584+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
585+
\hex{FD}~~96{:}\Bu32 &\Rightarrow& \I8X16.\VABS \\ &&|&
586+
\hex{FD}~~97{:}\Bu32 &\Rightarrow& \I8X16.\VNEG \\ &&|&
587+
\hex{FD}~~98{:}\Bu32 &\Rightarrow& \I8X16.\ANYTRUE \\ &&|&
588+
\hex{FD}~~99{:}\Bu32 &\Rightarrow& \I8X16.\ALLTRUE \\ &&|&
589+
\hex{FD}~~100{:}\Bu32 &\Rightarrow& \I8X16.\BITMASK \\ &&|&
590+
\hex{FD}~~101{:}\Bu32 &\Rightarrow& \I8X16.\NARROW\K{\_i16x8\_s} \\ &&|&
591+
\hex{FD}~~102{:}\Bu32 &\Rightarrow& \I8X16.\NARROW\K{\_i16x8\_u} \\ &&|&
592+
\hex{FD}~~107{:}\Bu32 &\Rightarrow& \I8X16.\VSHL \\ &&|&
593+
\hex{FD}~~108{:}\Bu32 &\Rightarrow& \I8X16.\VSHR\K{\_s} \\ &&|&
594+
\hex{FD}~~109{:}\Bu32 &\Rightarrow& \I8X16.\VSHR\K{\_u} \\ &&|&
595+
\hex{FD}~~110{:}\Bu32 &\Rightarrow& \I8X16.\VADD \\ &&|&
596+
\hex{FD}~~111{:}\Bu32 &\Rightarrow& \I8X16.\VADD\K{\_sat\_s} \\ &&|&
597+
\hex{FD}~~112{:}\Bu32 &\Rightarrow& \I8X16.\VADD\K{\_sat\_u} \\ &&|&
598+
\hex{FD}~~113{:}\Bu32 &\Rightarrow& \I8X16.\VSUB \\ &&|&
599+
\hex{FD}~~114{:}\Bu32 &\Rightarrow& \I8X16.\VSUB\K{\_sat\_s} \\ &&|&
600+
\hex{FD}~~115{:}\Bu32 &\Rightarrow& \I8X16.\VSUB\K{\_sat\_u} \\ &&|&
601+
\hex{FD}~~118{:}\Bu32 &\Rightarrow& \I8X16.\VMIN\K{\_s} \\ &&|&
602+
\hex{FD}~~119{:}\Bu32 &\Rightarrow& \I8X16.\VMIN\K{\_u} \\ &&|&
603+
\hex{FD}~~120{:}\Bu32 &\Rightarrow& \I8X16.\VMAX\K{\_s} \\ &&|&
604+
\hex{FD}~~121{:}\Bu32 &\Rightarrow& \I8X16.\VMAX\K{\_u} \\ &&|&
605+
\hex{FD}~~123{:}\Bu32 &\Rightarrow& \I8X16.\AVGR\K{\_u} \\
606+
\end{array}
607+
608+
.. math::
609+
\begin{array}{llclll}
610+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
611+
\hex{FD}~~128{:}\Bu32 &\Rightarrow& \I16X8.\VABS \\ &&|&
612+
\hex{FD}~~129{:}\Bu32 &\Rightarrow& \I16X8.\VNEG \\ &&|&
613+
\hex{FD}~~130{:}\Bu32 &\Rightarrow& \I16X8.\ANYTRUE \\ &&|&
614+
\hex{FD}~~131{:}\Bu32 &\Rightarrow& \I16X8.\ALLTRUE \\ &&|&
615+
\hex{FD}~~132{:}\Bu32 &\Rightarrow& \I16X8.\BITMASK \\ &&|&
616+
\hex{FD}~~133{:}\Bu32 &\Rightarrow& \I16X8.\NARROW\K{\_i32x4\_s} \\ &&|&
617+
\hex{FD}~~134{:}\Bu32 &\Rightarrow& \I16X8.\NARROW\K{\_i32x4\_u} \\ &&|&
618+
\hex{FD}~~135{:}\Bu32 &\Rightarrow& \I16X8.\WIDEN\K{\_low\_i8x16\_s} \\ &&|&
619+
\hex{FD}~~136{:}\Bu32 &\Rightarrow& \I16X8.\WIDEN\K{\_high\_i8x16\_s} \\ &&|&
620+
\hex{FD}~~137{:}\Bu32 &\Rightarrow& \I16X8.\WIDEN\K{\_low\_i8x16\_u} \\ &&|&
621+
\hex{FD}~~138{:}\Bu32 &\Rightarrow& \I16X8.\WIDEN\K{\_high\_i8x16\_u} \\ &&|&
622+
\hex{FD}~~139{:}\Bu32 &\Rightarrow& \I16X8.\VSHL \\ &&|&
623+
\hex{FD}~~140{:}\Bu32 &\Rightarrow& \I16X8.\VSHR\K{\_s} \\ &&|&
624+
\hex{FD}~~141{:}\Bu32 &\Rightarrow& \I16X8.\VSHR\K{\_u} \\ &&|&
625+
\hex{FD}~~142{:}\Bu32 &\Rightarrow& \I16X8.\VADD \\ &&|&
626+
\hex{FD}~~143{:}\Bu32 &\Rightarrow& \I16X8.\VADD\K{\_sat\_s} \\ &&|&
627+
\hex{FD}~~144{:}\Bu32 &\Rightarrow& \I16X8.\VADD\K{\_sat\_u} \\ &&|&
628+
\hex{FD}~~145{:}\Bu32 &\Rightarrow& \I16X8.\VSUB \\ &&|&
629+
\hex{FD}~~146{:}\Bu32 &\Rightarrow& \I16X8.\VSUB\K{\_sat\_s} \\ &&|&
630+
\hex{FD}~~147{:}\Bu32 &\Rightarrow& \I16X8.\VSUB\K{\_sat\_u} \\ &&|&
631+
\hex{FD}~~149{:}\Bu32 &\Rightarrow& \I16X8.\VMUL \\ &&|&
632+
\hex{FD}~~150{:}\Bu32 &\Rightarrow& \I16X8.\VMIN\K{\_s} \\ &&|&
633+
\hex{FD}~~151{:}\Bu32 &\Rightarrow& \I16X8.\VMIN\K{\_u} \\ &&|&
634+
\hex{FD}~~152{:}\Bu32 &\Rightarrow& \I16X8.\VMAX\K{\_s} \\ &&|&
635+
\hex{FD}~~153{:}\Bu32 &\Rightarrow& \I16X8.\VMAX\K{\_u} \\ &&|&
636+
\hex{FD}~~155{:}\Bu32 &\Rightarrow& \I16X8.\AVGR\K{\_u} \\
637+
\end{array}
638+
639+
.. math::
640+
\begin{array}{llclll}
641+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
642+
\hex{FD}~~160{:}\Bu32 &\Rightarrow& \I32X4.\VABS \\ &&|&
643+
\hex{FD}~~161{:}\Bu32 &\Rightarrow& \I32X4.\VNEG \\ &&|&
644+
\hex{FD}~~162{:}\Bu32 &\Rightarrow& \I32X4.\ANYTRUE \\ &&|&
645+
\hex{FD}~~163{:}\Bu32 &\Rightarrow& \I32X4.\ALLTRUE \\ &&|&
646+
\hex{FD}~~164{:}\Bu32 &\Rightarrow& \I32X4.\BITMASK \\ &&|&
647+
\hex{FD}~~167{:}\Bu32 &\Rightarrow& \I32X4.\WIDEN\K{\_low\_i16x8\_s} \\ &&|&
648+
\hex{FD}~~168{:}\Bu32 &\Rightarrow& \I32X4.\WIDEN\K{\_high\_i16x8\_s} \\ &&|&
649+
\hex{FD}~~169{:}\Bu32 &\Rightarrow& \I32X4.\WIDEN\K{\_low\_i16x8\_u} \\ &&|&
650+
\hex{FD}~~170{:}\Bu32 &\Rightarrow& \I32X4.\WIDEN\K{\_high\_i16x8\_u} \\ &&|&
651+
\hex{FD}~~171{:}\Bu32 &\Rightarrow& \I32X4.\VSHL \\ &&|&
652+
\hex{FD}~~172{:}\Bu32 &\Rightarrow& \I32X4.\VSHR\K{\_s} \\ &&|&
653+
\hex{FD}~~173{:}\Bu32 &\Rightarrow& \I32X4.\VSHR\K{\_u} \\ &&|&
654+
\hex{FD}~~174{:}\Bu32 &\Rightarrow& \I32X4.\VADD \\ &&|&
655+
\hex{FD}~~177{:}\Bu32 &\Rightarrow& \I32X4.\VSUB \\ &&|&
656+
\hex{FD}~~181{:}\Bu32 &\Rightarrow& \I32X4.\VMUL \\ &&|&
657+
\hex{FD}~~182{:}\Bu32 &\Rightarrow& \I32X4.\VMIN\K{\_s} \\ &&|&
658+
\hex{FD}~~183{:}\Bu32 &\Rightarrow& \I32X4.\VMIN\K{\_u} \\ &&|&
659+
\hex{FD}~~184{:}\Bu32 &\Rightarrow& \I32X4.\VMAX\K{\_s} \\ &&|&
660+
\hex{FD}~~185{:}\Bu32 &\Rightarrow& \I32X4.\VMAX\K{\_u} \\
661+
\end{array}
662+
663+
.. math::
664+
\begin{array}{llclll}
665+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
666+
\hex{FD}~~193{:}\Bu32 &\Rightarrow& \I64X2.\VNEG \\ &&|&
667+
\hex{FD}~~203{:}\Bu32 &\Rightarrow& \I64X2.\VSHL \\ &&|&
668+
\hex{FD}~~204{:}\Bu32 &\Rightarrow& \I64X2.\VSHR\K{\_s} \\ &&|&
669+
\hex{FD}~~205{:}\Bu32 &\Rightarrow& \I64X2.\VSHR\K{\_u} \\ &&|&
670+
\hex{FD}~~206{:}\Bu32 &\Rightarrow& \I64X2.\VADD \\ &&|&
671+
\hex{FD}~~209{:}\Bu32 &\Rightarrow& \I64X2.\VSUB \\ &&|&
672+
\hex{FD}~~213{:}\Bu32 &\Rightarrow& \I64X2.\VMUL \\
673+
\end{array}
674+
675+
.. _binary-vfunop:
676+
.. _binary-vfbinop:
677+
678+
.. math::
679+
\begin{array}{llclll}
680+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
681+
\hex{FD}~~224{:}\Bu32 &\Rightarrow& \F32X4.\VABS \\ &&|&
682+
\hex{FD}~~225{:}\Bu32 &\Rightarrow& \F32X4.\VNEG \\ &&|&
683+
\hex{FD}~~227{:}\Bu32 &\Rightarrow& \F32X4.\VSQRT \\ &&|&
684+
\hex{FD}~~228{:}\Bu32 &\Rightarrow& \F32X4.\VADD \\ &&|&
685+
\hex{FD}~~229{:}\Bu32 &\Rightarrow& \F32X4.\VSUB \\ &&|&
686+
\hex{FD}~~230{:}\Bu32 &\Rightarrow& \F32X4.\VMUL \\ &&|&
687+
\hex{FD}~~231{:}\Bu32 &\Rightarrow& \F32X4.\VDIV \\ &&|&
688+
\hex{FD}~~232{:}\Bu32 &\Rightarrow& \F32X4.\VMIN \\ &&|&
689+
\hex{FD}~~233{:}\Bu32 &\Rightarrow& \F32X4.\VMAX \\
690+
\end{array}
691+
692+
.. math::
693+
\begin{array}{llclll}
694+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
695+
\hex{FD}~~236{:}\Bu32 &\Rightarrow& \F64X2.\VABS \\ &&|&
696+
\hex{FD}~~237{:}\Bu32 &\Rightarrow& \F64X2.\VNEG \\ &&|&
697+
\hex{FD}~~239{:}\Bu32 &\Rightarrow& \F64X2.\VSQRT \\ &&|&
698+
\hex{FD}~~240{:}\Bu32 &\Rightarrow& \F64X2.\VADD \\ &&|&
699+
\hex{FD}~~241{:}\Bu32 &\Rightarrow& \F64X2.\VSUB \\ &&|&
700+
\hex{FD}~~242{:}\Bu32 &\Rightarrow& \F64X2.\VMUL \\ &&|&
701+
\hex{FD}~~243{:}\Bu32 &\Rightarrow& \F64X2.\VDIV \\ &&|&
702+
\hex{FD}~~244{:}\Bu32 &\Rightarrow& \F64X2.\VMIN \\ &&|&
703+
\hex{FD}~~245{:}\Bu32 &\Rightarrow& \F64X2.\VMAX \\
704+
\end{array}
705+
706+
.. math::
707+
\begin{array}{llclll}
708+
\phantom{\production{instruction}} & \phantom{\Binstr} &\phantom{::=}& \phantom{\dots} && \phantom{simdhaslongerinstructionnames} \\[-2ex] &&|&
709+
\hex{FD}~~248{:}\Bu32 &\Rightarrow& \I32X4.\TRUNC\K{\_sat\_f32x4\_s} \\ &&|&
710+
\hex{FD}~~249{:}\Bu32 &\Rightarrow& \I32X4.\TRUNC\K{\_sat\_f32x4\_u} \\ &&|&
711+
\hex{FD}~~250{:}\Bu32 &\Rightarrow& \F32X4.\CONVERT\K{\_i32x4\_s} \\ &&|&
712+
\hex{FD}~~251{:}\Bu32 &\Rightarrow& \F32X4.\CONVERT\K{\_i32x4\_u} \\
713+
\end{array}
714+
715+
406716
.. index:: expression
407717
pair: binary format; expression
408718
single: expression; constant

document/core/syntax/instructions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ SIMD instructions provide basic operations over :ref:`values <syntax-value>` of
247247
\K{i16x8.}\K{mul} ~|~
248248
\K{i32x4.}\K{mul} ~|~
249249
\K{i64x2.}\K{mul} \\&&|&
250-
\K{i8x16.}\AVGRU ~|~
251-
\K{i16x8.}\AVGRU \\&&|&
250+
\K{i8x16.}\AVGR\K{\_u} ~|~
251+
\K{i16x8.}\AVGR\K{\_u} \\&&|&
252252
\X{fxx.}\vfbinop \\&&|&
253253
\K{i32x4.}\TRUNC\K{\_sat\_f32x4\_}\sx ~|~
254254
\K{f32x4.}\CONVERT\K{\_i32x4\_}\sx \\&&|&

0 commit comments

Comments
 (0)