mirror of https://github.com/lukechilds/node.git
Browse Source
Before: Bool32x4 {} Float32x4 {} Int32x4 {} // etc. After: Bool32x4 [ false, false, false, false ] Float32x4 [ NaN, NaN, NaN, NaN ] Int32x4 [ 0, 0, 0, 0 ] // etc. PR-URL: https://github.com/nodejs/node/pull/6917 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>v7.x
Ben Noordhuis
9 years ago
2 changed files with 115 additions and 0 deletions
@ -0,0 +1,61 @@ |
|||
// Flags: --harmony_simd
|
|||
'use strict'; |
|||
|
|||
require('../common'); |
|||
const assert = require('assert'); |
|||
const inspect = require('util').inspect; |
|||
|
|||
const SIMD = global.SIMD; // Pacify eslint.
|
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Bool16x8()), |
|||
'Bool16x8 [ false, false, false, false, false, false, false, false ]'); |
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Bool32x4()), |
|||
'Bool32x4 [ false, false, false, false ]'); |
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Bool8x16()), |
|||
'Bool8x16 [\n false,\n false,\n false,\n false,\n false,\n' + |
|||
' false,\n false,\n false,\n false,\n false,\n false,\n' + |
|||
' false,\n false,\n false,\n false,\n false ]'); |
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Bool32x4()), |
|||
'Bool32x4 [ false, false, false, false ]'); |
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Float32x4()), |
|||
'Float32x4 [ NaN, NaN, NaN, NaN ]'); |
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Int16x8()), |
|||
'Int16x8 [ 0, 0, 0, 0, 0, 0, 0, 0 ]'); |
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Int32x4()), |
|||
'Int32x4 [ 0, 0, 0, 0 ]'); |
|||
|
|||
assert.strictEqual( |
|||
inspect(SIMD.Int8x16()), |
|||
'Int8x16 [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]'); |
|||
|
|||
// The SIMD types below are not available in v5.
|
|||
if (typeof SIMD.Uint16x8 === 'function') { |
|||
assert.strictEqual( |
|||
inspect(SIMD.Uint16x8()), |
|||
'Uint16x8 [ 0, 0, 0, 0, 0, 0, 0, 0 ]'); |
|||
} |
|||
|
|||
if (typeof SIMD.Uint32x4 === 'function') { |
|||
assert.strictEqual( |
|||
inspect(SIMD.Uint32x4()), |
|||
'Uint32x4 [ 0, 0, 0, 0 ]'); |
|||
} |
|||
|
|||
if (typeof SIMD.Uint8x16 === 'function') { |
|||
assert.strictEqual( |
|||
inspect(SIMD.Uint8x16()), |
|||
'Uint8x16 [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]'); |
|||
} |
Loading…
Reference in new issue