Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: src/harmony-simd.js

Issue 1302133002: [simd.js] Add SIMD load functions for Phase 1. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Bill's comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | src/runtime/runtime-simd.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 function Float32x4SwizzleJS(a, c0, c1, c2, c3) { 316 function Float32x4SwizzleJS(a, c0, c1, c2, c3) {
313 return %Float32x4Swizzle(a, c0, c1, c2, c3); 317 return %Float32x4Swizzle(a, c0, c1, c2, c3);
314 } 318 }
315 319
316 320
317 function Float32x4ShuffleJS(a, b, c0, c1, c2, c3) { 321 function Float32x4ShuffleJS(a, b, c0, c1, c2, c3) {
318 return %Float32x4Shuffle(a, b, c0, c1, c2, c3); 322 return %Float32x4Shuffle(a, b, c0, c1, c2, c3);
319 } 323 }
320 324
321 325
326 function Float32x4Load1JS(tarray, index) {
327 return %Float32x4Load1(tarray, index);
328 }
bbudge 2015/08/20 23:05:25 You should be able to "macroize" these too. Parame
gdeepti 2015/08/21 21:07:50 Done.
329
330
331 function Float32x4Load2JS(tarray, index) {
332 return %Float32x4Load2(tarray, index);
333 }
334
335
336 function Float32x4Load3JS(tarray, index) {
337 return %Float32x4Load3(tarray, index);
338 }
339
340
322 function Int32x4Constructor(c0, c1, c2, c3) { 341 function Int32x4Constructor(c0, c1, c2, c3) {
323 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); 342 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4");
324 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1), 343 return %CreateInt32x4(TO_NUMBER_INLINE(c0), TO_NUMBER_INLINE(c1),
325 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3)); 344 TO_NUMBER_INLINE(c2), TO_NUMBER_INLINE(c3));
326 } 345 }
327 346
328 347
329 function Int32x4Splat(s) { 348 function Int32x4Splat(s) {
330 return %CreateInt32x4(s, s, s, s); 349 return %CreateInt32x4(s, s, s, s);
331 } 350 }
332 351
333 352
334 function Int32x4SwizzleJS(a, c0, c1, c2, c3) { 353 function Int32x4SwizzleJS(a, c0, c1, c2, c3) {
335 return %Int32x4Swizzle(a, c0, c1, c2, c3); 354 return %Int32x4Swizzle(a, c0, c1, c2, c3);
336 } 355 }
337 356
338 357
339 function Int32x4ShuffleJS(a, b, c0, c1, c2, c3) { 358 function Int32x4ShuffleJS(a, b, c0, c1, c2, c3) {
340 return %Int32x4Shuffle(a, b, c0, c1, c2, c3); 359 return %Int32x4Shuffle(a, b, c0, c1, c2, c3);
341 } 360 }
342 361
343 362
363 function Int32x4Load1JS(tarray, index) {
364 return %Int32x4Load1(tarray, index);
365 }
366
367
368 function Int32x4Load2JS(tarray, index) {
369 return %Int32x4Load2(tarray, index);
370 }
371
372
373 function Int32x4Load3JS(tarray, index) {
374 return %Int32x4Load3(tarray, index);
375 }
376
377
344 function Bool32x4Constructor(c0, c1, c2, c3) { 378 function Bool32x4Constructor(c0, c1, c2, c3) {
345 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); 379 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4");
346 return %CreateBool32x4(c0, c1, c2, c3); 380 return %CreateBool32x4(c0, c1, c2, c3);
347 } 381 }
348 382
349 383
350 function Bool32x4Splat(s) { 384 function Bool32x4Splat(s) {
351 return %CreateBool32x4(s, s, s, s); 385 return %CreateBool32x4(s, s, s, s);
352 } 386 }
353 387
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS, 544 'greaterThanOrEqual', Float32x4GreaterThanOrEqualJS,
511 'equal', Float32x4EqualJS, 545 'equal', Float32x4EqualJS,
512 'notEqual', Float32x4NotEqualJS, 546 'notEqual', Float32x4NotEqualJS,
513 'select', Float32x4SelectJS, 547 'select', Float32x4SelectJS,
514 'swizzle', Float32x4SwizzleJS, 548 'swizzle', Float32x4SwizzleJS,
515 'shuffle', Float32x4ShuffleJS, 549 'shuffle', Float32x4ShuffleJS,
516 'fromInt32x4', Float32x4FromInt32x4JS, 550 'fromInt32x4', Float32x4FromInt32x4JS,
517 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS, 551 'fromInt32x4Bits', Float32x4FromInt32x4BitsJS,
518 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS, 552 'fromInt16x8Bits', Float32x4FromInt16x8BitsJS,
519 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS, 553 'fromInt8x16Bits', Float32x4FromInt8x16BitsJS,
554 'load', Float32x4LoadJS,
555 'load1', Float32x4Load1JS,
556 'load2', Float32x4Load2JS,
557 'load3', Float32x4Load3JS,
520 ]); 558 ]);
521 559
522 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [ 560 utils.InstallFunctions(GlobalInt32x4, DONT_ENUM, [
523 'splat', Int32x4Splat, 561 'splat', Int32x4Splat,
524 'check', Int32x4CheckJS, 562 'check', Int32x4CheckJS,
525 'extractLane', Int32x4ExtractLaneJS, 563 'extractLane', Int32x4ExtractLaneJS,
526 'replaceLane', Int32x4ReplaceLaneJS, 564 'replaceLane', Int32x4ReplaceLaneJS,
527 'neg', Int32x4NegJS, 565 'neg', Int32x4NegJS,
528 'add', Int32x4AddJS, 566 'add', Int32x4AddJS,
529 'sub', Int32x4SubJS, 567 'sub', Int32x4SubJS,
(...skipping 13 matching lines...) Expand all
543 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS, 581 'greaterThanOrEqual', Int32x4GreaterThanOrEqualJS,
544 'equal', Int32x4EqualJS, 582 'equal', Int32x4EqualJS,
545 'notEqual', Int32x4NotEqualJS, 583 'notEqual', Int32x4NotEqualJS,
546 'select', Int32x4SelectJS, 584 'select', Int32x4SelectJS,
547 'swizzle', Int32x4SwizzleJS, 585 'swizzle', Int32x4SwizzleJS,
548 'shuffle', Int32x4ShuffleJS, 586 'shuffle', Int32x4ShuffleJS,
549 'fromFloat32x4', Int32x4FromFloat32x4JS, 587 'fromFloat32x4', Int32x4FromFloat32x4JS,
550 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS, 588 'fromFloat32x4Bits', Int32x4FromFloat32x4BitsJS,
551 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS, 589 'fromInt16x8Bits', Int32x4FromInt16x8BitsJS,
552 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS, 590 'fromInt8x16Bits', Int32x4FromInt8x16BitsJS,
591 'load', Int32x4LoadJS,
592 'load1', Int32x4Load1JS,
593 'load2', Int32x4Load2JS,
594 'load3', Int32x4Load3JS,
553 ]); 595 ]);
554 596
555 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [ 597 utils.InstallFunctions(GlobalBool32x4, DONT_ENUM, [
556 'splat', Bool32x4Splat, 598 'splat', Bool32x4Splat,
557 'check', Bool32x4CheckJS, 599 'check', Bool32x4CheckJS,
558 'extractLane', Bool32x4ExtractLaneJS, 600 'extractLane', Bool32x4ExtractLaneJS,
559 'replaceLane', Bool32x4ReplaceLaneJS, 601 'replaceLane', Bool32x4ReplaceLaneJS,
560 'and', Bool32x4AndJS, 602 'and', Bool32x4AndJS,
561 'or', Bool32x4OrJS, 603 'or', Bool32x4OrJS,
562 'xor', Bool32x4XorJS, 604 'xor', Bool32x4XorJS,
(...skipping 30 matching lines...) Expand all
593 'greaterThan', Int16x8GreaterThanJS, 635 'greaterThan', Int16x8GreaterThanJS,
594 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS, 636 'greaterThanOrEqual', Int16x8GreaterThanOrEqualJS,
595 'equal', Int16x8EqualJS, 637 'equal', Int16x8EqualJS,
596 'notEqual', Int16x8NotEqualJS, 638 'notEqual', Int16x8NotEqualJS,
597 'select', Int16x8SelectJS, 639 'select', Int16x8SelectJS,
598 'swizzle', Int16x8SwizzleJS, 640 'swizzle', Int16x8SwizzleJS,
599 'shuffle', Int16x8ShuffleJS, 641 'shuffle', Int16x8ShuffleJS,
600 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS, 642 'fromFloat32x4Bits', Int16x8FromFloat32x4BitsJS,
601 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS, 643 'fromInt32x4Bits', Int16x8FromInt32x4BitsJS,
602 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS, 644 'fromInt8x16Bits', Int16x8FromInt8x16BitsJS,
645 'load', Int16x8LoadJS,
603 ]); 646 ]);
604 647
605 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [ 648 utils.InstallFunctions(GlobalBool16x8, DONT_ENUM, [
606 'splat', Bool16x8Splat, 649 'splat', Bool16x8Splat,
607 'check', Bool16x8CheckJS, 650 'check', Bool16x8CheckJS,
608 'extractLane', Bool16x8ExtractLaneJS, 651 'extractLane', Bool16x8ExtractLaneJS,
609 'replaceLane', Bool16x8ReplaceLaneJS, 652 'replaceLane', Bool16x8ReplaceLaneJS,
610 'and', Bool16x8AndJS, 653 'and', Bool16x8AndJS,
611 'or', Bool16x8OrJS, 654 'or', Bool16x8OrJS,
612 'xor', Bool16x8XorJS, 655 'xor', Bool16x8XorJS,
(...skipping 30 matching lines...) Expand all
643 'greaterThan', Int8x16GreaterThanJS, 686 'greaterThan', Int8x16GreaterThanJS,
644 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS, 687 'greaterThanOrEqual', Int8x16GreaterThanOrEqualJS,
645 'equal', Int8x16EqualJS, 688 'equal', Int8x16EqualJS,
646 'notEqual', Int8x16NotEqualJS, 689 'notEqual', Int8x16NotEqualJS,
647 'select', Int8x16SelectJS, 690 'select', Int8x16SelectJS,
648 'swizzle', Int8x16SwizzleJS, 691 'swizzle', Int8x16SwizzleJS,
649 'shuffle', Int8x16ShuffleJS, 692 'shuffle', Int8x16ShuffleJS,
650 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS, 693 'fromFloat32x4Bits', Int8x16FromFloat32x4BitsJS,
651 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS, 694 'fromInt32x4Bits', Int8x16FromInt32x4BitsJS,
652 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS, 695 'fromInt16x8Bits', Int8x16FromInt16x8BitsJS,
696 'load', Int8x16LoadJS,
653 ]); 697 ]);
654 698
655 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [ 699 utils.InstallFunctions(GlobalBool8x16, DONT_ENUM, [
656 'splat', Bool8x16Splat, 700 'splat', Bool8x16Splat,
657 'check', Bool8x16CheckJS, 701 'check', Bool8x16CheckJS,
658 'extractLane', Bool8x16ExtractLaneJS, 702 'extractLane', Bool8x16ExtractLaneJS,
659 'replaceLane', Bool8x16ReplaceLaneJS, 703 'replaceLane', Bool8x16ReplaceLaneJS,
660 'and', Bool8x16AndJS, 704 'and', Bool8x16AndJS,
661 'or', Bool8x16OrJS, 705 'or', Bool8x16OrJS,
662 'xor', Bool8x16XorJS, 706 'xor', Bool8x16XorJS,
(...skipping 10 matching lines...) Expand all
673 to.Float32x4ToString = Float32x4ToString; 717 to.Float32x4ToString = Float32x4ToString;
674 to.Int32x4ToString = Int32x4ToString; 718 to.Int32x4ToString = Int32x4ToString;
675 to.Bool32x4ToString = Bool32x4ToString; 719 to.Bool32x4ToString = Bool32x4ToString;
676 to.Int16x8ToString = Int16x8ToString; 720 to.Int16x8ToString = Int16x8ToString;
677 to.Bool16x8ToString = Bool16x8ToString; 721 to.Bool16x8ToString = Bool16x8ToString;
678 to.Int8x16ToString = Int8x16ToString; 722 to.Int8x16ToString = Int8x16ToString;
679 to.Bool8x16ToString = Bool8x16ToString; 723 to.Bool8x16ToString = Bool8x16ToString;
680 }); 724 });
681 725
682 }) 726 })
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | src/runtime/runtime-simd.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698