Commit Graph

173 Commits

Author SHA1 Message Date
Deepti Gandluri
fff8b5ca1d [wasm-simd] Fix Interpreter BitSelect and Boolean reductions
- Swap BitSelect operand order
 - Simplify, fix bugs for reductions

Bug: v8:8636, v8:8665
Change-Id: I9f43ac8007f9ecb317b1ffa4f99e9c249c58a2dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1534972
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60472}
2019-03-26 18:12:02 +00:00
Bill Budge
aa706218d6 [wasm simd] Make F32x4Min/Max IEEE 754 compliant
- Changes min and max sequences to propagate NaNs and signed
  zeroes.

- Note that NaN propagation must preserve canonical NaNs. This is
  achieved by always returning canonical NaNs. This is also
  consistent with the WebAssembly scalar math spec.

Bug: v8:8639
Change-Id: I04fdefabc54ea60f4d02e2081c32444a02dd6a83
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1524634
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60414}
2019-03-22 18:26:23 +00:00
Bill Budge
43a197f13b [wasm simd] Refactor tests to check results in C++ code.
- Converts most integer vector tests to use globals (except Select)
  so results can be checked in C++ code.
- Remove integer vector result checking macros.
- Add specializations of test CompareOps for floats, so we can use
  BinOps for integer vector compare opcodes.
- Remove Run#format#CompareOpTests helper functions for integer vector
  types. Use Run#BinOpTests helper function instead.

Bug: v8:6020
Change-Id: I968a71c874b028a750e1118cf51f6678cae90091
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1496281
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60111}
2019-03-08 06:18:40 +00:00
Bill Budge
bd15e18905 Reland "[wasm simd] Fix F32x4 Min and Max"
This is a reland of 821bc64951

Original change's description:
> [wasm simd] Fix F32x4 Min and Max
> 
> - Fix F32x4 tests to save results in globals, so they can be checked
>   in C++ code. Perform correct checks in case of NaNs.
> - Fix ia32, x64 implementations of F32x4Min, F32x4Max to correctly
>   deal with NaNs.
> - Enable tests for all float values on all platforms, except skip
>   denormalized results on ARM, and skip extreme values for reciprocal,
>   reciprocal square root approximation opcodes.
> - Disable Min, Max test for interpreter (see v8:8425) since it doesn't
>   handle NaNs correctly.
> - Fix vmin, vmax implementations in ARM simulator.
> 
> Bug: v8:8639
> Change-Id: I87e188e3cb078f09fdacfd9955f426c20a11bf64
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1495897
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60021}

Bug: v8:8639
Change-Id: Ic557aa1d323693eabf5885ff5eddc15e3174079b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1501279
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60109}
2019-03-08 00:38:43 +00:00
Deepti Gandluri
b71325230d Revert "[wasm simd] Fix F32x4 Min and Max"
This reverts commit 821bc64951.

Reason for revert: Fails on ARM hardware :(
https://ci.chromium.org/p/v8/builders/ci/V8%20Arm%20-%20debug/9271

Original change's description:
> [wasm simd] Fix F32x4 Min and Max
> 
> - Fix F32x4 tests to save results in globals, so they can be checked
>   in C++ code. Perform correct checks in case of NaNs.
> - Fix ia32, x64 implementations of F32x4Min, F32x4Max to correctly
>   deal with NaNs.
> - Enable tests for all float values on all platforms, except skip
>   denormalized results on ARM, and skip extreme values for reciprocal,
>   reciprocal square root approximation opcodes.
> - Disable Min, Max test for interpreter (see v8:8425) since it doesn't
>   handle NaNs correctly.
> - Fix vmin, vmax implementations in ARM simulator.
> 
> Bug: v8:8639
> Change-Id: I87e188e3cb078f09fdacfd9955f426c20a11bf64
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1495897
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#60021}

TBR=bbudge@chromium.org,gdeepti@chromium.org

Change-Id: Ib0dc8395ff86263fe0c02faa53d90c7da46b50a6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8639
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1501732
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60022}
2019-03-05 00:56:37 +00:00
Bill Budge
821bc64951 [wasm simd] Fix F32x4 Min and Max
- Fix F32x4 tests to save results in globals, so they can be checked
  in C++ code. Perform correct checks in case of NaNs.
- Fix ia32, x64 implementations of F32x4Min, F32x4Max to correctly
  deal with NaNs.
- Enable tests for all float values on all platforms, except skip
  denormalized results on ARM, and skip extreme values for reciprocal,
  reciprocal square root approximation opcodes.
- Disable Min, Max test for interpreter (see v8:8425) since it doesn't
  handle NaNs correctly.
- Fix vmin, vmax implementations in ARM simulator.

Bug: v8:8639
Change-Id: I87e188e3cb078f09fdacfd9955f426c20a11bf64
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1495897
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60021}
2019-03-04 21:59:54 +00:00
Nico Weber
bff96cef06 v8: Fix -Wextra-semi warnings, enable warning.
For macros expanding to function definitions, I removed the spurious ; after
macro invocations. For macros expandign to function declarations, I made the ;
required and consistently inserted it.

No behavior change.

Bug: chromium:926235
Change-Id: Ib8085d85d913d74307e3481f7fee4b7dc78c7549
Reviewed-on: https://chromium-review.googlesource.com/c/1467545
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59558}
2019-02-13 14:11:28 +00:00
Clemens Hammacher
f0d69fc913 [test] Modernize value helpers
This CL changes the usage pattern from
FOR_XXX_VALUES(i) { Use(*i); }
to
FOR_XXX_VALUES(i) { Use(i); }
which is way more intuitive.

Note that the replacement in the uses was done via regular expression,
so it's purely mechanical. In two locations I removed unneeded braces
around the macro, because they confused clang-format.
I plan to do more cleanups (remove redundant assignments within the
FOR_XXX_VALUES body) in a follow-up CL.

R=mstarzinger@chromium.org

Bug: v8:8562
Change-Id: I4329bfcf34e5b077d19b50f4204ceb3b4340fe61
Reviewed-on: https://chromium-review.googlesource.com/c/1449615
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59287}
2019-02-01 12:56:59 +00:00
Jakob Kummerow
c640296e5a [ubsan] Avoid signed left shifts
The workaround is simple: cast to unsigned before shifting.

Bug: v8:3770
Change-Id: I5f0f7af697ec5db0ab1df3d061008940c83c5c56
Reviewed-on: https://chromium-review.googlesource.com/c/1436215
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59140}
2019-01-28 20:43:47 +00:00
Deepti Gandluri
0f57319ebb [wasm] Reorder SIMD Select parameters to match the Spec
Change-Id: Icad57d5cdae273c0e2cd6c1e441c36908436b704
Bug: v8:8646
Reviewed-on: https://chromium-review.googlesource.com/c/1407179
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58802}
2019-01-14 17:56:15 +00:00
Deepti Gandluri
8468150d35 Reland "[wasm] Fix SIMD boolean reductions on Intel"
This is a reland of 8f83fd0a55

Original change's description:
> [wasm] Fix SIMD boolean reductions on Intel
> 
>  - Both AllTrue/AnyTrue values should return boolean 0/1
>    instead of 0xffffffff to match Spec/Toolchain
>  - Fix AllTrue implementation to be correct
>  - Add unit tests to spot check return values as the
>    cumulative test can coerce some return values to True/False
> 
> Change-Id: I84eb73c915414c9ec290e73f1306404ceff729f0
> Bug: v8:8636
> Reviewed-on: https://chromium-review.googlesource.com/c/1404197
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58715}

Bug: v8:8636
Change-Id: Ifc438d7b64bf5d461cc848851165665104fe57d0
Reviewed-on: https://chromium-review.googlesource.com/c/1405909
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58719}
2019-01-11 01:21:27 +00:00
Michael Achenbach
82e58aaa80 Revert "[wasm] Fix SIMD boolean reductions on Intel"
This reverts commit 8f83fd0a55.

Reason for revert: Seems to break older intel chips:
https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20debug/23954

Original change's description:
> [wasm] Fix SIMD boolean reductions on Intel
> 
>  - Both AllTrue/AnyTrue values should return boolean 0/1
>    instead of 0xffffffff to match Spec/Toolchain
>  - Fix AllTrue implementation to be correct
>  - Add unit tests to spot check return values as the
>    cumulative test can coerce some return values to True/False
> 
> Change-Id: I84eb73c915414c9ec290e73f1306404ceff729f0
> Bug: v8:8636
> Reviewed-on: https://chromium-review.googlesource.com/c/1404197
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58715}

TBR=bbudge@chromium.org,gdeepti@chromium.org

Change-Id: I0eba24e0fe5215c1f8f377776692db245239e134
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8636
Reviewed-on: https://chromium-review.googlesource.com/c/1405321
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58716}
2019-01-10 20:18:12 +00:00
Deepti Gandluri
8f83fd0a55 [wasm] Fix SIMD boolean reductions on Intel
- Both AllTrue/AnyTrue values should return boolean 0/1
   instead of 0xffffffff to match Spec/Toolchain
 - Fix AllTrue implementation to be correct
 - Add unit tests to spot check return values as the
   cumulative test can coerce some return values to True/False

Change-Id: I84eb73c915414c9ec290e73f1306404ceff729f0
Bug: v8:8636
Reviewed-on: https://chromium-review.googlesource.com/c/1404197
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58715}
2019-01-10 19:11:35 +00:00
Jakob Kummerow
40ac5a39fc [ubsan] Fix numerical overflows in wasm
Mostly signed integer overflows, and a few cases of double
division by zero (which is defined by IEEE-754 to return
Infinity (or NaN for 0/0) but is UB in C++).

Bug: v8:3770
Change-Id: Id92725b0ac57cb357978124a3dc6f477430bc97d
Reviewed-on: https://chromium-review.googlesource.com/c/1403133
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58696}
2019-01-10 12:24:51 +00:00
Deepti Gandluri
f8e2634e96 [wasm] Add SIMD Shuffles for x64
Change-Id: I241565dea56db982a46eed8ecdd2fd2692c368ce
Reviewed-on: https://chromium-review.googlesource.com/c/1395800
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58648}
2019-01-08 21:46:39 +00:00
Deepti Gandluri
aba38b3c35 [wasm] Update SIMD opcodes to match toolchain/spec
BUG:v8:6020

Change-Id: I289a43d834765635425276afb80c2361152fdcb0
Reviewed-on: https://chromium-review.googlesource.com/c/1336113
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57519}
2018-11-15 06:28:55 +00:00
Deepti Gandluri
4f6ba3852b Reland "[wasm-simd] Implement remaining I8x16 SIMD ops on x64"
This is a reland of de88bfb270

Original change's description:
> [wasm-simd] Implement remaining I8x16 SIMD ops on x64
> 
>  - Implementation for I8x16 Shifts, and Mul
>  - Fix convert bug
>  - Enable all tests except for shuffle tests
> 
> Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
> Reviewed-on: https://chromium-review.googlesource.com/c/1318609
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57254}

Change-Id: Id2f6eef3a07e40df37af29456116754e7cf5b901
Reviewed-on: https://chromium-review.googlesource.com/c/1320031
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57326}
2018-11-07 18:42:23 +00:00
Deepti Gandluri
bdb9e7a517 Revert "[wasm-simd] Implement remaining I8x16 SIMD ops on x64"
This reverts commit de88bfb270.

Reason for revert: Breaks msvc build https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Win64%20-%20msvc/5765

Original change's description:
> [wasm-simd] Implement remaining I8x16 SIMD ops on x64
> 
>  - Implementation for I8x16 Shifts, and Mul
>  - Fix convert bug
>  - Enable all tests except for shuffle tests
> 
> Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
> Reviewed-on: https://chromium-review.googlesource.com/c/1318609
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57254}

TBR=bbudge@chromium.org,gdeepti@chromium.org

Change-Id: I09efd8002e27f457e89250336e6c3a12d8d9682c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1318097
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57257}
2018-11-06 00:02:03 +00:00
Deepti Gandluri
de88bfb270 [wasm-simd] Implement remaining I8x16 SIMD ops on x64
- Implementation for I8x16 Shifts, and Mul
 - Fix convert bug
 - Enable all tests except for shuffle tests

Change-Id: Id1a469d2883c30ea782c51d21dc462d211f94420
Reviewed-on: https://chromium-review.googlesource.com/c/1318609
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57254}
2018-11-05 23:30:16 +00:00
Deepti Gandluri
caf93c9f6f [x64] Wasm SIMD x64 Conversion, AllTrue/AnyTrue operations
This CL mirrors the ia32 SIMD conversion, Alltrue/AnyTrue operations
with minor cleanliness changes to use TempRegisters instead of
ScratchRegisters

Change-Id: I84d3e148200dd611a72380b24404b75c73c5352d
Reviewed-on: https://chromium-review.googlesource.com/1174096
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56297}
2018-09-28 23:38:50 +00:00
Ben L. Titzer
3d35921eb3 [wasm] Unify all enums representing execution tiers
R=mstarzinger@chromium.org

Change-Id: Iacdff28dd1383d77d7708de4ee22d9f2a77d872a
Reviewed-on: https://chromium-review.googlesource.com/1183440
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55284}
2018-08-21 15:45:18 +00:00
Ivica Bogosavljevic
91bd6a5dda [wasm] Implement SIMD big-endian support
This CL implements several things needed for full SIMD BE support in WASM:
* Global variables are now kept in little-endian order as per specification
* Added support for SIMD on BE in wasm interpreter
* Fixed several tests that didn't work on BE because input or output
  data were not using LE in-memory layout

Change-Id: I4542d13d09fd276e15b0fc39f02e4a58831f65e4
Reviewed-on: https://chromium-review.googlesource.com/1160484
Commit-Queue: Ivica Bogosavljevic <ibogosavljevic@wavecomp.com>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55075}
2018-08-13 08:58:39 +00:00
Bill Budge
d950fc4705 [wasm simd] Fuzz test the shuffle opcode
- Reorganizes shuffle tests into tabular form.
- Adds a test that composes random numbers of random shuffles to
  make new shuffles.
- Adds a test that generates functions to compute a complex expression
  consisting of shuffles, and compares interpreter results to compiled
  code results.
- Fixes a problem with temp register exhaustion on ARM 32-bit.
- Matches identity shuffles (returning first or second operand
  unchanged) and uses EmitIdentity() for these.

Bug: v8:6020
Change-Id: Ie41c14fee52a7406b1d32e731e050096400e12f5
Reviewed-on: https://chromium-review.googlesource.com/1119567
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54446}
2018-07-13 21:51:47 +00:00
jing.bao
054dd559ac [ia32][wasm] Add I32x4SConvertF32x4, I32x4UConvertF32x4
Change-Id: Ic2c4f02d5e451c4a3a6612ae91e5cc8231d62448
Reviewed-on: https://chromium-review.googlesource.com/1119773
Commit-Queue: Jing Bao <jing.bao@intel.com>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54307}
2018-07-09 01:05:59 +00:00
Bill Budge
acf2d122dd [wasm simd] Improve code generation for I8x16 Shifts
- Eliminates I8x16SPLAT macro. This generates:

  push eax
  mov  eax, #imm32
  movd xmmDest, eax
  pxor xmmScratch, xmmScratch
  pshufb xmmDest, xmmScratch
  pop eax

- Uses smaller sequence for I8x16Shl and I8x16ShrU that doesn't
  require a temp register.
- Uses punpckbw, psraw, packsswb sequence for I8x16ShrS.

Bug: v8:6020
Change-Id: I1dc4ecaba43b150a3412e9083fe930868d9e5d5d
Reviewed-on: https://chromium-review.googlesource.com/1121045
Reviewed-by: Jing Bao <jing.bao@intel.com>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54300}
2018-07-06 16:21:57 +00:00
Aseem Garg
d3fe5ac7c3 [wasm] add simd horiz and reduce to interpreter
This CL adds simd select, addHoriz, shuffle, anyTrue and all true to the
interpreter. It also gets rid of SIMD_COMPILED_AND_LOWERED_TEST and
SIMD_COMPILED_TEST macros.

R=gdeepti@chromium.org
BUG=v8:6020

Change-Id: I44abbcaddc3223a95c79ccc65ae9c6bf1a911c5d
Reviewed-on: https://chromium-review.googlesource.com/1119258
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54116}
2018-06-29 20:13:50 +00:00
jing.bao
65bcf6c287 [ia32][wasm] Add unpacking integer conversions
I32x4U/SConvertI16x8Low/High, I16x8U/SConvertI8x16Low/High

Add pmovsxbw/wd, pmovzxbw/wd and AVX version
Add Palignr, Pmovsxbw/wd, Pmovzxbw/wd macro.
Reconstruct ptest/vptest, Ptest using macro

Change-Id: I4a26b3bb6d5791f72e3192c914758287701e78a0
Reviewed-on: https://chromium-review.googlesource.com/1111691
Commit-Queue: Jing Bao <jing.bao@intel.com>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53990}
2018-06-25 04:25:24 +00:00
Bill Budge
51ded9a743 [wasm simd] Handle more shuffles
- Handles zip, unzip, and transpose shuffles/swizzles.
- Adds punpck* instructions to assembler.

Bug: v8:6020
Change-Id: If124b7a7462ffd0470347b54ce4a93c01667e384
Reviewed-on: https://chromium-review.googlesource.com/1084069
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53947}
2018-06-21 17:17:37 +00:00
Aseem Garg
618bc445fe [wasm] add simd convert and pack to interpreter
R=gdeepti@chromium.org
BUG=v8:6020

Change-Id: Ibdeb926ef3e2884b9a3f0831e9482ebe2da227ac
Reviewed-on: https://chromium-review.googlesource.com/1105464
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53898}
2018-06-20 21:26:16 +00:00
Aseem Garg
0091973e82 Reland "[wasm] Add simd mem and shift ops to interpreter"
This is a reland of 2338a2fd63

Original change's description:
> [wasm] Add simd mem and shift ops to interpreter
>
> R=clemensh@chromium.org
> BUG=v8:6020
>
> Change-Id: I5d95e4c23240ae4e174d896d31e1b9b1d89d9418
> Reviewed-on: https://chromium-review.googlesource.com/1096493
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53717}

Bug: v8:6020
Change-Id: I38a73f5e389617a05a12e0a9477544c4e3aa2883
Reviewed-on: https://chromium-review.googlesource.com/1099895
Reviewed-by: Ben Smith <binji@chromium.org>
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53722}
2018-06-13 22:03:46 +00:00
Sathya Gunasekaran
76cc2ad07e Revert "[wasm] Add simd mem and shift ops to interpreter"
This reverts commit 2338a2fd63.

Reason for revert: broke mips

see https://ci.chromium.org/buildbot/client.v8.ports/V8%20Mips%20-%20builder/17573

Original change's description:
> [wasm] Add simd mem and shift ops to interpreter
> 
> R=​clemensh@chromium.org
> BUG=v8:6020
> 
> Change-Id: I5d95e4c23240ae4e174d896d31e1b9b1d89d9418
> Reviewed-on: https://chromium-review.googlesource.com/1096493
> Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
> Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#53717}

TBR=aseemgarg@chromium.org,clemensh@chromium.org

Change-Id: I8e5b2e9a9c1c09d035335ba6681bbe3e1ce5abfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6020
Reviewed-on: https://chromium-review.googlesource.com/1099776
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53718}
2018-06-13 21:10:18 +00:00
Aseem Garg
2338a2fd63 [wasm] Add simd mem and shift ops to interpreter
R=clemensh@chromium.org
BUG=v8:6020

Change-Id: I5d95e4c23240ae4e174d896d31e1b9b1d89d9418
Reviewed-on: https://chromium-review.googlesource.com/1096493
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53717}
2018-06-13 19:42:03 +00:00
jing.bao
d4f7d87bdf [wasm] Improve unpacking operations in simd lowering
Add explicit lowered type.
Distinguish operations for low/high.
Shl + Shr is equal to Mask.
Enable WASM_SIMD_COMPILED_AND_LOWERED_TEST for unpacking.

Change-Id: I0492318deb7c0ea0f4b30975ab107eedd446314a
Reviewed-on: https://chromium-review.googlesource.com/1079989
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#53654}
2018-06-12 03:33:12 +00:00
Bill Budge
bcb4fbd4ad [wasm simd] Handle more shuffles
- Shuffle canonicalization improved to reverse operands to match
  more architectural shuffles.
- Handles shuffles where the order of operands is reversed.
- Adds tests for non-canonical shuffles, and for swizzles.
- Improves TryMatchConcat method.
- Substantially rewrites shuffles on ia32 to better handle swizzles
  and fix bugs on reversed shuffles where source registers are
  overwritten.
- Adds Palignr macro-assembler instructions for ia32.

Bug: v8:6020
Change-Id: I8e43a1e7650057c66690af1504b67509a1437d75
Reviewed-on: https://chromium-review.googlesource.com/1070934
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: Martyn Capewell <martyn.capewell@arm.com>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53648}
2018-06-11 18:40:24 +00:00
Aseem Garg
dc6819ec56 [wasm] Add simd replaceLane ops to wasm interpreter
Also enables tests for globals and mixed type use

R=gdeepti@chromium.org,bbudge@chromium.org,clemensh@chromium.org,titzer@chromium.org
BUG=v8:6020

Change-Id: I828f1628a1c27d9f07ba3a830600f81c5a404b2d
Reviewed-on: https://chromium-review.googlesource.com/1080340
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53477}
2018-06-01 21:50:35 +00:00
Bill Budge
1ae84e18d7 [wasm] Handle special case 32x4 and 16x8 shuffles on ia32
- Adds v/pshufhw, v/palignr instructions to assembler and
  macro-assembler.
- Uses better instruction sequences for 32x4 shuffles using half-
  shuffles and blends.
- Uses better instruction sequences for 16x8 shuffles.
- Uses better instruction sequences for concatenating 8x16 shuffles.

Change-Id: I3e6dca2937a2b167c754c47331c3a2f8ab9786db
Reviewed-on: https://chromium-review.googlesource.com/1066986
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53460}
2018-05-31 17:29:27 +00:00
Aseem Garg
f22991ab40 [wasm] Add simd compare ops to wasm interpreter
R=gdeepti@chromium.org,bbudge@chromium.org,clemensh@chromium.org,titzer@chromium.org
BUG=v8:6020

Change-Id: I9d307a70d44504dc0e84e3e09d48bcc9b9542462
Reviewed-on: https://chromium-review.googlesource.com/1071095
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53375}
2018-05-25 22:29:34 +00:00
Aseem Garg
bedcef5cd0 [wasm] Add simd unops to wasm interpreter
R=gdeepti@chromium.org,bbudge@chromium.org,clemensh@chromium.org,titzer@chromium.org
BUG=v8:6020

Change-Id: Ibc4e45df65ad8fc649e42b2166545cbc5fcb4296
Reviewed-on: https://chromium-review.googlesource.com/1070933
Reviewed-by: Ben Titzer <titzer@chromium.org>
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53346}
2018-05-24 19:01:32 +00:00
Aseem Garg
7b3089c0de [wasm] Add simd binops to wasm interpreter
R=gdeepti@chromium.org,bbudge@chromium.org,clemensh@chromium.org,titzer@chromium.org
BUG=v8:6020

Change-Id: I671d74b49206a3612764c7b9cb63591e7e81e857
Reviewed-on: https://chromium-review.googlesource.com/1069933
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53316}
2018-05-23 22:56:36 +00:00
Aseem Garg
eff265415a [wasm] Add simd splat to wasm interpreter
R=gdeepti@chromium.org,bbudge@chromium.org,clemensh@chromium.org,titzer@chromium.org
BUG=v8:6020

Change-Id: I25676d4f8a7ea7b1e02a54abe009faec0eb2c6db
Reviewed-on: https://chromium-review.googlesource.com/1018840
Commit-Queue: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53266}
2018-05-18 22:30:10 +00:00
jing.bao
d997955cf7 [ia32][wasm] Add packing integer conversions
I16x8SConvertI32x4, I16x8UConvertI32x4,
I8x16SConvertI16x8, I8x16UConvertI16x8

Add packsswb/packssdw/packuswb/packusdw

Change-Id: Ibb661a20fa032d732fec20b3d48190f44d2d4bd4
Reviewed-on: https://chromium-review.googlesource.com/1027123
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#52870}
2018-04-28 02:01:46 +00:00
Deepti Gandluri
9186e770c6 [wasm] Fix SIMD/Atomics tests to use page-sized memory
Bug: v8:7704, v8:7570
Change-Id: I3543e101ba41b88710e4f5942929e4e128ef2a78
Reviewed-on: https://chromium-review.googlesource.com/1033356
Reviewed-by: Eric Holk <eholk@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52867}
2018-04-27 20:39:48 +00:00
Clemens Hammacher
8466b71ad8 [wasm] Split off wasm-linkage.h
Linkage-related methods were declared in wasm-compiler.h and
implemented in wasm-linkage.cc. This required all users of e.g. wasm
call descriptors to include the whole wasm compiler header. Also, some
wasm linkage information is independent of turbofan and also used
outside of the compiler directory.

This CL splits off wasm-linkage.h (with minimal includes) and puts it
in src/wasm. This allows to use that information without including
compiler headers (will clean up several uses in follow-up CLs).

R=mstarzinger@chromium.org, titzer@chromium.org

Bug: v8:7570
Change-Id: Ifcae70b4ea7932cda30953b325c2b87c4176c598
Reviewed-on: https://chromium-review.googlesource.com/1013701
Reviewed-by: Ben Titzer <titzer@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52849}
2018-04-27 13:43:49 +00:00
jing.bao
2aa995bf9b [wasm]implement simd lowering for packing integer conversions
I16x8SConvertI32x4, I16x8UConvertI32x4,
I8x16SConvertI16x8, I8x16UConvertI16x8

Change-Id: Iab462c3fb6c60de7b54a925e438862362605fe8d
Reviewed-on: https://chromium-review.googlesource.com/1016178
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#52771}
2018-04-25 02:16:48 +00:00
jing.bao
87d8895494 [ia32][wasm] Add AnyTrue and AllTrue.
Complete ptest and add vptest
Add Pcmpeqb, Pcmpeqw, Ptest macro

Change-Id: I060aa5228d50f2dca7ed3e24324a08c04ec1a028
Reviewed-on: https://chromium-review.googlesource.com/1013236
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#52687}
2018-04-19 13:24:01 +00:00
Jakob Kummerow
f7d6b19f6c [ubsan] Fix many static_cast<int32_t> with undefined behavior
Casting from a floating-point type to an integer type is undefined behavior
if the integral part of the float cannot be represented in the range of the
int.

Bug: v8:3770, chromium:831145
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I2e85ea8b0f09bbeeb3e0dcc1135fc747fa312f6d
Reviewed-on: https://chromium-review.googlesource.com/1011651
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52631}
2018-04-17 02:02:18 +00:00
Vincent Belliard
abfcc1124c [arm64][Liftoff] Start Liftoff implementation.
First version which can compile a very basic code.

Change-Id: I3b98412a5ca39a28f8fe5b60516b82c6981dd187
Reviewed-on: https://chromium-review.googlesource.com/993232
Commit-Queue: Vincent Belliard <vincent.belliard@arm.com>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52622}
2018-04-16 16:16:47 +00:00
jing.bao
820755e804 [wasm] implement simd lowering for AllTrue/AnyTrue
Change-Id: I7749eae88e4a23d8fe2422e28b8dbcbbfb11f758
Reviewed-on: https://chromium-review.googlesource.com/991733
Reviewed-by: Aseem Garg <aseemgarg@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#52585}
2018-04-13 02:11:38 +00:00
jing.bao
104e9b1db1 Reland "[ia32][wasm] Add F32x4AddHoriz, I32x4AddHoriz and I16x8AddHoriz"
Change-Id: I6f6c12c2a711a6089e625dd9912a4b3a887df447
Reviewed-on: https://chromium-review.googlesource.com/1002875
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#52498}
2018-04-10 01:53:37 +00:00
jing.bao
f0f2234161 [ia32][wasm] Add F32x4 RecipApprox/RecipSqrtApprox.
Add Rcpps and Rsqrtps macros.
Rename SIMD_UNOP macros.

Change-Id: I7e9418a835f085cc0fdd31fc3815c17c8f413b67
Reviewed-on: https://chromium-review.googlesource.com/982575
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#52291}
2018-03-29 01:19:56 +00:00