2
0

testSplat.js 780 B

1234567891011121314151617181920212223242526
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function equal(a, b) {
  6. if (a !== b)
  7. {
  8. print(">> Fail!");
  9. }
  10. }
  11. function testSplat() {
  12. var n = SIMD.Int32x4.splat(3);
  13. equal(3, SIMD.Int32x4.extractLane(n, 0));
  14. equal(3, SIMD.Int32x4.extractLane(n, 1));
  15. equal(3, SIMD.Int32x4.extractLane(n, 2));
  16. equal(3, SIMD.Int32x4.extractLane(n, 3));
  17. }
  18. testSplat();
  19. testSplat();
  20. testSplat();
  21. print("PASS");