| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function(global, utils) { | 5 (function(global, utils) { |
| 6 | 6 |
| 7 "use strict"; | 7 "use strict"; |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 return %NAMELessThanOrEqual(a, b); | 188 return %NAMELessThanOrEqual(a, b); |
| 189 } | 189 } |
| 190 | 190 |
| 191 function NAMEGreaterThanJS(a, b) { | 191 function NAMEGreaterThanJS(a, b) { |
| 192 return %NAMEGreaterThan(a, b); | 192 return %NAMEGreaterThan(a, b); |
| 193 } | 193 } |
| 194 | 194 |
| 195 function NAMEGreaterThanOrEqualJS(a, b) { | 195 function NAMEGreaterThanOrEqualJS(a, b) { |
| 196 return %NAMEGreaterThanOrEqual(a, b); | 196 return %NAMEGreaterThanOrEqual(a, b); |
| 197 } | 197 } |
| 198 |
| 199 function NAMELoadJS(tarray, index) { |
| 200 return %NAMELoad(tarray, index); |
| 201 } |
| 198 endmacro | 202 endmacro |
| 199 | 203 |
| 200 SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS) | 204 SIMD_NUMERIC_TYPES(DECLARE_NUMERIC_FUNCTIONS) |
| 201 | 205 |
| 202 macro SIMD_LOGICAL_TYPES(FUNCTION) | 206 macro SIMD_LOGICAL_TYPES(FUNCTION) |
| 203 SIMD_INT_TYPES(FUNCTION) | 207 SIMD_INT_TYPES(FUNCTION) |
| 204 SIMD_BOOL_TYPES(FUNCTION) | 208 SIMD_BOOL_TYPES(FUNCTION) |
| 205 endmacro | 209 endmacro |
| 206 | 210 |
| 207 macro DECLARE_LOGICAL_FUNCTIONS(NAME, TYPE, LANES) | 211 macro DECLARE_LOGICAL_FUNCTIONS(NAME, TYPE, LANES) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 endmacro | 257 endmacro |
| 254 | 258 |
| 255 macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM) | 259 macro DECLARE_FROM_BITS_FUNCTIONS(TO, FROM) |
| 256 function TOFromFROMBitsJS(a) { | 260 function TOFromFROMBitsJS(a) { |
| 257 return %TOFromFROMBits(a); | 261 return %TOFromFROMBits(a); |
| 258 } | 262 } |
| 259 endmacro | 263 endmacro |
| 260 | 264 |
| 261 SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS) | 265 SIMD_FROM_BITS_TYPES(DECLARE_FROM_BITS_FUNCTIONS) |
| 262 | 266 |
| 267 |
| 268 macro SIMD_LOADN_STOREN_TYPES(FUNCTION) |
| 269 FUNCTION(Float32x4, 1) |
| 270 FUNCTION(Float32x4, 2) |
| 271 FUNCTION(Float32x4, 3) |
| 272 FUNCTION(Int32x4, 1) |
| 273 FUNCTION(Int32x4, 2) |
| 274 FUNCTION(Int32x4, 3) |
| 275 endmacro |
| 276 |
| 277 macro DECLARE_LOADN_STOREN_FUNCTIONS(NAME, COUNT) |
| 278 function NAMELoadCOUNTJS(tarray, index) { |
| 279 return %NAMELoadCOUNT(tarray, index); |
| 280 } |
| 281 endmacro |
| 282 |
| 283 SIMD_LOADN_STOREN_TYPES(DECLARE_LOADN_STOREN_FUNCTIONS) |
| 284 |
| 263 //------------------------------------------------------------------- | 285 //------------------------------------------------------------------- |
| 264 | 286 |
| 265 function Float32x4Constructor(c0, c1, c2, c3) { | 287 function Float32x4Constructor(c0, c1, c2, c3) { |
| 266 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); | 288 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); |
| 267 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), | 289 return %CreateFloat32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), |
| 268 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); | 290 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); |
| 269 } | 291 } |
| 270 | 292 |
| 271 | 293 |
| 272 function Float32x4Splat(s) { | 294 function Float32x4Splat(s) { |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, | 532 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, |
| 511 'equal', Float32x4EqualJS, | 533 'equal', Float32x4EqualJS, |
| 512 'notEqual', Float32x4NotEqualJS, | 534 'notEqual', Float32x4NotEqualJS, |
| 513 'select', Float32x4SelectJS, | 535 'select', Float32x4SelectJS, |
| 514 'swizzle', Float32x4SwizzleJS, | 536 'swizzle', Float32x4SwizzleJS, |
| 515 'shuffle', Float32x4ShuffleJS, | 537 'shuffle', Float32x4ShuffleJS, |
| 516 'fromInt32x4', Float32x4FromInt32x4JS, | 538 'fromInt32x4', Float32x4FromInt32x4JS, |
| 517 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, | 539 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, |
| 518 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, | 540 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, |
| 519 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, | 541 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, |
| 542 'load', Float32x4LoadJS, |
| 543 'load1', Float32x4Load1JS, |
| 544 'load2', Float32x4Load2JS, |
| 545 'load3', Float32x4Load3JS, |
| 520 ]); | 546 ]); |
| 521 | 547 |
| 522 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ | 548 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ |
| 523 'splat', Int32x4Splat, | 549 'splat', Int32x4Splat, |
| 524 'check', Int32x4CheckJS, | 550 'check', Int32x4CheckJS, |
| 525 'extractLane', Int32x4ExtractLaneJS, | 551 'extractLane', Int32x4ExtractLaneJS, |
| 526 'replaceLane', Int32x4ReplaceLaneJS, | 552 'replaceLane', Int32x4ReplaceLaneJS, |
| 527 'neg', Int32x4NegJS, | 553 'neg', Int32x4NegJS, |
| 528 'add', Int32x4AddJS, | 554 'add', Int32x4AddJS, |
| 529 'sub', Int32x4SubJS, | 555 'sub', Int32x4SubJS, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 543 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, | 569 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, |
| 544 'equal', Int32x4EqualJS, | 570 'equal', Int32x4EqualJS, |
| 545 'notEqual', Int32x4NotEqualJS, | 571 'notEqual', Int32x4NotEqualJS, |
| 546 'select', Int32x4SelectJS, | 572 'select', Int32x4SelectJS, |
| 547 'swizzle', Int32x4SwizzleJS, | 573 'swizzle', Int32x4SwizzleJS, |
| 548 'shuffle', Int32x4ShuffleJS, | 574 'shuffle', Int32x4ShuffleJS, |
| 549 'fromFloat32x4', Int32x4FromFloat32x4JS, | 575 'fromFloat32x4', Int32x4FromFloat32x4JS, |
| 550 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, | 576 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, |
| 551 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, | 577 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, |
| 552 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, | 578 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, |
| 579 'load', Int32x4LoadJS, |
| 580 'load1', Int32x4Load1JS, |
| 581 'load2', Int32x4Load2JS, |
| 582 'load3', Int32x4Load3JS, |
| 553 ]); | 583 ]); |
| 554 | 584 |
| 555 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ | 585 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ |
| 556 'splat', Bool32x4Splat, | 586 'splat', Bool32x4Splat, |
| 557 'check', Bool32x4CheckJS, | 587 'check', Bool32x4CheckJS, |
| 558 'extractLane', Bool32x4ExtractLaneJS, | 588 'extractLane', Bool32x4ExtractLaneJS, |
| 559 'replaceLane', Bool32x4ReplaceLaneJS, | 589 'replaceLane', Bool32x4ReplaceLaneJS, |
| 560 'and', Bool32x4AndJS, | 590 'and', Bool32x4AndJS, |
| 561 'or', Bool32x4OrJS, | 591 'or', Bool32x4OrJS, |
| 562 'xor', Bool32x4XorJS, | 592 'xor', Bool32x4XorJS, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 593 'greaterThan', Int16x8GreaterThanJS, | 623 'greaterThan', Int16x8GreaterThanJS, |
| 594 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, | 624 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, |
| 595 'equal', Int16x8EqualJS, | 625 'equal', Int16x8EqualJS, |
| 596 'notEqual', Int16x8NotEqualJS, | 626 'notEqual', Int16x8NotEqualJS, |
| 597 'select', Int16x8SelectJS, | 627 'select', Int16x8SelectJS, |
| 598 'swizzle', Int16x8SwizzleJS, | 628 'swizzle', Int16x8SwizzleJS, |
| 599 'shuffle', Int16x8ShuffleJS, | 629 'shuffle', Int16x8ShuffleJS, |
| 600 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, | 630 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, |
| 601 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, | 631 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, |
| 602 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, | 632 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, |
| 633 'load', Int16x8LoadJS, |
| 603 ]); | 634 ]); |
| 604 | 635 |
| 605 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ | 636 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ |
| 606 'splat', Bool16x8Splat, | 637 'splat', Bool16x8Splat, |
| 607 'check', Bool16x8CheckJS, | 638 'check', Bool16x8CheckJS, |
| 608 'extractLane', Bool16x8ExtractLaneJS, | 639 'extractLane', Bool16x8ExtractLaneJS, |
| 609 'replaceLane', Bool16x8ReplaceLaneJS, | 640 'replaceLane', Bool16x8ReplaceLaneJS, |
| 610 'and', Bool16x8AndJS, | 641 'and', Bool16x8AndJS, |
| 611 'or', Bool16x8OrJS, | 642 'or', Bool16x8OrJS, |
| 612 'xor', Bool16x8XorJS, | 643 'xor', Bool16x8XorJS, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 643 'greaterThan', Int8x16GreaterThanJS, | 674 'greaterThan', Int8x16GreaterThanJS, |
| 644 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, | 675 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, |
| 645 'equal', Int8x16EqualJS, | 676 'equal', Int8x16EqualJS, |
| 646 'notEqual', Int8x16NotEqualJS, | 677 'notEqual', Int8x16NotEqualJS, |
| 647 'select', Int8x16SelectJS, | 678 'select', Int8x16SelectJS, |
| 648 'swizzle', Int8x16SwizzleJS, | 679 'swizzle', Int8x16SwizzleJS, |
| 649 'shuffle', Int8x16ShuffleJS, | 680 'shuffle', Int8x16ShuffleJS, |
| 650 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, | 681 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, |
| 651 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, | 682 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, |
| 652 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, | 683 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, |
| 684 'load', Int8x16LoadJS, |
| 653 ]); | 685 ]); |
| 654 | 686 |
| 655 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ | 687 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ |
| 656 'splat', Bool8x16Splat, | 688 'splat', Bool8x16Splat, |
| 657 'check', Bool8x16CheckJS, | 689 'check', Bool8x16CheckJS, |
| 658 'extractLane', Bool8x16ExtractLaneJS, | 690 'extractLane', Bool8x16ExtractLaneJS, |
| 659 'replaceLane', Bool8x16ReplaceLaneJS, | 691 'replaceLane', Bool8x16ReplaceLaneJS, |
| 660 'and', Bool8x16AndJS, | 692 'and', Bool8x16AndJS, |
| 661 'or', Bool8x16OrJS, | 693 'or', Bool8x16OrJS, |
| 662 'xor', Bool8x16XorJS, | 694 'xor', Bool8x16XorJS, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 673 to.Float32x4ToString = Float32x4ToString; | 705 to.Float32x4ToString = Float32x4ToString; |
| 674 to.Int32x4ToString = Int32x4ToString; | 706 to.Int32x4ToString = Int32x4ToString; |
| 675 to.Bool32x4ToString = Bool32x4ToString; | 707 to.Bool32x4ToString = Bool32x4ToString; |
| 676 to.Int16x8ToString = Int16x8ToString; | 708 to.Int16x8ToString = Int16x8ToString; |
| 677 to.Bool16x8ToString = Bool16x8ToString; | 709 to.Bool16x8ToString = Bool16x8ToString; |
| 678 to.Int8x16ToString = Int8x16ToString; | 710 to.Int8x16ToString = Int8x16ToString; |
| 679 to.Bool8x16ToString = Bool8x16ToString; | 711 to.Bool8x16ToString = Bool8x16ToString; |
| 680 }); | 712 }); |
| 681 | 713 |
| 682 }) | 714 }) |
| OLD | NEW |