Skip to content

Commit 0366202

Browse files
committed
Bug 1656226 - Implement the experimental opcodes. r=jseward
Implement some of the experimental SIMD opcodes that are supported by all of V8, LLVM, and Binaryen, for maximum compatibility with test content we might be exposed to. Most/all of these will probably make it into the spec, as they lead to substantial speedups in some programs, and they are deterministic. For spec and cpu mapping details, see: WebAssembly/simd#122 (pmax/pmin) WebAssembly/simd#232 (rounding) WebAssembly/simd#127 (dot product) WebAssembly/simd#237 (load zero) The wasm bytecode values used here come from the binaryen changes that are linked from those tickets, that's the best documentation right now. Current binaryen opcode mappings are here: https://github.com/WebAssembly/binaryen/blob/master/src/wasm-binary.h Also: Drive-by fix for signatures of vroundss and vroundsd, these are unary operations and should follow the conventions for these with src/dest arguments, not src0/src1/dest. Also: Drive-by fix to add variants of vmovss and vmovsd on x64 that take Operand source and FloatRegister destination. Differential Revision: https://phabricator.services.mozilla.com/D85982 UltraBlame original commit: 2e7ddb00c8f9240e148cf5843b50a7ba7b913351
1 parent e2ced78 commit 0366202

21 files changed

+5143
-81
lines changed

js/src/jit-test/lib/wasm-binary.js

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ F64Code
234234
0x7c
235235
;
236236
const
237+
V128Code
238+
=
239+
0x7b
240+
;
241+
const
237242
AnyFuncCode
238243
=
239244
0x70
@@ -296,6 +301,11 @@ SelectCode
296301
0x1b
297302
;
298303
const
304+
LocalGetCode
305+
=
306+
0x20
307+
;
308+
const
299309
I32Load
300310
=
301311
0x28
@@ -535,6 +545,105 @@ RefFuncCode
535545
=
536546
0xd2
537547
;
548+
/
549+
/
550+
SIMD
551+
opcodes
552+
const
553+
V128LoadCode
554+
=
555+
0x00
556+
;
557+
const
558+
V128StoreCode
559+
=
560+
0x0b
561+
;
562+
/
563+
/
564+
Experimental
565+
SIMD
566+
opcodes
567+
as
568+
of
569+
August
570+
2020
571+
.
572+
const
573+
I32x4DotSI16x8Code
574+
=
575+
0xba
576+
;
577+
const
578+
F32x4CeilCode
579+
=
580+
0xd8
581+
;
582+
const
583+
F32x4FloorCode
584+
=
585+
0xd9
586+
;
587+
const
588+
F32x4TruncCode
589+
=
590+
0xda
591+
;
592+
const
593+
F32x4NearestCode
594+
=
595+
0xdb
596+
;
597+
const
598+
F64x2CeilCode
599+
=
600+
0xdc
601+
;
602+
const
603+
F64x2FloorCode
604+
=
605+
0xdd
606+
;
607+
const
608+
F64x2TruncCode
609+
=
610+
0xde
611+
;
612+
const
613+
F64x2NearestCode
614+
=
615+
0xdf
616+
;
617+
const
618+
F32x4PMinCode
619+
=
620+
0xea
621+
;
622+
const
623+
F32x4PMaxCode
624+
=
625+
0xeb
626+
;
627+
const
628+
F64x2PMinCode
629+
=
630+
0xf6
631+
;
632+
const
633+
F64x2PMaxCode
634+
=
635+
0xf7
636+
;
637+
const
638+
V128Load32ZeroCode
639+
=
640+
0xfc
641+
;
642+
const
643+
V128Load64ZeroCode
644+
=
645+
0xfd
646+
;
538647
const
539648
FirstInvalidOpcode
540649
=
@@ -1925,6 +2034,18 @@ name
19252034
)
19262035
)
19272036
;
2037+
if
2038+
(
2039+
exp
2040+
.
2041+
hasOwnProperty
2042+
(
2043+
"
2044+
funcIndex
2045+
"
2046+
)
2047+
)
2048+
{
19282049
body
19292050
.
19302051
push
@@ -1954,6 +2075,60 @@ funcIndex
19542075
)
19552076
;
19562077
}
2078+
else
2079+
if
2080+
(
2081+
exp
2082+
.
2083+
hasOwnProperty
2084+
(
2085+
"
2086+
memIndex
2087+
"
2088+
)
2089+
)
2090+
{
2091+
body
2092+
.
2093+
push
2094+
(
2095+
.
2096+
.
2097+
.
2098+
varU32
2099+
(
2100+
MemoryCode
2101+
)
2102+
)
2103+
;
2104+
body
2105+
.
2106+
push
2107+
(
2108+
.
2109+
.
2110+
.
2111+
varU32
2112+
(
2113+
exp
2114+
.
2115+
memIndex
2116+
)
2117+
)
2118+
;
2119+
}
2120+
else
2121+
{
2122+
throw
2123+
"
2124+
Bad
2125+
export
2126+
"
2127+
+
2128+
exp
2129+
;
2130+
}
2131+
}
19572132
return
19582133
{
19592134
name

0 commit comments

Comments
 (0)