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

Side by Side Diff: src/assembler_ia32.h

Issue 604873003: Handle add, adc, etc., mfence, div, idiv, mul in the assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 2 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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Modified by the Subzero authors. 5 // Modified by the Subzero authors.
6 // 6 //
7 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ----------------===// 7 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ----------------===//
8 // 8 //
9 // The Subzero Code Generator 9 // The Subzero Code Generator
10 // 10 //
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 void cmpl(GPRRegister reg, const Immediate &imm); 565 void cmpl(GPRRegister reg, const Immediate &imm);
566 void cmpl(GPRRegister reg0, GPRRegister reg1); 566 void cmpl(GPRRegister reg0, GPRRegister reg1);
567 void cmpl(GPRRegister reg, const Address &address); 567 void cmpl(GPRRegister reg, const Address &address);
568 void cmpl(const Address &address, GPRRegister reg); 568 void cmpl(const Address &address, GPRRegister reg);
569 void cmpl(const Address &address, const Immediate &imm); 569 void cmpl(const Address &address, const Immediate &imm);
570 void cmpb(const Address &address, const Immediate &imm); 570 void cmpb(const Address &address, const Immediate &imm);
571 571
572 void testl(GPRRegister reg1, GPRRegister reg2); 572 void testl(GPRRegister reg1, GPRRegister reg2);
573 void testl(GPRRegister reg, const Immediate &imm); 573 void testl(GPRRegister reg, const Immediate &imm);
574 574
575 void andl(GPRRegister dst, const Immediate &imm); 575 void And(Type Ty, GPRRegister dst, GPRRegister src);
576 void andl(GPRRegister dst, GPRRegister src); 576 void And(Type Ty, GPRRegister dst, const Address &address);
577 void andl(GPRRegister dst, const Address &address); 577 void And(Type Ty, GPRRegister dst, const Immediate &imm);
578 578
579 void orl(GPRRegister dst, const Immediate &imm); 579 void Or(Type Ty, GPRRegister dst, GPRRegister src);
580 void orl(GPRRegister dst, GPRRegister src); 580 void Or(Type Ty, GPRRegister dst, const Address &address);
581 void orl(GPRRegister dst, const Address &address); 581 void Or(Type Ty, GPRRegister dst, const Immediate &imm);
582 582
583 void xorl(GPRRegister dst, const Immediate &imm); 583 void Xor(Type Ty, GPRRegister dst, GPRRegister src);
584 void xorl(GPRRegister dst, GPRRegister src); 584 void Xor(Type Ty, GPRRegister dst, const Address &address);
585 void xorl(GPRRegister dst, const Address &address); 585 void Xor(Type Ty, GPRRegister dst, const Immediate &imm);
586 586
587 void addl(GPRRegister dst, GPRRegister src); 587 void add(Type Ty, GPRRegister dst, GPRRegister src);
588 void addl(GPRRegister reg, const Immediate &imm); 588 void add(Type Ty, GPRRegister reg, const Address &address);
589 void addl(GPRRegister reg, const Address &address); 589 void add(Type Ty, GPRRegister reg, const Immediate &imm);
590 590
591 void addl(const Address &address, GPRRegister reg); 591 void adc(Type Ty, GPRRegister dst, GPRRegister src);
592 void addl(const Address &address, const Immediate &imm); 592 void adc(Type Ty, GPRRegister dst, const Address &address);
593 void adc(Type Ty, GPRRegister reg, const Immediate &imm);
593 594
594 void adcl(GPRRegister dst, GPRRegister src); 595 void sub(Type Ty, GPRRegister dst, GPRRegister src);
595 void adcl(GPRRegister reg, const Immediate &imm); 596 void sub(Type Ty, GPRRegister reg, const Address &address);
596 void adcl(GPRRegister dst, const Address &address); 597 void sub(Type Ty, GPRRegister reg, const Immediate &imm);
597 void adcl(const Address &dst, GPRRegister src);
598 598
599 void subl(GPRRegister dst, GPRRegister src); 599 void sbb(Type Ty, GPRRegister dst, GPRRegister src);
600 void subl(GPRRegister reg, const Immediate &imm); 600 void sbb(Type Ty, GPRRegister reg, const Address &address);
601 void subl(GPRRegister reg, const Address &address); 601 void sbb(Type Ty, GPRRegister reg, const Immediate &imm);
602 void subl(const Address &address, GPRRegister reg);
603 602
604 void cbw(); 603 void cbw();
605 void cwd(); 604 void cwd();
606 void cdq(); 605 void cdq();
607 606
608 void idivl(GPRRegister reg); 607 void div(Type Ty, GPRRegister reg);
608 void div(Type Ty, const Address &address);
609
610 void idiv(Type Ty, GPRRegister reg);
611 void idiv(Type Ty, const Address &address);
609 612
610 void imull(GPRRegister dst, GPRRegister src); 613 void imull(GPRRegister dst, GPRRegister src);
611 void imull(GPRRegister reg, const Immediate &imm); 614 void imull(GPRRegister reg, const Immediate &imm);
612 void imull(GPRRegister reg, const Address &address); 615 void imull(GPRRegister reg, const Address &address);
613 616
614 void imull(GPRRegister reg); 617 void imull(GPRRegister reg);
615 void imull(const Address &address); 618 void imull(const Address &address);
616 619
617 void mull(GPRRegister reg); 620 void mul(Type Ty, GPRRegister reg);
618 void mull(const Address &address); 621 void mul(Type Ty, const Address &address);
619
620 void sbbl(GPRRegister dst, GPRRegister src);
621 void sbbl(GPRRegister reg, const Immediate &imm);
622 void sbbl(GPRRegister reg, const Address &address);
623 void sbbl(const Address &address, GPRRegister reg);
624 622
625 void incl(GPRRegister reg); 623 void incl(GPRRegister reg);
626 void incl(const Address &address); 624 void incl(const Address &address);
627 625
628 void decl(GPRRegister reg); 626 void decl(GPRRegister reg);
629 void decl(const Address &address); 627 void decl(const Address &address);
630 628
631 void shll(GPRRegister reg, const Immediate &imm); 629 void shll(GPRRegister reg, const Immediate &imm);
632 void shll(GPRRegister operand, GPRRegister shifter); 630 void shll(GPRRegister operand, GPRRegister shifter);
633 void shll(const Address &operand, GPRRegister shifter); 631 void shll(const Address &operand, GPRRegister shifter);
(...skipping 30 matching lines...) Expand all
664 void int3(); 662 void int3();
665 void hlt(); 663 void hlt();
666 664
667 void j(CondX86::BrCond condition, Label *label, bool near = kFarJump); 665 void j(CondX86::BrCond condition, Label *label, bool near = kFarJump);
668 void j(CondX86::BrCond condition, const ConstantRelocatable *label); 666 void j(CondX86::BrCond condition, const ConstantRelocatable *label);
669 667
670 void jmp(GPRRegister reg); 668 void jmp(GPRRegister reg);
671 void jmp(Label *label, bool near = kFarJump); 669 void jmp(Label *label, bool near = kFarJump);
672 void jmp(const ConstantRelocatable *label); 670 void jmp(const ConstantRelocatable *label);
673 671
672 void mfence();
673
674 void lock(); 674 void lock();
675 void cmpxchg(Type Ty, const Address &address, GPRRegister reg); 675 void cmpxchg(Type Ty, const Address &address, GPRRegister reg);
676 void cmpxchg8b(const Address &address); 676 void cmpxchg8b(const Address &address);
677 void xadd(Type Ty, const Address &address, GPRRegister reg); 677 void xadd(Type Ty, const Address &address, GPRRegister reg);
678 void xchg(Type Ty, const Address &address, GPRRegister reg); 678 void xchg(Type Ty, const Address &address, GPRRegister reg);
679 679
680 void LockCmpxchg(Type Ty, const Address &address, GPRRegister reg) { 680 void LockCmpxchg(Type Ty, const Address &address, GPRRegister reg) {
681 lock(); 681 lock();
682 cmpxchg(Ty, address, reg); 682 cmpxchg(Ty, address, reg);
683 } 683 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) { 745 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) {
746 buffer_.EmitFixup(fixup); 746 buffer_.EmitFixup(fixup);
747 } 747 }
748 748
749 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); } 749 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); }
750 750
751 } // end of namespace x86 751 } // end of namespace x86
752 } // end of namespace Ice 752 } // end of namespace Ice
753 753
754 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_ 754 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698