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

Side by Side Diff: src/IceTargetLoweringARM32.h

Issue 1755333002: Subzero. ARM32. Fixes bugs uncovered by the llvm test suite. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 4 years, 9 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 | « src/IceInstARM32.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // minimal syntactic overhead, so that the lowering code can look as close to 318 // minimal syntactic overhead, so that the lowering code can look as close to
319 // assembly as practical. 319 // assembly as practical.
320 void _add(Variable *Dest, Variable *Src0, Operand *Src1, 320 void _add(Variable *Dest, Variable *Src0, Operand *Src1,
321 CondARM32::Cond Pred = CondARM32::AL) { 321 CondARM32::Cond Pred = CondARM32::AL) {
322 Context.insert<InstARM32Add>(Dest, Src0, Src1, Pred); 322 Context.insert<InstARM32Add>(Dest, Src0, Src1, Pred);
323 } 323 }
324 void _adds(Variable *Dest, Variable *Src0, Operand *Src1, 324 void _adds(Variable *Dest, Variable *Src0, Operand *Src1,
325 CondARM32::Cond Pred = CondARM32::AL) { 325 CondARM32::Cond Pred = CondARM32::AL) {
326 constexpr bool SetFlags = true; 326 constexpr bool SetFlags = true;
327 Context.insert<InstARM32Add>(Dest, Src0, Src1, Pred, SetFlags); 327 Context.insert<InstARM32Add>(Dest, Src0, Src1, Pred, SetFlags);
328 if (SetFlags) {
329 Context.insert<InstFakeUse>(Dest);
330 }
328 } 331 }
329 void _adc(Variable *Dest, Variable *Src0, Operand *Src1, 332 void _adc(Variable *Dest, Variable *Src0, Operand *Src1,
330 CondARM32::Cond Pred = CondARM32::AL) { 333 CondARM32::Cond Pred = CondARM32::AL) {
331 Context.insert<InstARM32Adc>(Dest, Src0, Src1, Pred); 334 Context.insert<InstARM32Adc>(Dest, Src0, Src1, Pred);
332 } 335 }
333 void _and(Variable *Dest, Variable *Src0, Operand *Src1, 336 void _and(Variable *Dest, Variable *Src0, Operand *Src1,
334 CondARM32::Cond Pred = CondARM32::AL) { 337 CondARM32::Cond Pred = CondARM32::AL) {
335 Context.insert<InstARM32And>(Dest, Src0, Src1, Pred); 338 Context.insert<InstARM32And>(Dest, Src0, Src1, Pred);
336 } 339 }
337 void _asr(Variable *Dest, Variable *Src0, Operand *Src1, 340 void _asr(Variable *Dest, Variable *Src0, Operand *Src1,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return Ldrex; 391 return Ldrex;
389 } 392 }
390 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, 393 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1,
391 CondARM32::Cond Pred = CondARM32::AL) { 394 CondARM32::Cond Pred = CondARM32::AL) {
392 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred); 395 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred);
393 } 396 }
394 void _lsls(Variable *Dest, Variable *Src0, Operand *Src1, 397 void _lsls(Variable *Dest, Variable *Src0, Operand *Src1,
395 CondARM32::Cond Pred = CondARM32::AL) { 398 CondARM32::Cond Pred = CondARM32::AL) {
396 constexpr bool SetFlags = true; 399 constexpr bool SetFlags = true;
397 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred, SetFlags); 400 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred, SetFlags);
401 if (SetFlags) {
402 Context.insert<InstFakeUse>(Dest);
403 }
398 } 404 }
399 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1, 405 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1,
400 CondARM32::Cond Pred = CondARM32::AL) { 406 CondARM32::Cond Pred = CondARM32::AL) {
401 Context.insert<InstARM32Lsr>(Dest, Src0, Src1, Pred); 407 Context.insert<InstARM32Lsr>(Dest, Src0, Src1, Pred);
402 } 408 }
403 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, 409 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc,
404 CondARM32::Cond Pred = CondARM32::AL) { 410 CondARM32::Cond Pred = CondARM32::AL) {
405 Context.insert<InstARM32Mla>(Dest, Src0, Src1, Acc, Pred); 411 Context.insert<InstARM32Mla>(Dest, Src0, Src1, Acc, Pred);
406 } 412 }
407 void _mls(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, 413 void _mls(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc,
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 Context.insert<InstARM32Mvn>(Dest, Src0, Pred); 710 Context.insert<InstARM32Mvn>(Dest, Src0, Pred);
705 } 711 }
706 void _orr(Variable *Dest, Variable *Src0, Operand *Src1, 712 void _orr(Variable *Dest, Variable *Src0, Operand *Src1,
707 CondARM32::Cond Pred = CondARM32::AL) { 713 CondARM32::Cond Pred = CondARM32::AL) {
708 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred); 714 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred);
709 } 715 }
710 void _orrs(Variable *Dest, Variable *Src0, Operand *Src1, 716 void _orrs(Variable *Dest, Variable *Src0, Operand *Src1,
711 CondARM32::Cond Pred = CondARM32::AL) { 717 CondARM32::Cond Pred = CondARM32::AL) {
712 constexpr bool SetFlags = true; 718 constexpr bool SetFlags = true;
713 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred, SetFlags); 719 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred, SetFlags);
720 if (SetFlags) {
721 Context.insert<InstFakeUse>(Dest);
722 }
714 } 723 }
715 void _push(const VarList &Sources) { Context.insert<InstARM32Push>(Sources); } 724 void _push(const VarList &Sources) { Context.insert<InstARM32Push>(Sources); }
716 void _pop(const VarList &Dests) { 725 void _pop(const VarList &Dests) {
717 Context.insert<InstARM32Pop>(Dests); 726 Context.insert<InstARM32Pop>(Dests);
718 // Mark dests as modified. 727 // Mark dests as modified.
719 for (Variable *Dest : Dests) 728 for (Variable *Dest : Dests)
720 Context.insert<InstFakeDef>(Dest); 729 Context.insert<InstFakeDef>(Dest);
721 } 730 }
722 void _rbit(Variable *Dest, Variable *Src0, 731 void _rbit(Variable *Dest, Variable *Src0,
723 CondARM32::Cond Pred = CondARM32::AL) { 732 CondARM32::Cond Pred = CondARM32::AL) {
724 Context.insert<InstARM32Rbit>(Dest, Src0, Pred); 733 Context.insert<InstARM32Rbit>(Dest, Src0, Pred);
725 } 734 }
726 void _rev(Variable *Dest, Variable *Src0, 735 void _rev(Variable *Dest, Variable *Src0,
727 CondARM32::Cond Pred = CondARM32::AL) { 736 CondARM32::Cond Pred = CondARM32::AL) {
728 Context.insert<InstARM32Rev>(Dest, Src0, Pred); 737 Context.insert<InstARM32Rev>(Dest, Src0, Pred);
729 } 738 }
730 void _ret(Variable *LR, Variable *Src0 = nullptr) { 739 void _ret(Variable *LR, Variable *Src0 = nullptr) {
731 Context.insert<InstARM32Ret>(LR, Src0); 740 Context.insert<InstARM32Ret>(LR, Src0);
732 } 741 }
733 void _rscs(Variable *Dest, Variable *Src0, Operand *Src1, 742 void _rscs(Variable *Dest, Variable *Src0, Operand *Src1,
734 CondARM32::Cond Pred = CondARM32::AL) { 743 CondARM32::Cond Pred = CondARM32::AL) {
735 constexpr bool SetFlags = true; 744 constexpr bool SetFlags = true;
736 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred, SetFlags); 745 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred, SetFlags);
746 if (SetFlags) {
747 Context.insert<InstFakeUse>(Dest);
748 }
737 } 749 }
738 void _rsc(Variable *Dest, Variable *Src0, Operand *Src1, 750 void _rsc(Variable *Dest, Variable *Src0, Operand *Src1,
739 CondARM32::Cond Pred = CondARM32::AL) { 751 CondARM32::Cond Pred = CondARM32::AL) {
740 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred); 752 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred);
741 } 753 }
742 void _rsbs(Variable *Dest, Variable *Src0, Operand *Src1, 754 void _rsbs(Variable *Dest, Variable *Src0, Operand *Src1,
743 CondARM32::Cond Pred = CondARM32::AL) { 755 CondARM32::Cond Pred = CondARM32::AL) {
744 constexpr bool SetFlags = true; 756 constexpr bool SetFlags = true;
745 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred, SetFlags); 757 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred, SetFlags);
758 if (SetFlags) {
759 Context.insert<InstFakeUse>(Dest);
760 }
746 } 761 }
747 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1, 762 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1,
748 CondARM32::Cond Pred = CondARM32::AL) { 763 CondARM32::Cond Pred = CondARM32::AL) {
749 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred); 764 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred);
750 } 765 }
751 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1, 766 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1,
752 CondARM32::Cond Pred = CondARM32::AL) { 767 CondARM32::Cond Pred = CondARM32::AL) {
753 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred); 768 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred);
754 } 769 }
755 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1, 770 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1,
756 CondARM32::Cond Pred = CondARM32::AL) { 771 CondARM32::Cond Pred = CondARM32::AL) {
757 constexpr bool SetFlags = true; 772 constexpr bool SetFlags = true;
758 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred, SetFlags); 773 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred, SetFlags);
774 if (SetFlags) {
775 Context.insert<InstFakeUse>(Dest);
776 }
759 } 777 }
760 void _sdiv(Variable *Dest, Variable *Src0, Variable *Src1, 778 void _sdiv(Variable *Dest, Variable *Src0, Variable *Src1,
761 CondARM32::Cond Pred = CondARM32::AL) { 779 CondARM32::Cond Pred = CondARM32::AL) {
762 Context.insert<InstARM32Sdiv>(Dest, Src0, Src1, Pred); 780 Context.insert<InstARM32Sdiv>(Dest, Src0, Src1, Pred);
763 } 781 }
764 /// _str, for all your Variable to memory transfers. Addr has the same 782 /// _str, for all your Variable to memory transfers. Addr has the same
765 /// restrictions that it does in _ldr. 783 /// restrictions that it does in _ldr.
766 void _str(Variable *Value, OperandARM32Mem *Addr, 784 void _str(Variable *Value, OperandARM32Mem *Addr,
767 CondARM32::Cond Pred = CondARM32::AL) { 785 CondARM32::Cond Pred = CondARM32::AL) {
768 Context.insert<InstARM32Str>(Value, Addr, Pred); 786 Context.insert<InstARM32Str>(Value, Addr, Pred);
(...skipping 12 matching lines...) Expand all
781 Instr->setDestRedefined(); 799 Instr->setDestRedefined();
782 } 800 }
783 void _sub(Variable *Dest, Variable *Src0, Operand *Src1, 801 void _sub(Variable *Dest, Variable *Src0, Operand *Src1,
784 CondARM32::Cond Pred = CondARM32::AL) { 802 CondARM32::Cond Pred = CondARM32::AL) {
785 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred); 803 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred);
786 } 804 }
787 void _subs(Variable *Dest, Variable *Src0, Operand *Src1, 805 void _subs(Variable *Dest, Variable *Src0, Operand *Src1,
788 CondARM32::Cond Pred = CondARM32::AL) { 806 CondARM32::Cond Pred = CondARM32::AL) {
789 constexpr bool SetFlags = true; 807 constexpr bool SetFlags = true;
790 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred, SetFlags); 808 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred, SetFlags);
809 if (SetFlags) {
810 Context.insert<InstFakeUse>(Dest);
811 }
791 } 812 }
792 void _sxt(Variable *Dest, Variable *Src0, 813 void _sxt(Variable *Dest, Variable *Src0,
793 CondARM32::Cond Pred = CondARM32::AL) { 814 CondARM32::Cond Pred = CondARM32::AL) {
794 Context.insert<InstARM32Sxt>(Dest, Src0, Pred); 815 Context.insert<InstARM32Sxt>(Dest, Src0, Pred);
795 } 816 }
796 void _tst(Variable *Src0, Operand *Src1, 817 void _tst(Variable *Src0, Operand *Src1,
797 CondARM32::Cond Pred = CondARM32::AL) { 818 CondARM32::Cond Pred = CondARM32::AL) {
798 Context.insert<InstARM32Tst>(Src0, Src1, Pred); 819 Context.insert<InstARM32Tst>(Src0, Src1, Pred);
799 } 820 }
800 void _trap() { Context.insert<InstARM32Trap>(); } 821 void _trap() { Context.insert<InstARM32Trap>(); }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 private: 1331 private:
1311 ~TargetHeaderARM32() = default; 1332 ~TargetHeaderARM32() = default;
1312 1333
1313 TargetARM32Features CPUFeatures; 1334 TargetARM32Features CPUFeatures;
1314 }; 1335 };
1315 1336
1316 } // end of namespace ARM32 1337 } // end of namespace ARM32
1317 } // end of namespace Ice 1338 } // end of namespace Ice
1318 1339
1319 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 1340 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW
« no previous file with comments | « src/IceInstARM32.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698