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

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: make format; adds more lit tests (arm 64 bit) 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
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 Context.insert<InstFakeUse>(Dest);
Jim Stichnoth 2016/03/02 22:58:30 Optional. This pattern might be more self-documen
John 2016/03/02 23:02:44 Done.
328 } 329 }
329 void _adc(Variable *Dest, Variable *Src0, Operand *Src1, 330 void _adc(Variable *Dest, Variable *Src0, Operand *Src1,
330 CondARM32::Cond Pred = CondARM32::AL) { 331 CondARM32::Cond Pred = CondARM32::AL) {
331 Context.insert<InstARM32Adc>(Dest, Src0, Src1, Pred); 332 Context.insert<InstARM32Adc>(Dest, Src0, Src1, Pred);
332 } 333 }
333 void _and(Variable *Dest, Variable *Src0, Operand *Src1, 334 void _and(Variable *Dest, Variable *Src0, Operand *Src1,
334 CondARM32::Cond Pred = CondARM32::AL) { 335 CondARM32::Cond Pred = CondARM32::AL) {
335 Context.insert<InstARM32And>(Dest, Src0, Src1, Pred); 336 Context.insert<InstARM32And>(Dest, Src0, Src1, Pred);
336 } 337 }
337 void _asr(Variable *Dest, Variable *Src0, Operand *Src1, 338 void _asr(Variable *Dest, Variable *Src0, Operand *Src1,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return Ldrex; 389 return Ldrex;
389 } 390 }
390 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, 391 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1,
391 CondARM32::Cond Pred = CondARM32::AL) { 392 CondARM32::Cond Pred = CondARM32::AL) {
392 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred); 393 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred);
393 } 394 }
394 void _lsls(Variable *Dest, Variable *Src0, Operand *Src1, 395 void _lsls(Variable *Dest, Variable *Src0, Operand *Src1,
395 CondARM32::Cond Pred = CondARM32::AL) { 396 CondARM32::Cond Pred = CondARM32::AL) {
396 constexpr bool SetFlags = true; 397 constexpr bool SetFlags = true;
397 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred, SetFlags); 398 Context.insert<InstARM32Lsl>(Dest, Src0, Src1, Pred, SetFlags);
399 Context.insert<InstFakeUse>(Dest);
398 } 400 }
399 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1, 401 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1,
400 CondARM32::Cond Pred = CondARM32::AL) { 402 CondARM32::Cond Pred = CondARM32::AL) {
401 Context.insert<InstARM32Lsr>(Dest, Src0, Src1, Pred); 403 Context.insert<InstARM32Lsr>(Dest, Src0, Src1, Pred);
402 } 404 }
403 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, 405 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc,
404 CondARM32::Cond Pred = CondARM32::AL) { 406 CondARM32::Cond Pred = CondARM32::AL) {
405 Context.insert<InstARM32Mla>(Dest, Src0, Src1, Acc, Pred); 407 Context.insert<InstARM32Mla>(Dest, Src0, Src1, Acc, Pred);
406 } 408 }
407 void _mls(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, 409 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); 706 Context.insert<InstARM32Mvn>(Dest, Src0, Pred);
705 } 707 }
706 void _orr(Variable *Dest, Variable *Src0, Operand *Src1, 708 void _orr(Variable *Dest, Variable *Src0, Operand *Src1,
707 CondARM32::Cond Pred = CondARM32::AL) { 709 CondARM32::Cond Pred = CondARM32::AL) {
708 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred); 710 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred);
709 } 711 }
710 void _orrs(Variable *Dest, Variable *Src0, Operand *Src1, 712 void _orrs(Variable *Dest, Variable *Src0, Operand *Src1,
711 CondARM32::Cond Pred = CondARM32::AL) { 713 CondARM32::Cond Pred = CondARM32::AL) {
712 constexpr bool SetFlags = true; 714 constexpr bool SetFlags = true;
713 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred, SetFlags); 715 Context.insert<InstARM32Orr>(Dest, Src0, Src1, Pred, SetFlags);
716 Context.insert<InstFakeUse>(Dest);
714 } 717 }
715 void _push(const VarList &Sources) { Context.insert<InstARM32Push>(Sources); } 718 void _push(const VarList &Sources) { Context.insert<InstARM32Push>(Sources); }
716 void _pop(const VarList &Dests) { 719 void _pop(const VarList &Dests) {
717 Context.insert<InstARM32Pop>(Dests); 720 Context.insert<InstARM32Pop>(Dests);
718 // Mark dests as modified. 721 // Mark dests as modified.
719 for (Variable *Dest : Dests) 722 for (Variable *Dest : Dests)
720 Context.insert<InstFakeDef>(Dest); 723 Context.insert<InstFakeDef>(Dest);
721 } 724 }
722 void _rbit(Variable *Dest, Variable *Src0, 725 void _rbit(Variable *Dest, Variable *Src0,
723 CondARM32::Cond Pred = CondARM32::AL) { 726 CondARM32::Cond Pred = CondARM32::AL) {
724 Context.insert<InstARM32Rbit>(Dest, Src0, Pred); 727 Context.insert<InstARM32Rbit>(Dest, Src0, Pred);
725 } 728 }
726 void _rev(Variable *Dest, Variable *Src0, 729 void _rev(Variable *Dest, Variable *Src0,
727 CondARM32::Cond Pred = CondARM32::AL) { 730 CondARM32::Cond Pred = CondARM32::AL) {
728 Context.insert<InstARM32Rev>(Dest, Src0, Pred); 731 Context.insert<InstARM32Rev>(Dest, Src0, Pred);
729 } 732 }
730 void _ret(Variable *LR, Variable *Src0 = nullptr) { 733 void _ret(Variable *LR, Variable *Src0 = nullptr) {
731 Context.insert<InstARM32Ret>(LR, Src0); 734 Context.insert<InstARM32Ret>(LR, Src0);
732 } 735 }
733 void _rscs(Variable *Dest, Variable *Src0, Operand *Src1, 736 void _rscs(Variable *Dest, Variable *Src0, Operand *Src1,
734 CondARM32::Cond Pred = CondARM32::AL) { 737 CondARM32::Cond Pred = CondARM32::AL) {
735 constexpr bool SetFlags = true; 738 constexpr bool SetFlags = true;
736 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred, SetFlags); 739 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred, SetFlags);
740 Context.insert<InstFakeUse>(Dest);
737 } 741 }
738 void _rsc(Variable *Dest, Variable *Src0, Operand *Src1, 742 void _rsc(Variable *Dest, Variable *Src0, Operand *Src1,
739 CondARM32::Cond Pred = CondARM32::AL) { 743 CondARM32::Cond Pred = CondARM32::AL) {
740 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred); 744 Context.insert<InstARM32Rsc>(Dest, Src0, Src1, Pred);
741 } 745 }
742 void _rsbs(Variable *Dest, Variable *Src0, Operand *Src1, 746 void _rsbs(Variable *Dest, Variable *Src0, Operand *Src1,
743 CondARM32::Cond Pred = CondARM32::AL) { 747 CondARM32::Cond Pred = CondARM32::AL) {
744 constexpr bool SetFlags = true; 748 constexpr bool SetFlags = true;
745 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred, SetFlags); 749 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred, SetFlags);
750 Context.insert<InstFakeUse>(Dest);
746 } 751 }
747 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1, 752 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1,
748 CondARM32::Cond Pred = CondARM32::AL) { 753 CondARM32::Cond Pred = CondARM32::AL) {
749 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred); 754 Context.insert<InstARM32Rsb>(Dest, Src0, Src1, Pred);
750 } 755 }
751 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1, 756 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1,
752 CondARM32::Cond Pred = CondARM32::AL) { 757 CondARM32::Cond Pred = CondARM32::AL) {
753 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred); 758 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred);
754 } 759 }
755 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1, 760 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1,
756 CondARM32::Cond Pred = CondARM32::AL) { 761 CondARM32::Cond Pred = CondARM32::AL) {
757 constexpr bool SetFlags = true; 762 constexpr bool SetFlags = true;
758 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred, SetFlags); 763 Context.insert<InstARM32Sbc>(Dest, Src0, Src1, Pred, SetFlags);
764 Context.insert<InstFakeUse>(Dest);
759 } 765 }
760 void _sdiv(Variable *Dest, Variable *Src0, Variable *Src1, 766 void _sdiv(Variable *Dest, Variable *Src0, Variable *Src1,
761 CondARM32::Cond Pred = CondARM32::AL) { 767 CondARM32::Cond Pred = CondARM32::AL) {
762 Context.insert<InstARM32Sdiv>(Dest, Src0, Src1, Pred); 768 Context.insert<InstARM32Sdiv>(Dest, Src0, Src1, Pred);
763 } 769 }
764 /// _str, for all your Variable to memory transfers. Addr has the same 770 /// _str, for all your Variable to memory transfers. Addr has the same
765 /// restrictions that it does in _ldr. 771 /// restrictions that it does in _ldr.
766 void _str(Variable *Value, OperandARM32Mem *Addr, 772 void _str(Variable *Value, OperandARM32Mem *Addr,
767 CondARM32::Cond Pred = CondARM32::AL) { 773 CondARM32::Cond Pred = CondARM32::AL) {
768 Context.insert<InstARM32Str>(Value, Addr, Pred); 774 Context.insert<InstARM32Str>(Value, Addr, Pred);
(...skipping 12 matching lines...) Expand all
781 Instr->setDestRedefined(); 787 Instr->setDestRedefined();
782 } 788 }
783 void _sub(Variable *Dest, Variable *Src0, Operand *Src1, 789 void _sub(Variable *Dest, Variable *Src0, Operand *Src1,
784 CondARM32::Cond Pred = CondARM32::AL) { 790 CondARM32::Cond Pred = CondARM32::AL) {
785 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred); 791 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred);
786 } 792 }
787 void _subs(Variable *Dest, Variable *Src0, Operand *Src1, 793 void _subs(Variable *Dest, Variable *Src0, Operand *Src1,
788 CondARM32::Cond Pred = CondARM32::AL) { 794 CondARM32::Cond Pred = CondARM32::AL) {
789 constexpr bool SetFlags = true; 795 constexpr bool SetFlags = true;
790 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred, SetFlags); 796 Context.insert<InstARM32Sub>(Dest, Src0, Src1, Pred, SetFlags);
797 Context.insert<InstFakeUse>(Dest);
791 } 798 }
792 void _sxt(Variable *Dest, Variable *Src0, 799 void _sxt(Variable *Dest, Variable *Src0,
793 CondARM32::Cond Pred = CondARM32::AL) { 800 CondARM32::Cond Pred = CondARM32::AL) {
794 Context.insert<InstARM32Sxt>(Dest, Src0, Pred); 801 Context.insert<InstARM32Sxt>(Dest, Src0, Pred);
795 } 802 }
796 void _tst(Variable *Src0, Operand *Src1, 803 void _tst(Variable *Src0, Operand *Src1,
797 CondARM32::Cond Pred = CondARM32::AL) { 804 CondARM32::Cond Pred = CondARM32::AL) {
798 Context.insert<InstARM32Tst>(Src0, Src1, Pred); 805 Context.insert<InstARM32Tst>(Src0, Src1, Pred);
799 } 806 }
800 void _trap() { Context.insert<InstARM32Trap>(); } 807 void _trap() { Context.insert<InstARM32Trap>(); }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 private: 1317 private:
1311 ~TargetHeaderARM32() = default; 1318 ~TargetHeaderARM32() = default;
1312 1319
1313 TargetARM32Features CPUFeatures; 1320 TargetARM32Features CPUFeatures;
1314 }; 1321 };
1315 1322
1316 } // end of namespace ARM32 1323 } // end of namespace ARM32
1317 } // end of namespace Ice 1324 } // end of namespace Ice
1318 1325
1319 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 1326 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698