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

Side by Side Diff: src/arm64/macro-assembler-arm64.h

Issue 2622643005: ARM64: Add NEON support (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ 5 #ifndef V8_ARM64_MACRO_ASSEMBLER_ARM64_H_
6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ 6 #define V8_ARM64_MACRO_ASSEMBLER_ARM64_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "src/arm64/assembler-arm64.h" 10 #include "src/arm64/assembler-arm64.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 const Register& rn, 384 const Register& rn,
385 const Register& rm, 385 const Register& rm,
386 Condition cond); 386 Condition cond);
387 inline void Dmb(BarrierDomain domain, BarrierType type); 387 inline void Dmb(BarrierDomain domain, BarrierType type);
388 inline void Dsb(BarrierDomain domain, BarrierType type); 388 inline void Dsb(BarrierDomain domain, BarrierType type);
389 inline void Debug(const char* message, uint32_t code, Instr params = BREAK); 389 inline void Debug(const char* message, uint32_t code, Instr params = BREAK);
390 inline void Extr(const Register& rd, 390 inline void Extr(const Register& rd,
391 const Register& rn, 391 const Register& rn,
392 const Register& rm, 392 const Register& rm,
393 unsigned lsb); 393 unsigned lsb);
394 inline void Fabs(const FPRegister& fd, const FPRegister& fn); 394 inline void Fabs(const VRegister& fd, const VRegister& fn);
395 inline void Fadd(const FPRegister& fd, 395 inline void Fadd(const VRegister& fd, const VRegister& fn,
396 const FPRegister& fn, 396 const VRegister& fm);
397 const FPRegister& fm); 397 inline void Fccmp(const VRegister& fn, const VRegister& fm, StatusFlags nzcv,
398 inline void Fccmp(const FPRegister& fn,
399 const FPRegister& fm,
400 StatusFlags nzcv,
401 Condition cond); 398 Condition cond);
402 inline void Fcmp(const FPRegister& fn, const FPRegister& fm); 399 inline void Fcmp(const VRegister& fn, const VRegister& fm);
403 inline void Fcmp(const FPRegister& fn, double value); 400 inline void Fcmp(const VRegister& fn, double value);
404 inline void Fcsel(const FPRegister& fd, 401 inline void Fcsel(const VRegister& fd, const VRegister& fn,
405 const FPRegister& fn, 402 const VRegister& fm, Condition cond);
406 const FPRegister& fm, 403 inline void Fcvt(const VRegister& fd, const VRegister& fn);
407 Condition cond); 404 void Fcvtl(const VRegister& vd, const VRegister& vn) {
408 inline void Fcvt(const FPRegister& fd, const FPRegister& fn); 405 DCHECK(allow_macro_instructions_);
409 inline void Fcvtas(const Register& rd, const FPRegister& fn); 406 fcvtl(vd, vn);
410 inline void Fcvtau(const Register& rd, const FPRegister& fn); 407 }
411 inline void Fcvtms(const Register& rd, const FPRegister& fn); 408 void Fcvtl2(const VRegister& vd, const VRegister& vn) {
412 inline void Fcvtmu(const Register& rd, const FPRegister& fn); 409 DCHECK(allow_macro_instructions_);
413 inline void Fcvtns(const Register& rd, const FPRegister& fn); 410 fcvtl2(vd, vn);
414 inline void Fcvtnu(const Register& rd, const FPRegister& fn); 411 }
415 inline void Fcvtzs(const Register& rd, const FPRegister& fn); 412 void Fcvtn(const VRegister& vd, const VRegister& vn) {
416 inline void Fcvtzu(const Register& rd, const FPRegister& fn); 413 DCHECK(allow_macro_instructions_);
417 inline void Fdiv(const FPRegister& fd, 414 fcvtn(vd, vn);
418 const FPRegister& fn, 415 }
419 const FPRegister& fm); 416 void Fcvtn2(const VRegister& vd, const VRegister& vn) {
420 inline void Fmadd(const FPRegister& fd, 417 DCHECK(allow_macro_instructions_);
421 const FPRegister& fn, 418 fcvtn2(vd, vn);
422 const FPRegister& fm, 419 }
423 const FPRegister& fa); 420 void Fcvtxn(const VRegister& vd, const VRegister& vn) {
424 inline void Fmax(const FPRegister& fd, 421 DCHECK(allow_macro_instructions_);
425 const FPRegister& fn, 422 fcvtxn(vd, vn);
426 const FPRegister& fm); 423 }
427 inline void Fmaxnm(const FPRegister& fd, 424 void Fcvtxn2(const VRegister& vd, const VRegister& vn) {
428 const FPRegister& fn, 425 DCHECK(allow_macro_instructions_);
429 const FPRegister& fm); 426 fcvtxn2(vd, vn);
430 inline void Fmin(const FPRegister& fd, 427 }
431 const FPRegister& fn, 428 inline void Fcvtas(const Register& rd, const VRegister& fn);
432 const FPRegister& fm); 429 inline void Fcvtau(const Register& rd, const VRegister& fn);
433 inline void Fminnm(const FPRegister& fd, 430 inline void Fcvtms(const Register& rd, const VRegister& fn);
434 const FPRegister& fn, 431 inline void Fcvtmu(const Register& rd, const VRegister& fn);
435 const FPRegister& fm); 432 inline void Fcvtns(const Register& rd, const VRegister& fn);
436 inline void Fmov(FPRegister fd, FPRegister fn); 433 inline void Fcvtnu(const Register& rd, const VRegister& fn);
437 inline void Fmov(FPRegister fd, Register rn); 434 inline void Fcvtzs(const Register& rd, const VRegister& fn);
435 inline void Fcvtzu(const Register& rd, const VRegister& fn);
436 inline void Fdiv(const VRegister& fd, const VRegister& fn,
437 const VRegister& fm);
438 inline void Fmadd(const VRegister& fd, const VRegister& fn,
439 const VRegister& fm, const VRegister& fa);
440 inline void Fmax(const VRegister& fd, const VRegister& fn,
441 const VRegister& fm);
442 inline void Fmaxnm(const VRegister& fd, const VRegister& fn,
443 const VRegister& fm);
444 inline void Fmin(const VRegister& fd, const VRegister& fn,
445 const VRegister& fm);
446 inline void Fminnm(const VRegister& fd, const VRegister& fn,
447 const VRegister& fm);
448 inline void Fmov(VRegister fd, VRegister fn);
449 inline void Fmov(VRegister fd, Register rn);
438 // Provide explicit double and float interfaces for FP immediate moves, rather 450 // Provide explicit double and float interfaces for FP immediate moves, rather
439 // than relying on implicit C++ casts. This allows signalling NaNs to be 451 // than relying on implicit C++ casts. This allows signalling NaNs to be
440 // preserved when the immediate matches the format of fd. Most systems convert 452 // preserved when the immediate matches the format of fd. Most systems convert
441 // signalling NaNs to quiet NaNs when converting between float and double. 453 // signalling NaNs to quiet NaNs when converting between float and double.
442 inline void Fmov(FPRegister fd, double imm); 454 inline void Fmov(VRegister fd, double imm);
443 inline void Fmov(FPRegister fd, float imm); 455 inline void Fmov(VRegister fd, float imm);
444 // Provide a template to allow other types to be converted automatically. 456 // Provide a template to allow other types to be converted automatically.
445 template<typename T> 457 template <typename T>
446 void Fmov(FPRegister fd, T imm) { 458 void Fmov(VRegister fd, T imm) {
447 DCHECK(allow_macro_instructions_); 459 DCHECK(allow_macro_instructions_);
448 Fmov(fd, static_cast<double>(imm)); 460 Fmov(fd, static_cast<double>(imm));
449 } 461 }
450 inline void Fmov(Register rd, FPRegister fn); 462 inline void Fmov(Register rd, VRegister fn);
451 inline void Fmsub(const FPRegister& fd, 463 inline void Fmsub(const VRegister& fd, const VRegister& fn,
452 const FPRegister& fn, 464 const VRegister& fm, const VRegister& fa);
453 const FPRegister& fm, 465 inline void Fmul(const VRegister& fd, const VRegister& fn,
454 const FPRegister& fa); 466 const VRegister& fm);
455 inline void Fmul(const FPRegister& fd, 467 inline void Fnmadd(const VRegister& fd, const VRegister& fn,
456 const FPRegister& fn, 468 const VRegister& fm, const VRegister& fa);
457 const FPRegister& fm); 469 inline void Fnmsub(const VRegister& fd, const VRegister& fn,
458 inline void Fneg(const FPRegister& fd, const FPRegister& fn); 470 const VRegister& fm, const VRegister& fa);
459 inline void Fnmadd(const FPRegister& fd, 471 inline void Fsub(const VRegister& fd, const VRegister& fn,
460 const FPRegister& fn, 472 const VRegister& fm);
461 const FPRegister& fm,
462 const FPRegister& fa);
463 inline void Fnmsub(const FPRegister& fd,
464 const FPRegister& fn,
465 const FPRegister& fm,
466 const FPRegister& fa);
467 inline void Frinta(const FPRegister& fd, const FPRegister& fn);
468 inline void Frintm(const FPRegister& fd, const FPRegister& fn);
469 inline void Frintn(const FPRegister& fd, const FPRegister& fn);
470 inline void Frintp(const FPRegister& fd, const FPRegister& fn);
471 inline void Frintz(const FPRegister& fd, const FPRegister& fn);
472 inline void Fsqrt(const FPRegister& fd, const FPRegister& fn);
473 inline void Fsub(const FPRegister& fd,
474 const FPRegister& fn,
475 const FPRegister& fm);
476 inline void Hint(SystemHint code); 473 inline void Hint(SystemHint code);
477 inline void Hlt(int code); 474 inline void Hlt(int code);
478 inline void Isb(); 475 inline void Isb();
479 inline void Ldnp(const CPURegister& rt, 476 inline void Ldnp(const CPURegister& rt,
480 const CPURegister& rt2, 477 const CPURegister& rt2,
481 const MemOperand& src); 478 const MemOperand& src);
482 // Load a literal from the inline constant pool. 479 // Load a literal from the inline constant pool.
483 inline void Ldr(const CPURegister& rt, const Immediate& imm); 480 inline void Ldr(const CPURegister& rt, const Immediate& imm);
484 // Helper function for double immediate. 481 // Helper function for double immediate.
485 inline void Ldr(const CPURegister& rt, double imm); 482 inline void Ldr(const CPURegister& rt, double imm);
486 inline void Lsl(const Register& rd, const Register& rn, unsigned shift); 483 inline void Lsl(const Register& rd, const Register& rn, unsigned shift);
487 inline void Lsl(const Register& rd, const Register& rn, const Register& rm); 484 inline void Lsl(const Register& rd, const Register& rn, const Register& rm);
488 inline void Lsr(const Register& rd, const Register& rn, unsigned shift); 485 inline void Lsr(const Register& rd, const Register& rn, unsigned shift);
489 inline void Lsr(const Register& rd, const Register& rn, const Register& rm); 486 inline void Lsr(const Register& rd, const Register& rn, const Register& rm);
490 inline void Madd(const Register& rd, 487 inline void Madd(const Register& rd,
491 const Register& rn, 488 const Register& rn,
492 const Register& rm, 489 const Register& rm,
493 const Register& ra); 490 const Register& ra);
494 inline void Mneg(const Register& rd, const Register& rn, const Register& rm); 491 inline void Mneg(const Register& rd, const Register& rn, const Register& rm);
495 inline void Mov(const Register& rd, const Register& rm); 492 inline void Mov(const Register& rd, const Register& rm);
496 inline void Movk(const Register& rd, uint64_t imm, int shift = -1); 493 inline void Movk(const Register& rd, uint64_t imm, int shift = -1);
497 inline void Mrs(const Register& rt, SystemRegister sysreg); 494 inline void Mrs(const Register& rt, SystemRegister sysreg);
498 inline void Msr(SystemRegister sysreg, const Register& rt); 495 inline void Msr(SystemRegister sysreg, const Register& rt);
499 inline void Msub(const Register& rd, 496 inline void Msub(const Register& rd,
500 const Register& rn, 497 const Register& rn,
501 const Register& rm, 498 const Register& rm,
502 const Register& ra); 499 const Register& ra);
503 inline void Mul(const Register& rd, const Register& rn, const Register& rm); 500 inline void Mul(const Register& rd, const Register& rn, const Register& rm);
504 inline void Nop() { nop(); } 501 inline void Nop() { nop(); }
502 void Dup(const VRegister& vd, const VRegister& vn, int index) {
503 DCHECK(allow_macro_instructions_);
504 dup(vd, vn, index);
505 }
506 void Dup(const VRegister& vd, const Register& rn) {
507 DCHECK(allow_macro_instructions_);
508 dup(vd, rn);
509 }
510 void Ins(const VRegister& vd, int vd_index, const VRegister& vn,
511 int vn_index) {
512 DCHECK(allow_macro_instructions_);
513 ins(vd, vd_index, vn, vn_index);
514 }
515 void Ins(const VRegister& vd, int vd_index, const Register& rn) {
516 DCHECK(allow_macro_instructions_);
517 ins(vd, vd_index, rn);
518 }
519 void Mov(const VRegister& vd, int vd_index, const VRegister& vn,
520 int vn_index) {
521 DCHECK(allow_macro_instructions_);
522 mov(vd, vd_index, vn, vn_index);
523 }
524 void Mov(const VRegister& vd, const VRegister& vn, int index) {
525 DCHECK(allow_macro_instructions_);
526 mov(vd, vn, index);
527 }
528 void Mov(const VRegister& vd, int vd_index, const Register& rn) {
529 DCHECK(allow_macro_instructions_);
530 mov(vd, vd_index, rn);
531 }
532 void Mov(const Register& rd, const VRegister& vn, int vn_index) {
533 DCHECK(allow_macro_instructions_);
534 mov(rd, vn, vn_index);
535 }
536 void Movi(const VRegister& vd, uint64_t imm, Shift shift = LSL,
537 int shift_amount = 0);
538 void Movi(const VRegister& vd, uint64_t hi, uint64_t lo);
539 void Mvni(const VRegister& vd, const int imm8, Shift shift = LSL,
540 const int shift_amount = 0) {
541 DCHECK(allow_macro_instructions_);
542 mvni(vd, imm8, shift, shift_amount);
543 }
544 void Orr(const VRegister& vd, const int imm8, const int left_shift = 0) {
545 DCHECK(allow_macro_instructions_);
546 orr(vd, imm8, left_shift);
547 }
548 void Scvtf(const VRegister& vd, const VRegister& vn, int fbits = 0) {
549 DCHECK(allow_macro_instructions_);
550 scvtf(vd, vn, fbits);
551 }
552 void Ucvtf(const VRegister& vd, const VRegister& vn, int fbits = 0) {
553 DCHECK(allow_macro_instructions_);
554 ucvtf(vd, vn, fbits);
555 }
556 void Fcvtzs(const VRegister& vd, const VRegister& vn, int fbits = 0) {
557 DCHECK(allow_macro_instructions_);
558 fcvtzs(vd, vn, fbits);
559 }
560 void Fcvtzu(const VRegister& vd, const VRegister& vn, int fbits = 0) {
561 DCHECK(allow_macro_instructions_);
562 fcvtzu(vd, vn, fbits);
563 }
564 void Smov(const Register& rd, const VRegister& vn, int vn_index) {
565 DCHECK(allow_macro_instructions_);
566 smov(rd, vn, vn_index);
567 }
568 void Umov(const Register& rd, const VRegister& vn, int vn_index) {
569 DCHECK(allow_macro_instructions_);
570 umov(rd, vn, vn_index);
571 }
505 inline void Rbit(const Register& rd, const Register& rn); 572 inline void Rbit(const Register& rd, const Register& rn);
506 inline void Ret(const Register& xn = lr); 573 inline void Ret(const Register& xn = lr);
507 inline void Rev(const Register& rd, const Register& rn); 574 inline void Rev(const Register& rd, const Register& rn);
508 inline void Rev16(const Register& rd, const Register& rn); 575 inline void Rev16(const Register& rd, const Register& rn);
509 inline void Rev32(const Register& rd, const Register& rn); 576 inline void Rev32(const Register& rd, const Register& rn);
510 inline void Ror(const Register& rd, const Register& rs, unsigned shift); 577 inline void Ror(const Register& rd, const Register& rs, unsigned shift);
511 inline void Ror(const Register& rd, const Register& rn, const Register& rm); 578 inline void Ror(const Register& rd, const Register& rn, const Register& rm);
512 inline void Sbfiz(const Register& rd, 579 inline void Sbfiz(const Register& rd,
513 const Register& rn, 580 const Register& rn,
514 unsigned lsb, 581 unsigned lsb,
515 unsigned width); 582 unsigned width);
516 inline void Sbfx(const Register& rd, 583 inline void Sbfx(const Register& rd,
517 const Register& rn, 584 const Register& rn,
518 unsigned lsb, 585 unsigned lsb,
519 unsigned width); 586 unsigned width);
520 inline void Scvtf(const FPRegister& fd, 587 inline void Scvtf(const VRegister& fd, const Register& rn,
521 const Register& rn,
522 unsigned fbits = 0); 588 unsigned fbits = 0);
523 inline void Sdiv(const Register& rd, const Register& rn, const Register& rm); 589 inline void Sdiv(const Register& rd, const Register& rn, const Register& rm);
524 inline void Smaddl(const Register& rd, 590 inline void Smaddl(const Register& rd,
525 const Register& rn, 591 const Register& rn,
526 const Register& rm, 592 const Register& rm,
527 const Register& ra); 593 const Register& ra);
528 inline void Smsubl(const Register& rd, 594 inline void Smsubl(const Register& rd,
529 const Register& rn, 595 const Register& rn,
530 const Register& rm, 596 const Register& rm,
531 const Register& ra); 597 const Register& ra);
(...skipping 13 matching lines...) Expand all
545 void Tbnz(const Register& rt, unsigned bit_pos, Label* label); 611 void Tbnz(const Register& rt, unsigned bit_pos, Label* label);
546 void Tbz(const Register& rt, unsigned bit_pos, Label* label); 612 void Tbz(const Register& rt, unsigned bit_pos, Label* label);
547 inline void Ubfiz(const Register& rd, 613 inline void Ubfiz(const Register& rd,
548 const Register& rn, 614 const Register& rn,
549 unsigned lsb, 615 unsigned lsb,
550 unsigned width); 616 unsigned width);
551 inline void Ubfx(const Register& rd, 617 inline void Ubfx(const Register& rd,
552 const Register& rn, 618 const Register& rn,
553 unsigned lsb, 619 unsigned lsb,
554 unsigned width); 620 unsigned width);
555 inline void Ucvtf(const FPRegister& fd, 621 inline void Ucvtf(const VRegister& fd, const Register& rn,
556 const Register& rn,
557 unsigned fbits = 0); 622 unsigned fbits = 0);
558 inline void Udiv(const Register& rd, const Register& rn, const Register& rm); 623 inline void Udiv(const Register& rd, const Register& rn, const Register& rm);
559 inline void Umaddl(const Register& rd, 624 inline void Umaddl(const Register& rd,
560 const Register& rn, 625 const Register& rn,
561 const Register& rm, 626 const Register& rm,
562 const Register& ra); 627 const Register& ra);
563 inline void Umsubl(const Register& rd, 628 inline void Umsubl(const Register& rd,
564 const Register& rn, 629 const Register& rn,
565 const Register& rm, 630 const Register& rm,
566 const Register& ra); 631 const Register& ra);
567 inline void Uxtb(const Register& rd, const Register& rn); 632 inline void Uxtb(const Register& rd, const Register& rn);
568 inline void Uxth(const Register& rd, const Register& rn); 633 inline void Uxth(const Register& rd, const Register& rn);
569 inline void Uxtw(const Register& rd, const Register& rn); 634 inline void Uxtw(const Register& rd, const Register& rn);
570 635
636 // NEON 3 vector register instructions.
637 #define NEON_3VREG_MACRO_LIST(V) \
638 V(add, Add) \
639 V(addhn, Addhn) \
640 V(addhn2, Addhn2) \
641 V(addp, Addp) \
642 V(and_, And) \
643 V(bic, Bic) \
644 V(bif, Bif) \
645 V(bit, Bit) \
646 V(bsl, Bsl) \
647 V(cmeq, Cmeq) \
648 V(cmge, Cmge) \
649 V(cmgt, Cmgt) \
650 V(cmhi, Cmhi) \
651 V(cmhs, Cmhs) \
652 V(cmtst, Cmtst) \
653 V(eor, Eor) \
654 V(fabd, Fabd) \
655 V(facge, Facge) \
656 V(facgt, Facgt) \
657 V(faddp, Faddp) \
658 V(fcmeq, Fcmeq) \
659 V(fcmge, Fcmge) \
660 V(fcmgt, Fcmgt) \
661 V(fmaxnmp, Fmaxnmp) \
662 V(fmaxp, Fmaxp) \
663 V(fminnmp, Fminnmp) \
664 V(fminp, Fminp) \
665 V(fmla, Fmla) \
666 V(fmls, Fmls) \
667 V(fmulx, Fmulx) \
668 V(frecps, Frecps) \
669 V(frsqrts, Frsqrts) \
670 V(mla, Mla) \
671 V(mls, Mls) \
672 V(mul, Mul) \
673 V(orn, Orn) \
674 V(pmul, Pmul) \
675 V(pmull, Pmull) \
676 V(pmull2, Pmull2) \
677 V(raddhn, Raddhn) \
678 V(raddhn2, Raddhn2) \
679 V(rsubhn, Rsubhn) \
680 V(rsubhn2, Rsubhn2) \
681 V(sqadd, Sqadd) \
682 V(sqdmlal, Sqdmlal) \
683 V(sqdmlal2, Sqdmlal2) \
684 V(sqdmulh, Sqdmulh) \
685 V(sqdmull, Sqdmull) \
686 V(sqdmull2, Sqdmull2) \
687 V(sqrdmulh, Sqrdmulh) \
688 V(sqrshl, Sqrshl) \
689 V(sqshl, Sqshl) \
690 V(sqsub, Sqsub) \
691 V(srhadd, Srhadd) \
692 V(srshl, Srshl) \
693 V(sshl, Sshl) \
694 V(ssubl, Ssubl) \
695 V(ssubl2, Ssubl2) \
696 V(ssubw, Ssubw) \
697 V(ssubw2, Ssubw2) \
698 V(sub, Sub) \
699 V(subhn, Subhn) \
700 V(subhn2, Subhn2) \
701 V(trn1, Trn1) \
702 V(trn2, Trn2) \
703 V(orr, Orr) \
704 V(saba, Saba) \
705 V(sabal, Sabal) \
706 V(sabal2, Sabal2) \
707 V(sabd, Sabd) \
708 V(sabdl, Sabdl) \
709 V(sabdl2, Sabdl2) \
710 V(saddl, Saddl) \
711 V(saddl2, Saddl2) \
712 V(saddw, Saddw) \
713 V(saddw2, Saddw2) \
714 V(shadd, Shadd) \
715 V(shsub, Shsub) \
716 V(smax, Smax) \
717 V(smaxp, Smaxp) \
718 V(smin, Smin) \
719 V(sminp, Sminp) \
720 V(smlal, Smlal) \
721 V(smlal2, Smlal2) \
722 V(smlsl, Smlsl) \
723 V(smlsl2, Smlsl2) \
724 V(smull, Smull) \
725 V(smull2, Smull2) \
726 V(sqdmlsl, Sqdmlsl) \
727 V(sqdmlsl2, Sqdmlsl2) \
728 V(uaba, Uaba) \
729 V(uabal, Uabal) \
730 V(uabal2, Uabal2) \
731 V(uabd, Uabd) \
732 V(uabdl, Uabdl) \
733 V(uabdl2, Uabdl2) \
734 V(uaddl, Uaddl) \
735 V(uaddl2, Uaddl2) \
736 V(uaddw, Uaddw) \
737 V(uaddw2, Uaddw2) \
738 V(uhadd, Uhadd) \
739 V(uhsub, Uhsub) \
740 V(umax, Umax) \
741 V(umin, Umin) \
742 V(umlsl, Umlsl) \
743 V(umlsl2, Umlsl2) \
744 V(umull, Umull) \
745 V(umull2, Umull2) \
746 V(umaxp, Umaxp) \
747 V(uminp, Uminp) \
748 V(umlal, Umlal) \
749 V(umlal2, Umlal2) \
750 V(uqadd, Uqadd) \
751 V(uqrshl, Uqrshl) \
752 V(uqshl, Uqshl) \
753 V(uqsub, Uqsub) \
754 V(urhadd, Urhadd) \
755 V(urshl, Urshl) \
756 V(ushl, Ushl) \
757 V(usubl, Usubl) \
758 V(usubl2, Usubl2) \
759 V(usubw, Usubw) \
760 V(usubw2, Usubw2) \
761 V(uzp1, Uzp1) \
762 V(uzp2, Uzp2) \
763 V(zip1, Zip1) \
764 V(zip2, Zip2)
765
766 #define DEFINE_MACRO_ASM_FUNC(ASM, MASM) \
767 void MASM(const VRegister& vd, const VRegister& vn, const VRegister& vm) { \
768 DCHECK(allow_macro_instructions_); \
769 ASM(vd, vn, vm); \
770 }
771 NEON_3VREG_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
772 #undef DEFINE_MACRO_ASM_FUNC
773
774 void Ext(const VRegister& vd, const VRegister& vn, const VRegister& vm,
775 int index) {
776 DCHECK(allow_macro_instructions_);
777 ext(vd, vn, vm, index);
778 }
779
780 // NEON 2 vector register instructions.
781 #define NEON_2VREG_MACRO_LIST(V) \
782 V(abs, Abs) \
783 V(addp, Addp) \
784 V(addv, Addv) \
785 V(cls, Cls) \
786 V(clz, Clz) \
787 V(cnt, Cnt) \
788 V(faddp, Faddp) \
789 V(fcvtas, Fcvtas) \
790 V(fcvtau, Fcvtau) \
791 V(fcvtms, Fcvtms) \
792 V(fcvtmu, Fcvtmu) \
793 V(fcvtns, Fcvtns) \
794 V(fcvtnu, Fcvtnu) \
795 V(fcvtps, Fcvtps) \
796 V(fcvtpu, Fcvtpu) \
797 V(fmaxnmp, Fmaxnmp) \
798 V(fmaxnmv, Fmaxnmv) \
799 V(fmaxv, Fmaxv) \
800 V(fminnmp, Fminnmp) \
801 V(fminnmv, Fminnmv) \
802 V(fminp, Fminp) \
803 V(fmaxp, Fmaxp) \
804 V(fminv, Fminv) \
805 V(fneg, Fneg) \
806 V(frecpe, Frecpe) \
807 V(frecpx, Frecpx) \
808 V(frinta, Frinta) \
809 V(frinti, Frinti) \
810 V(frintm, Frintm) \
811 V(frintn, Frintn) \
812 V(frintp, Frintp) \
813 V(frintx, Frintx) \
814 V(frintz, Frintz) \
815 V(frsqrte, Frsqrte) \
816 V(fsqrt, Fsqrt) \
817 V(mov, Mov) \
818 V(mvn, Mvn) \
819 V(neg, Neg) \
820 V(not_, Not) \
821 V(rbit, Rbit) \
822 V(rev16, Rev16) \
823 V(rev32, Rev32) \
824 V(rev64, Rev64) \
825 V(sadalp, Sadalp) \
826 V(saddlv, Saddlv) \
827 V(smaxv, Smaxv) \
828 V(sminv, Sminv) \
829 V(saddlp, Saddlp) \
830 V(sqabs, Sqabs) \
831 V(sqneg, Sqneg) \
832 V(sqxtn, Sqxtn) \
833 V(sqxtn2, Sqxtn2) \
834 V(sqxtun, Sqxtun) \
835 V(sqxtun2, Sqxtun2) \
836 V(suqadd, Suqadd) \
837 V(sxtl, Sxtl) \
838 V(sxtl2, Sxtl2) \
839 V(uadalp, Uadalp) \
840 V(uaddlp, Uaddlp) \
841 V(uaddlv, Uaddlv) \
842 V(umaxv, Umaxv) \
843 V(uminv, Uminv) \
844 V(uqxtn, Uqxtn) \
845 V(uqxtn2, Uqxtn2) \
846 V(urecpe, Urecpe) \
847 V(ursqrte, Ursqrte) \
848 V(usqadd, Usqadd) \
849 V(uxtl, Uxtl) \
850 V(uxtl2, Uxtl2) \
851 V(xtn, Xtn) \
852 V(xtn2, Xtn2)
853
854 #define DEFINE_MACRO_ASM_FUNC(ASM, MASM) \
855 void MASM(const VRegister& vd, const VRegister& vn) { \
856 DCHECK(allow_macro_instructions_); \
857 ASM(vd, vn); \
858 }
859 NEON_2VREG_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
860 #undef DEFINE_MACRO_ASM_FUNC
861
862 // NEON 2 vector register with immediate instructions.
863 #define NEON_2VREG_FPIMM_MACRO_LIST(V) \
864 V(fcmeq, Fcmeq) \
865 V(fcmge, Fcmge) \
866 V(fcmgt, Fcmgt) \
867 V(fcmle, Fcmle) \
868 V(fcmlt, Fcmlt)
869
870 #define DEFINE_MACRO_ASM_FUNC(ASM, MASM) \
871 void MASM(const VRegister& vd, const VRegister& vn, double imm) { \
872 DCHECK(allow_macro_instructions_); \
873 ASM(vd, vn, imm); \
874 }
875 NEON_2VREG_FPIMM_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
876 #undef DEFINE_MACRO_ASM_FUNC
877
878 void Bic(const VRegister& vd, const int imm8, const int left_shift = 0) {
879 DCHECK(allow_macro_instructions_);
880 bic(vd, imm8, left_shift);
881 }
882 void Cmeq(const VRegister& vd, const VRegister& vn, int imm) {
883 DCHECK(allow_macro_instructions_);
884 cmeq(vd, vn, imm);
885 }
886 void Cmge(const VRegister& vd, const VRegister& vn, int imm) {
887 DCHECK(allow_macro_instructions_);
888 cmge(vd, vn, imm);
889 }
890 void Cmgt(const VRegister& vd, const VRegister& vn, int imm) {
891 DCHECK(allow_macro_instructions_);
892 cmgt(vd, vn, imm);
893 }
894 void Cmle(const VRegister& vd, const VRegister& vn, int imm) {
895 DCHECK(allow_macro_instructions_);
896 cmle(vd, vn, imm);
897 }
898 void Cmlt(const VRegister& vd, const VRegister& vn, int imm) {
899 DCHECK(allow_macro_instructions_);
900 cmlt(vd, vn, imm);
901 }
902 // NEON by element instructions.
903 #define NEON_BYELEMENT_MACRO_LIST(V) \
904 V(fmul, Fmul) \
905 V(fmla, Fmla) \
906 V(fmls, Fmls) \
907 V(fmulx, Fmulx) \
908 V(mul, Mul) \
909 V(mla, Mla) \
910 V(mls, Mls) \
911 V(sqdmulh, Sqdmulh) \
912 V(sqrdmulh, Sqrdmulh) \
913 V(sqdmull, Sqdmull) \
914 V(sqdmull2, Sqdmull2) \
915 V(sqdmlal, Sqdmlal) \
916 V(sqdmlal2, Sqdmlal2) \
917 V(sqdmlsl, Sqdmlsl) \
918 V(sqdmlsl2, Sqdmlsl2) \
919 V(smull, Smull) \
920 V(smull2, Smull2) \
921 V(smlal, Smlal) \
922 V(smlal2, Smlal2) \
923 V(smlsl, Smlsl) \
924 V(smlsl2, Smlsl2) \
925 V(umull, Umull) \
926 V(umull2, Umull2) \
927 V(umlal, Umlal) \
928 V(umlal2, Umlal2) \
929 V(umlsl, Umlsl) \
930 V(umlsl2, Umlsl2)
931
932 #define DEFINE_MACRO_ASM_FUNC(ASM, MASM) \
933 void MASM(const VRegister& vd, const VRegister& vn, const VRegister& vm, \
934 int vm_index) { \
935 DCHECK(allow_macro_instructions_); \
936 ASM(vd, vn, vm, vm_index); \
937 }
938 NEON_BYELEMENT_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
939 #undef DEFINE_MACRO_ASM_FUNC
940
941 #define NEON_2VREG_SHIFT_MACRO_LIST(V) \
942 V(rshrn, Rshrn) \
943 V(rshrn2, Rshrn2) \
944 V(shl, Shl) \
945 V(shll, Shll) \
946 V(shll2, Shll2) \
947 V(shrn, Shrn) \
948 V(shrn2, Shrn2) \
949 V(sli, Sli) \
950 V(sqrshrn, Sqrshrn) \
951 V(sqrshrn2, Sqrshrn2) \
952 V(sqrshrun, Sqrshrun) \
953 V(sqrshrun2, Sqrshrun2) \
954 V(sqshl, Sqshl) \
955 V(sqshlu, Sqshlu) \
956 V(sqshrn, Sqshrn) \
957 V(sqshrn2, Sqshrn2) \
958 V(sqshrun, Sqshrun) \
959 V(sqshrun2, Sqshrun2) \
960 V(sri, Sri) \
961 V(srshr, Srshr) \
962 V(srsra, Srsra) \
963 V(sshll, Sshll) \
964 V(sshll2, Sshll2) \
965 V(sshr, Sshr) \
966 V(ssra, Ssra) \
967 V(uqrshrn, Uqrshrn) \
968 V(uqrshrn2, Uqrshrn2) \
969 V(uqshl, Uqshl) \
970 V(uqshrn, Uqshrn) \
971 V(uqshrn2, Uqshrn2) \
972 V(urshr, Urshr) \
973 V(ursra, Ursra) \
974 V(ushll, Ushll) \
975 V(ushll2, Ushll2) \
976 V(ushr, Ushr) \
977 V(usra, Usra)
978
979 #define DEFINE_MACRO_ASM_FUNC(ASM, MASM) \
980 void MASM(const VRegister& vd, const VRegister& vn, int shift) { \
981 DCHECK(allow_macro_instructions_); \
982 ASM(vd, vn, shift); \
983 }
984 NEON_2VREG_SHIFT_MACRO_LIST(DEFINE_MACRO_ASM_FUNC)
985 #undef DEFINE_MACRO_ASM_FUNC
986
987 void Ld1(const VRegister& vt, const MemOperand& src) {
988 DCHECK(allow_macro_instructions_);
989 ld1(vt, src);
990 }
991 void Ld1(const VRegister& vt, const VRegister& vt2, const MemOperand& src) {
992 DCHECK(allow_macro_instructions_);
993 ld1(vt, vt2, src);
994 }
995 void Ld1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
996 const MemOperand& src) {
997 DCHECK(allow_macro_instructions_);
998 ld1(vt, vt2, vt3, src);
999 }
1000 void Ld1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1001 const VRegister& vt4, const MemOperand& src) {
1002 DCHECK(allow_macro_instructions_);
1003 ld1(vt, vt2, vt3, vt4, src);
1004 }
1005 void Ld1(const VRegister& vt, int lane, const MemOperand& src) {
1006 DCHECK(allow_macro_instructions_);
1007 ld1(vt, lane, src);
1008 }
1009 void Ld1r(const VRegister& vt, const MemOperand& src) {
1010 DCHECK(allow_macro_instructions_);
1011 ld1r(vt, src);
1012 }
1013 void Ld2(const VRegister& vt, const VRegister& vt2, const MemOperand& src) {
1014 DCHECK(allow_macro_instructions_);
1015 ld2(vt, vt2, src);
1016 }
1017 void Ld2(const VRegister& vt, const VRegister& vt2, int lane,
1018 const MemOperand& src) {
1019 DCHECK(allow_macro_instructions_);
1020 ld2(vt, vt2, lane, src);
1021 }
1022 void Ld2r(const VRegister& vt, const VRegister& vt2, const MemOperand& src) {
1023 DCHECK(allow_macro_instructions_);
1024 ld2r(vt, vt2, src);
1025 }
1026 void Ld3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1027 const MemOperand& src) {
1028 DCHECK(allow_macro_instructions_);
1029 ld3(vt, vt2, vt3, src);
1030 }
1031 void Ld3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1032 int lane, const MemOperand& src) {
1033 DCHECK(allow_macro_instructions_);
1034 ld3(vt, vt2, vt3, lane, src);
1035 }
1036 void Ld3r(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1037 const MemOperand& src) {
1038 DCHECK(allow_macro_instructions_);
1039 ld3r(vt, vt2, vt3, src);
1040 }
1041 void Ld4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1042 const VRegister& vt4, const MemOperand& src) {
1043 DCHECK(allow_macro_instructions_);
1044 ld4(vt, vt2, vt3, vt4, src);
1045 }
1046 void Ld4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1047 const VRegister& vt4, int lane, const MemOperand& src) {
1048 DCHECK(allow_macro_instructions_);
1049 ld4(vt, vt2, vt3, vt4, lane, src);
1050 }
1051 void Ld4r(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1052 const VRegister& vt4, const MemOperand& src) {
1053 DCHECK(allow_macro_instructions_);
1054 ld4r(vt, vt2, vt3, vt4, src);
1055 }
1056 void St1(const VRegister& vt, const MemOperand& dst) {
1057 DCHECK(allow_macro_instructions_);
1058 st1(vt, dst);
1059 }
1060 void St1(const VRegister& vt, const VRegister& vt2, const MemOperand& dst) {
1061 DCHECK(allow_macro_instructions_);
1062 st1(vt, vt2, dst);
1063 }
1064 void St1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1065 const MemOperand& dst) {
1066 DCHECK(allow_macro_instructions_);
1067 st1(vt, vt2, vt3, dst);
1068 }
1069 void St1(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1070 const VRegister& vt4, const MemOperand& dst) {
1071 DCHECK(allow_macro_instructions_);
1072 st1(vt, vt2, vt3, vt4, dst);
1073 }
1074 void St1(const VRegister& vt, int lane, const MemOperand& dst) {
1075 DCHECK(allow_macro_instructions_);
1076 st1(vt, lane, dst);
1077 }
1078 void St2(const VRegister& vt, const VRegister& vt2, const MemOperand& dst) {
1079 DCHECK(allow_macro_instructions_);
1080 st2(vt, vt2, dst);
1081 }
1082 void St3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1083 const MemOperand& dst) {
1084 DCHECK(allow_macro_instructions_);
1085 st3(vt, vt2, vt3, dst);
1086 }
1087 void St4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1088 const VRegister& vt4, const MemOperand& dst) {
1089 DCHECK(allow_macro_instructions_);
1090 st4(vt, vt2, vt3, vt4, dst);
1091 }
1092 void St2(const VRegister& vt, const VRegister& vt2, int lane,
1093 const MemOperand& dst) {
1094 DCHECK(allow_macro_instructions_);
1095 st2(vt, vt2, lane, dst);
1096 }
1097 void St3(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1098 int lane, const MemOperand& dst) {
1099 DCHECK(allow_macro_instructions_);
1100 st3(vt, vt2, vt3, lane, dst);
1101 }
1102 void St4(const VRegister& vt, const VRegister& vt2, const VRegister& vt3,
1103 const VRegister& vt4, int lane, const MemOperand& dst) {
1104 DCHECK(allow_macro_instructions_);
1105 st4(vt, vt2, vt3, vt4, lane, dst);
1106 }
1107 void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vm) {
1108 DCHECK(allow_macro_instructions_);
1109 tbl(vd, vn, vm);
1110 }
1111 void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
1112 const VRegister& vm) {
1113 DCHECK(allow_macro_instructions_);
1114 tbl(vd, vn, vn2, vm);
1115 }
1116 void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
1117 const VRegister& vn3, const VRegister& vm) {
1118 DCHECK(allow_macro_instructions_);
1119 tbl(vd, vn, vn2, vn3, vm);
1120 }
1121 void Tbl(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
1122 const VRegister& vn3, const VRegister& vn4, const VRegister& vm) {
1123 DCHECK(allow_macro_instructions_);
1124 tbl(vd, vn, vn2, vn3, vn4, vm);
1125 }
1126 void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vm) {
1127 DCHECK(allow_macro_instructions_);
1128 tbx(vd, vn, vm);
1129 }
1130 void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
1131 const VRegister& vm) {
1132 DCHECK(allow_macro_instructions_);
1133 tbx(vd, vn, vn2, vm);
1134 }
1135 void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
1136 const VRegister& vn3, const VRegister& vm) {
1137 DCHECK(allow_macro_instructions_);
1138 tbx(vd, vn, vn2, vn3, vm);
1139 }
1140 void Tbx(const VRegister& vd, const VRegister& vn, const VRegister& vn2,
1141 const VRegister& vn3, const VRegister& vn4, const VRegister& vm) {
1142 DCHECK(allow_macro_instructions_);
1143 tbx(vd, vn, vn2, vn3, vn4, vm);
1144 }
1145
571 // Pseudo-instructions ------------------------------------------------------ 1146 // Pseudo-instructions ------------------------------------------------------
572 1147
573 // Compute rd = abs(rm). 1148 // Compute rd = abs(rm).
574 // This function clobbers the condition flags. On output the overflow flag is 1149 // This function clobbers the condition flags. On output the overflow flag is
575 // set iff the negation overflowed. 1150 // set iff the negation overflowed.
576 // 1151 //
577 // If rm is the minimum representable value, the result is not representable. 1152 // If rm is the minimum representable value, the result is not representable.
578 // Handlers for each case can be specified using the relevant labels. 1153 // Handlers for each case can be specified using the relevant labels.
579 void Abs(const Register& rd, const Register& rm, 1154 void Abs(const Register& rd, const Register& rm,
580 Label * is_not_representable = NULL, 1155 Label * is_not_representable = NULL,
(...skipping 30 matching lines...) Expand all
611 void Push(const CPURegister& src0, const CPURegister& src1, 1186 void Push(const CPURegister& src0, const CPURegister& src1,
612 const CPURegister& src2, const CPURegister& src3, 1187 const CPURegister& src2, const CPURegister& src3,
613 const CPURegister& src4, const CPURegister& src5 = NoReg, 1188 const CPURegister& src4, const CPURegister& src5 = NoReg,
614 const CPURegister& src6 = NoReg, const CPURegister& src7 = NoReg); 1189 const CPURegister& src6 = NoReg, const CPURegister& src7 = NoReg);
615 void Pop(const CPURegister& dst0, const CPURegister& dst1 = NoReg, 1190 void Pop(const CPURegister& dst0, const CPURegister& dst1 = NoReg,
616 const CPURegister& dst2 = NoReg, const CPURegister& dst3 = NoReg); 1191 const CPURegister& dst2 = NoReg, const CPURegister& dst3 = NoReg);
617 void Pop(const CPURegister& dst0, const CPURegister& dst1, 1192 void Pop(const CPURegister& dst0, const CPURegister& dst1,
618 const CPURegister& dst2, const CPURegister& dst3, 1193 const CPURegister& dst2, const CPURegister& dst3,
619 const CPURegister& dst4, const CPURegister& dst5 = NoReg, 1194 const CPURegister& dst4, const CPURegister& dst5 = NoReg,
620 const CPURegister& dst6 = NoReg, const CPURegister& dst7 = NoReg); 1195 const CPURegister& dst6 = NoReg, const CPURegister& dst7 = NoReg);
621 void Push(const Register& src0, const FPRegister& src1); 1196 void Push(const Register& src0, const VRegister& src1);
622 1197
623 // Alternative forms of Push and Pop, taking a RegList or CPURegList that 1198 // Alternative forms of Push and Pop, taking a RegList or CPURegList that
624 // specifies the registers that are to be pushed or popped. Higher-numbered 1199 // specifies the registers that are to be pushed or popped. Higher-numbered
625 // registers are associated with higher memory addresses (as in the A32 push 1200 // registers are associated with higher memory addresses (as in the A32 push
626 // and pop instructions). 1201 // and pop instructions).
627 // 1202 //
628 // (Push|Pop)SizeRegList allow you to specify the register size as a 1203 // (Push|Pop)SizeRegList allow you to specify the register size as a
629 // parameter. Only kXRegSizeInBits, kWRegSizeInBits, kDRegSizeInBits and 1204 // parameter. Only kXRegSizeInBits, kWRegSizeInBits, kDRegSizeInBits and
630 // kSRegSizeInBits are supported. 1205 // kSRegSizeInBits are supported.
631 // 1206 //
(...skipping 15 matching lines...) Expand all
647 inline void PopXRegList(RegList regs) { 1222 inline void PopXRegList(RegList regs) {
648 PopSizeRegList(regs, kXRegSizeInBits); 1223 PopSizeRegList(regs, kXRegSizeInBits);
649 } 1224 }
650 inline void PushWRegList(RegList regs) { 1225 inline void PushWRegList(RegList regs) {
651 PushSizeRegList(regs, kWRegSizeInBits); 1226 PushSizeRegList(regs, kWRegSizeInBits);
652 } 1227 }
653 inline void PopWRegList(RegList regs) { 1228 inline void PopWRegList(RegList regs) {
654 PopSizeRegList(regs, kWRegSizeInBits); 1229 PopSizeRegList(regs, kWRegSizeInBits);
655 } 1230 }
656 inline void PushDRegList(RegList regs) { 1231 inline void PushDRegList(RegList regs) {
657 PushSizeRegList(regs, kDRegSizeInBits, CPURegister::kFPRegister); 1232 PushSizeRegList(regs, kDRegSizeInBits, CPURegister::kVRegister);
658 } 1233 }
659 inline void PopDRegList(RegList regs) { 1234 inline void PopDRegList(RegList regs) {
660 PopSizeRegList(regs, kDRegSizeInBits, CPURegister::kFPRegister); 1235 PopSizeRegList(regs, kDRegSizeInBits, CPURegister::kVRegister);
661 } 1236 }
662 inline void PushSRegList(RegList regs) { 1237 inline void PushSRegList(RegList regs) {
663 PushSizeRegList(regs, kSRegSizeInBits, CPURegister::kFPRegister); 1238 PushSizeRegList(regs, kSRegSizeInBits, CPURegister::kVRegister);
664 } 1239 }
665 inline void PopSRegList(RegList regs) { 1240 inline void PopSRegList(RegList regs) {
666 PopSizeRegList(regs, kSRegSizeInBits, CPURegister::kFPRegister); 1241 PopSizeRegList(regs, kSRegSizeInBits, CPURegister::kVRegister);
667 } 1242 }
668 1243
669 // Push the specified register 'count' times. 1244 // Push the specified register 'count' times.
670 void PushMultipleTimes(CPURegister src, Register count); 1245 void PushMultipleTimes(CPURegister src, Register count);
671 void PushMultipleTimes(CPURegister src, int count); 1246 void PushMultipleTimes(CPURegister src, int count);
672 1247
673 // This is a convenience method for pushing a single Handle<Object>. 1248 // This is a convenience method for pushing a single Handle<Object>.
674 inline void Push(Handle<Object> handle); 1249 inline void Push(Handle<Object> handle);
675 void Push(Smi* smi) { Push(Handle<Smi>(smi, isolate())); } 1250 void Push(Smi* smi) { Push(Handle<Smi>(smi, isolate())); }
676 1251
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 // 1474 //
900 // This method asserts that StackPointer() is not csp, since the call does 1475 // This method asserts that StackPointer() is not csp, since the call does
901 // not make sense in that context. 1476 // not make sense in that context.
902 inline void SyncSystemStackPointer(); 1477 inline void SyncSystemStackPointer();
903 1478
904 // Helpers ------------------------------------------------------------------ 1479 // Helpers ------------------------------------------------------------------
905 // Root register. 1480 // Root register.
906 inline void InitializeRootRegister(); 1481 inline void InitializeRootRegister();
907 1482
908 void AssertFPCRState(Register fpcr = NoReg); 1483 void AssertFPCRState(Register fpcr = NoReg);
909 void CanonicalizeNaN(const FPRegister& dst, const FPRegister& src); 1484 void CanonicalizeNaN(const VRegister& dst, const VRegister& src);
910 void CanonicalizeNaN(const FPRegister& reg) { 1485 void CanonicalizeNaN(const VRegister& reg) { CanonicalizeNaN(reg, reg); }
911 CanonicalizeNaN(reg, reg);
912 }
913 1486
914 // Load an object from the root table. 1487 // Load an object from the root table.
915 void LoadRoot(CPURegister destination, 1488 void LoadRoot(CPURegister destination,
916 Heap::RootListIndex index); 1489 Heap::RootListIndex index);
917 // Store an object to the root table. 1490 // Store an object to the root table.
918 void StoreRoot(Register source, 1491 void StoreRoot(Register source,
919 Heap::RootListIndex index); 1492 Heap::RootListIndex index);
920 1493
921 // Load both TrueValue and FalseValue roots. 1494 // Load both TrueValue and FalseValue roots.
922 void LoadTrueFalseRoots(Register true_root, Register false_root); 1495 void LoadTrueFalseRoots(Register true_root, Register false_root);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 void DecodeField(Register reg) { 1533 void DecodeField(Register reg) {
961 DecodeField<Field>(reg, reg); 1534 DecodeField<Field>(reg, reg);
962 } 1535 }
963 1536
964 // ---- SMI and Number Utilities ---- 1537 // ---- SMI and Number Utilities ----
965 1538
966 inline void SmiTag(Register dst, Register src); 1539 inline void SmiTag(Register dst, Register src);
967 inline void SmiTag(Register smi); 1540 inline void SmiTag(Register smi);
968 inline void SmiUntag(Register dst, Register src); 1541 inline void SmiUntag(Register dst, Register src);
969 inline void SmiUntag(Register smi); 1542 inline void SmiUntag(Register smi);
970 inline void SmiUntagToDouble(FPRegister dst, 1543 inline void SmiUntagToDouble(VRegister dst, Register src,
971 Register src,
972 UntagMode mode = kNotSpeculativeUntag); 1544 UntagMode mode = kNotSpeculativeUntag);
973 inline void SmiUntagToFloat(FPRegister dst, 1545 inline void SmiUntagToFloat(VRegister dst, Register src,
974 Register src,
975 UntagMode mode = kNotSpeculativeUntag); 1546 UntagMode mode = kNotSpeculativeUntag);
976 1547
977 // Tag and push in one step. 1548 // Tag and push in one step.
978 inline void SmiTagAndPush(Register src); 1549 inline void SmiTagAndPush(Register src);
979 inline void SmiTagAndPush(Register src1, Register src2); 1550 inline void SmiTagAndPush(Register src1, Register src2);
980 1551
981 inline void JumpIfSmi(Register value, 1552 inline void JumpIfSmi(Register value,
982 Label* smi_label, 1553 Label* smi_label,
983 Label* not_smi_label = NULL); 1554 Label* not_smi_label = NULL);
984 inline void JumpIfNotSmi(Register value, Label* not_smi_label); 1555 inline void JumpIfNotSmi(Register value, Label* not_smi_label);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 // Saturate a double in input to an unsigned 8-bit integer in output. 1630 // Saturate a double in input to an unsigned 8-bit integer in output.
1060 void ClampDoubleToUint8(Register output, 1631 void ClampDoubleToUint8(Register output,
1061 DoubleRegister input, 1632 DoubleRegister input,
1062 DoubleRegister dbl_scratch); 1633 DoubleRegister dbl_scratch);
1063 1634
1064 // Try to represent a double as a signed 32-bit int. 1635 // Try to represent a double as a signed 32-bit int.
1065 // This succeeds if the result compares equal to the input, so inputs of -0.0 1636 // This succeeds if the result compares equal to the input, so inputs of -0.0
1066 // are represented as 0 and handled as a success. 1637 // are represented as 0 and handled as a success.
1067 // 1638 //
1068 // On output the Z flag is set if the operation was successful. 1639 // On output the Z flag is set if the operation was successful.
1069 void TryRepresentDoubleAsInt32(Register as_int, 1640 void TryRepresentDoubleAsInt32(Register as_int, VRegister value,
1070 FPRegister value, 1641 VRegister scratch_d,
1071 FPRegister scratch_d,
1072 Label* on_successful_conversion = NULL, 1642 Label* on_successful_conversion = NULL,
1073 Label* on_failed_conversion = NULL) { 1643 Label* on_failed_conversion = NULL) {
1074 DCHECK(as_int.Is32Bits()); 1644 DCHECK(as_int.Is32Bits());
1075 TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion, 1645 TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion,
1076 on_failed_conversion); 1646 on_failed_conversion);
1077 } 1647 }
1078 1648
1079 // Try to represent a double as a signed 64-bit int. 1649 // Try to represent a double as a signed 64-bit int.
1080 // This succeeds if the result compares equal to the input, so inputs of -0.0 1650 // This succeeds if the result compares equal to the input, so inputs of -0.0
1081 // are represented as 0 and handled as a success. 1651 // are represented as 0 and handled as a success.
1082 // 1652 //
1083 // On output the Z flag is set if the operation was successful. 1653 // On output the Z flag is set if the operation was successful.
1084 void TryRepresentDoubleAsInt64(Register as_int, 1654 void TryRepresentDoubleAsInt64(Register as_int, VRegister value,
1085 FPRegister value, 1655 VRegister scratch_d,
1086 FPRegister scratch_d,
1087 Label* on_successful_conversion = NULL, 1656 Label* on_successful_conversion = NULL,
1088 Label* on_failed_conversion = NULL) { 1657 Label* on_failed_conversion = NULL) {
1089 DCHECK(as_int.Is64Bits()); 1658 DCHECK(as_int.Is64Bits());
1090 TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion, 1659 TryRepresentDoubleAsInt(as_int, value, scratch_d, on_successful_conversion,
1091 on_failed_conversion); 1660 on_failed_conversion);
1092 } 1661 }
1093 1662
1094 // ---- Object Utilities ---- 1663 // ---- Object Utilities ----
1095 1664
1096 // Initialize fields with filler values. Fields starting at |current_address| 1665 // Initialize fields with filler values. Fields starting at |current_address|
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 Register scratch, AllocationFlags flags); 1909 Register scratch, AllocationFlags flags);
1341 1910
1342 void FastAllocate(int object_size, Register result, Register scratch1, 1911 void FastAllocate(int object_size, Register result, Register scratch1,
1343 Register scratch2, AllocationFlags flags); 1912 Register scratch2, AllocationFlags flags);
1344 1913
1345 // Allocates a heap number or jumps to the gc_required label if the young 1914 // Allocates a heap number or jumps to the gc_required label if the young
1346 // space is full and a scavenge is needed. 1915 // space is full and a scavenge is needed.
1347 // All registers are clobbered. 1916 // All registers are clobbered.
1348 // If no heap_number_map register is provided, the function will take care of 1917 // If no heap_number_map register is provided, the function will take care of
1349 // loading it. 1918 // loading it.
1350 void AllocateHeapNumber(Register result, 1919 void AllocateHeapNumber(Register result, Label* gc_required,
1351 Label* gc_required, 1920 Register scratch1, Register scratch2,
1352 Register scratch1, 1921 CPURegister value = NoVReg,
1353 Register scratch2,
1354 CPURegister value = NoFPReg,
1355 CPURegister heap_number_map = NoReg, 1922 CPURegister heap_number_map = NoReg,
1356 MutableMode mode = IMMUTABLE); 1923 MutableMode mode = IMMUTABLE);
1357 1924
1358 // Allocate and initialize a JSValue wrapper with the specified {constructor} 1925 // Allocate and initialize a JSValue wrapper with the specified {constructor}
1359 // and {value}. 1926 // and {value}.
1360 void AllocateJSValue(Register result, Register constructor, Register value, 1927 void AllocateJSValue(Register result, Register constructor, Register value,
1361 Register scratch1, Register scratch2, 1928 Register scratch1, Register scratch2,
1362 Label* gc_required); 1929 Label* gc_required);
1363 1930
1364 // --------------------------------------------------------------------------- 1931 // ---------------------------------------------------------------------------
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1842 2409
1843 CPURegList* TmpList() { return &tmp_list_; } 2410 CPURegList* TmpList() { return &tmp_list_; }
1844 CPURegList* FPTmpList() { return &fptmp_list_; } 2411 CPURegList* FPTmpList() { return &fptmp_list_; }
1845 2412
1846 static CPURegList DefaultTmpList(); 2413 static CPURegList DefaultTmpList();
1847 static CPURegList DefaultFPTmpList(); 2414 static CPURegList DefaultFPTmpList();
1848 2415
1849 // Like printf, but print at run-time from generated code. 2416 // Like printf, but print at run-time from generated code.
1850 // 2417 //
1851 // The caller must ensure that arguments for floating-point placeholders 2418 // The caller must ensure that arguments for floating-point placeholders
1852 // (such as %e, %f or %g) are FPRegisters, and that arguments for integer 2419 // (such as %e, %f or %g) are VRegisters, and that arguments for integer
1853 // placeholders are Registers. 2420 // placeholders are Registers.
1854 // 2421 //
1855 // At the moment it is only possible to print the value of csp if it is the 2422 // At the moment it is only possible to print the value of csp if it is the
1856 // current stack pointer. Otherwise, the MacroAssembler will automatically 2423 // current stack pointer. Otherwise, the MacroAssembler will automatically
1857 // update csp on every push (using BumpSystemStackPointer), so determining its 2424 // update csp on every push (using BumpSystemStackPointer), so determining its
1858 // value is difficult. 2425 // value is difficult.
1859 // 2426 //
1860 // Format placeholders that refer to more than one argument, or to a specific 2427 // Format placeholders that refer to more than one argument, or to a specific
1861 // argument, are not supported. This includes formats like "%1$d" or "%.*d". 2428 // argument, are not supported. This includes formats like "%1$d" or "%.*d".
1862 // 2429 //
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 // block of registers. 2503 // block of registers.
1937 // 2504 //
1938 // Note that size is per register, and is specified in bytes. 2505 // Note that size is per register, and is specified in bytes.
1939 void PushHelper(int count, int size, 2506 void PushHelper(int count, int size,
1940 const CPURegister& src0, const CPURegister& src1, 2507 const CPURegister& src0, const CPURegister& src1,
1941 const CPURegister& src2, const CPURegister& src3); 2508 const CPURegister& src2, const CPURegister& src3);
1942 void PopHelper(int count, int size, 2509 void PopHelper(int count, int size,
1943 const CPURegister& dst0, const CPURegister& dst1, 2510 const CPURegister& dst0, const CPURegister& dst1,
1944 const CPURegister& dst2, const CPURegister& dst3); 2511 const CPURegister& dst2, const CPURegister& dst3);
1945 2512
2513 void Movi16bitHelper(const VRegister& vd, uint64_t imm);
2514 void Movi32bitHelper(const VRegister& vd, uint64_t imm);
2515 void Movi64bitHelper(const VRegister& vd, uint64_t imm);
2516
1946 // Call Printf. On a native build, a simple call will be generated, but if the 2517 // Call Printf. On a native build, a simple call will be generated, but if the
1947 // simulator is being used then a suitable pseudo-instruction is used. The 2518 // simulator is being used then a suitable pseudo-instruction is used. The
1948 // arguments and stack (csp) must be prepared by the caller as for a normal 2519 // arguments and stack (csp) must be prepared by the caller as for a normal
1949 // AAPCS64 call to 'printf'. 2520 // AAPCS64 call to 'printf'.
1950 // 2521 //
1951 // The 'args' argument should point to an array of variable arguments in their 2522 // The 'args' argument should point to an array of variable arguments in their
1952 // proper PCS registers (and in calling order). The argument registers can 2523 // proper PCS registers (and in calling order). The argument registers can
1953 // have mixed types. The format string (x0) should not be included. 2524 // have mixed types. The format string (x0) should not be included.
1954 void CallPrintf(int arg_count = 0, const CPURegister * args = NULL); 2525 void CallPrintf(int arg_count = 0, const CPURegister * args = NULL);
1955 2526
1956 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace. 2527 // Helper for implementing JumpIfNotInNewSpace and JumpIfInNewSpace.
1957 void InNewSpace(Register object, 2528 void InNewSpace(Register object,
1958 Condition cond, // eq for new space, ne otherwise. 2529 Condition cond, // eq for new space, ne otherwise.
1959 Label* branch); 2530 Label* branch);
1960 2531
1961 // Try to represent a double as an int so that integer fast-paths may be 2532 // Try to represent a double as an int so that integer fast-paths may be
1962 // used. Not every valid integer value is guaranteed to be caught. 2533 // used. Not every valid integer value is guaranteed to be caught.
1963 // It supports both 32-bit and 64-bit integers depending whether 'as_int' 2534 // It supports both 32-bit and 64-bit integers depending whether 'as_int'
1964 // is a W or X register. 2535 // is a W or X register.
1965 // 2536 //
1966 // This does not distinguish between +0 and -0, so if this distinction is 2537 // This does not distinguish between +0 and -0, so if this distinction is
1967 // important it must be checked separately. 2538 // important it must be checked separately.
1968 // 2539 //
1969 // On output the Z flag is set if the operation was successful. 2540 // On output the Z flag is set if the operation was successful.
1970 void TryRepresentDoubleAsInt(Register as_int, 2541 void TryRepresentDoubleAsInt(Register as_int, VRegister value,
1971 FPRegister value, 2542 VRegister scratch_d,
1972 FPRegister scratch_d,
1973 Label* on_successful_conversion = NULL, 2543 Label* on_successful_conversion = NULL,
1974 Label* on_failed_conversion = NULL); 2544 Label* on_failed_conversion = NULL);
1975 2545
1976 bool generating_stub_; 2546 bool generating_stub_;
1977 #if DEBUG 2547 #if DEBUG
1978 // Tell whether any of the macro instruction can be used. When false the 2548 // Tell whether any of the macro instruction can be used. When false the
1979 // MacroAssembler will assert if a method which can emit a variable number 2549 // MacroAssembler will assert if a method which can emit a variable number
1980 // of instructions is called. 2550 // of instructions is called.
1981 bool allow_macro_instructions_; 2551 bool allow_macro_instructions_;
1982 #endif 2552 #endif
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 // 2657 //
2088 // When the scope ends, the MacroAssembler's lists will be restored to their 2658 // When the scope ends, the MacroAssembler's lists will be restored to their
2089 // original state, even if the lists were modified by some other means. 2659 // original state, even if the lists were modified by some other means.
2090 class UseScratchRegisterScope { 2660 class UseScratchRegisterScope {
2091 public: 2661 public:
2092 explicit UseScratchRegisterScope(MacroAssembler* masm) 2662 explicit UseScratchRegisterScope(MacroAssembler* masm)
2093 : available_(masm->TmpList()), 2663 : available_(masm->TmpList()),
2094 availablefp_(masm->FPTmpList()), 2664 availablefp_(masm->FPTmpList()),
2095 old_available_(available_->list()), 2665 old_available_(available_->list()),
2096 old_availablefp_(availablefp_->list()) { 2666 old_availablefp_(availablefp_->list()) {
2097 DCHECK(available_->type() == CPURegister::kRegister); 2667 DCHECK_EQ(available_->type(), CPURegister::kRegister);
2098 DCHECK(availablefp_->type() == CPURegister::kFPRegister); 2668 DCHECK_EQ(availablefp_->type(), CPURegister::kVRegister);
2099 } 2669 }
2100 2670
2101 ~UseScratchRegisterScope(); 2671 ~UseScratchRegisterScope();
2102 2672
2103 // Take a register from the appropriate temps list. It will be returned 2673 // Take a register from the appropriate temps list. It will be returned
2104 // automatically when the scope ends. 2674 // automatically when the scope ends.
2105 Register AcquireW() { return AcquireNextAvailable(available_).W(); } 2675 Register AcquireW() { return AcquireNextAvailable(available_).W(); }
2106 Register AcquireX() { return AcquireNextAvailable(available_).X(); } 2676 Register AcquireX() { return AcquireNextAvailable(available_).X(); }
2107 FPRegister AcquireS() { return AcquireNextAvailable(availablefp_).S(); } 2677 VRegister AcquireS() { return AcquireNextAvailable(availablefp_).S(); }
2108 FPRegister AcquireD() { return AcquireNextAvailable(availablefp_).D(); } 2678 VRegister AcquireD() { return AcquireNextAvailable(availablefp_).D(); }
2109 2679
2110 Register UnsafeAcquire(const Register& reg) { 2680 Register UnsafeAcquire(const Register& reg) {
2111 return Register(UnsafeAcquire(available_, reg)); 2681 return Register(UnsafeAcquire(available_, reg));
2112 } 2682 }
2113 2683
2114 Register AcquireSameSizeAs(const Register& reg); 2684 Register AcquireSameSizeAs(const Register& reg);
2115 FPRegister AcquireSameSizeAs(const FPRegister& reg); 2685 VRegister AcquireSameSizeAs(const VRegister& reg);
2116 2686
2117 private: 2687 private:
2118 static CPURegister AcquireNextAvailable(CPURegList* available); 2688 static CPURegister AcquireNextAvailable(CPURegList* available);
2119 static CPURegister UnsafeAcquire(CPURegList* available, 2689 static CPURegister UnsafeAcquire(CPURegList* available,
2120 const CPURegister& reg); 2690 const CPURegister& reg);
2121 2691
2122 // Available scratch registers. 2692 // Available scratch registers.
2123 CPURegList* available_; // kRegister 2693 CPURegList* available_; // kRegister
2124 CPURegList* availablefp_; // kFPRegister 2694 CPURegList* availablefp_; // kVRegister
2125 2695
2126 // The state of the available lists at the start of this scope. 2696 // The state of the available lists at the start of this scope.
2127 RegList old_available_; // kRegister 2697 RegList old_available_; // kRegister
2128 RegList old_availablefp_; // kFPRegister 2698 RegList old_availablefp_; // kVRegister
2129 }; 2699 };
2130 2700
2131 2701
2132 inline MemOperand ContextMemOperand(Register context, int index = 0) { 2702 inline MemOperand ContextMemOperand(Register context, int index = 0) {
2133 return MemOperand(context, Context::SlotOffset(index)); 2703 return MemOperand(context, Context::SlotOffset(index));
2134 } 2704 }
2135 2705
2136 inline MemOperand NativeContextMemOperand() { 2706 inline MemOperand NativeContextMemOperand() {
2137 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); 2707 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX);
2138 } 2708 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
2185 class RegisterBits : public BitField<unsigned, 0, 5> {}; 2755 class RegisterBits : public BitField<unsigned, 0, 5> {};
2186 class DeltaBits : public BitField<uint32_t, 5, 32-5> {}; 2756 class DeltaBits : public BitField<uint32_t, 5, 32-5> {};
2187 }; 2757 };
2188 2758
2189 } // namespace internal 2759 } // namespace internal
2190 } // namespace v8 2760 } // namespace v8
2191 2761
2192 #define ACCESS_MASM(masm) masm-> 2762 #define ACCESS_MASM(masm) masm->
2193 2763
2194 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_ 2764 #endif // V8_ARM64_MACRO_ASSEMBLER_ARM64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698