Skip to content

Commit 1cc886e

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 e228f01 commit 1cc886e

20 files changed

+4641
-40
lines changed

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

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ F64Code
183183
0x7c
184184
;
185185
const
186+
V128Code
187+
=
188+
0x7b
189+
;
190+
const
186191
AnyFuncCode
187192
=
188193
0x70
@@ -242,6 +247,11 @@ SelectCode
242247
0x1b
243248
;
244249
const
250+
LocalGetCode
251+
=
252+
0x20
253+
;
254+
const
245255
I32Load
246256
=
247257
0x28
@@ -482,6 +492,91 @@ RefFuncCode
482492
0xd2
483493
;
484494
const
495+
V128LoadCode
496+
=
497+
0x00
498+
;
499+
const
500+
V128StoreCode
501+
=
502+
0x0b
503+
;
504+
const
505+
I32x4DotSI16x8Code
506+
=
507+
0xba
508+
;
509+
const
510+
F32x4CeilCode
511+
=
512+
0xd8
513+
;
514+
const
515+
F32x4FloorCode
516+
=
517+
0xd9
518+
;
519+
const
520+
F32x4TruncCode
521+
=
522+
0xda
523+
;
524+
const
525+
F32x4NearestCode
526+
=
527+
0xdb
528+
;
529+
const
530+
F64x2CeilCode
531+
=
532+
0xdc
533+
;
534+
const
535+
F64x2FloorCode
536+
=
537+
0xdd
538+
;
539+
const
540+
F64x2TruncCode
541+
=
542+
0xde
543+
;
544+
const
545+
F64x2NearestCode
546+
=
547+
0xdf
548+
;
549+
const
550+
F32x4PMinCode
551+
=
552+
0xea
553+
;
554+
const
555+
F32x4PMaxCode
556+
=
557+
0xeb
558+
;
559+
const
560+
F64x2PMinCode
561+
=
562+
0xf6
563+
;
564+
const
565+
F64x2PMaxCode
566+
=
567+
0xf7
568+
;
569+
const
570+
V128Load32ZeroCode
571+
=
572+
0xfc
573+
;
574+
const
575+
V128Load64ZeroCode
576+
=
577+
0xfd
578+
;
579+
const
485580
FirstInvalidOpcode
486581
=
487582
0xc5
@@ -1784,6 +1879,18 @@ name
17841879
)
17851880
)
17861881
;
1882+
if
1883+
(
1884+
exp
1885+
.
1886+
hasOwnProperty
1887+
(
1888+
"
1889+
funcIndex
1890+
"
1891+
)
1892+
)
1893+
{
17871894
body
17881895
.
17891896
push
@@ -1813,6 +1920,60 @@ funcIndex
18131920
)
18141921
;
18151922
}
1923+
else
1924+
if
1925+
(
1926+
exp
1927+
.
1928+
hasOwnProperty
1929+
(
1930+
"
1931+
memIndex
1932+
"
1933+
)
1934+
)
1935+
{
1936+
body
1937+
.
1938+
push
1939+
(
1940+
.
1941+
.
1942+
.
1943+
varU32
1944+
(
1945+
MemoryCode
1946+
)
1947+
)
1948+
;
1949+
body
1950+
.
1951+
push
1952+
(
1953+
.
1954+
.
1955+
.
1956+
varU32
1957+
(
1958+
exp
1959+
.
1960+
memIndex
1961+
)
1962+
)
1963+
;
1964+
}
1965+
else
1966+
{
1967+
throw
1968+
"
1969+
Bad
1970+
export
1971+
"
1972+
+
1973+
exp
1974+
;
1975+
}
1976+
}
18161977
return
18171978
{
18181979
name

0 commit comments

Comments
 (0)