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

Side by Side Diff: src/IceTargetLoweringARM32.h

Issue 1438773004: Subzero. ARM32. Improve constant lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes the lit tests. Double is too precise. Created 5 years, 1 month 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 void postLower() override; 136 void postLower() override;
137 137
138 enum SafeBoolChain { 138 enum SafeBoolChain {
139 SBC_No, 139 SBC_No,
140 SBC_Yes, 140 SBC_Yes,
141 }; 141 };
142 142
143 void lowerAlloca(const InstAlloca *Inst) override; 143 void lowerAlloca(const InstAlloca *Inst) override;
144 SafeBoolChain lowerInt1Arithmetic(const InstArithmetic *Inst); 144 SafeBoolChain lowerInt1Arithmetic(const InstArithmetic *Inst);
145 void lowerInt64Arithmetic(InstArithmetic::OpKind Op, Variable *Dest,
146 Operand *Src0, Operand *Src1);
145 void lowerArithmetic(const InstArithmetic *Inst) override; 147 void lowerArithmetic(const InstArithmetic *Inst) override;
146 void lowerAssign(const InstAssign *Inst) override; 148 void lowerAssign(const InstAssign *Inst) override;
147 void lowerBr(const InstBr *Inst) override; 149 void lowerBr(const InstBr *Inst) override;
148 void lowerCall(const InstCall *Inst) override; 150 void lowerCall(const InstCall *Inst) override;
149 void lowerCast(const InstCast *Inst) override; 151 void lowerCast(const InstCast *Inst) override;
150 void lowerExtractElement(const InstExtractElement *Inst) override; 152 void lowerExtractElement(const InstExtractElement *Inst) override;
151 153
152 /// CondWhenTrue is a helper type returned by every method in the lowering 154 /// CondWhenTrue is a helper type returned by every method in the lowering
153 /// that emits code to set the condition codes. 155 /// that emits code to set the condition codes.
154 class CondWhenTrue { 156 class CondWhenTrue {
(...skipping 18 matching lines...) Expand all
173 case CondARM32::AL: 175 case CondARM32::AL:
174 return CondWhenTrue(CondARM32::kNone); 176 return CondWhenTrue(CondARM32::kNone);
175 case CondARM32::kNone: 177 case CondARM32::kNone:
176 return CondWhenTrue(CondARM32::AL); 178 return CondWhenTrue(CondARM32::AL);
177 } 179 }
178 } 180 }
179 }; 181 };
180 182
181 CondWhenTrue lowerFcmpCond(const InstFcmp *Instr); 183 CondWhenTrue lowerFcmpCond(const InstFcmp *Instr);
182 void lowerFcmp(const InstFcmp *Instr) override; 184 void lowerFcmp(const InstFcmp *Instr) override;
185 CondWhenTrue lowerInt64IcmpCond(InstIcmp::ICond Condition, Operand *Src0,
186 Operand *Src1);
183 CondWhenTrue lowerIcmpCond(const InstIcmp *Instr); 187 CondWhenTrue lowerIcmpCond(const InstIcmp *Instr);
184 void lowerIcmp(const InstIcmp *Instr) override; 188 void lowerIcmp(const InstIcmp *Instr) override;
185 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, 189 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr,
186 Operand *Val); 190 Operand *Val);
187 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override; 191 void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override;
188 void lowerInsertElement(const InstInsertElement *Inst) override; 192 void lowerInsertElement(const InstInsertElement *Inst) override;
189 void lowerLoad(const InstLoad *Inst) override; 193 void lowerLoad(const InstLoad *Inst) override;
190 void lowerPhi(const InstPhi *Inst) override; 194 void lowerPhi(const InstPhi *Inst) override;
191 void lowerRet(const InstRet *Inst) override; 195 void lowerRet(const InstRet *Inst) override;
192 void lowerSelect(const InstSelect *Inst) override; 196 void lowerSelect(const InstSelect *Inst) override;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 Context.insert(InstARM32Ldrex::create(Func, Dest, Addr, Pred)); 317 Context.insert(InstARM32Ldrex::create(Func, Dest, Addr, Pred));
314 if (auto *Dest64 = llvm::dyn_cast<Variable64On32>(Dest)) { 318 if (auto *Dest64 = llvm::dyn_cast<Variable64On32>(Dest)) {
315 Context.insert(InstFakeDef::create(Func, Dest64->getLo(), Dest)); 319 Context.insert(InstFakeDef::create(Func, Dest64->getLo(), Dest));
316 Context.insert(InstFakeDef::create(Func, Dest64->getHi(), Dest)); 320 Context.insert(InstFakeDef::create(Func, Dest64->getHi(), Dest));
317 } 321 }
318 } 322 }
319 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1, 323 void _lsl(Variable *Dest, Variable *Src0, Operand *Src1,
320 CondARM32::Cond Pred = CondARM32::AL) { 324 CondARM32::Cond Pred = CondARM32::AL) {
321 Context.insert(InstARM32Lsl::create(Func, Dest, Src0, Src1, Pred)); 325 Context.insert(InstARM32Lsl::create(Func, Dest, Src0, Src1, Pred));
322 } 326 }
327 void _lsls(Variable *Dest, Variable *Src0, Operand *Src1,
328 CondARM32::Cond Pred = CondARM32::AL) {
329 constexpr bool SetFlags = true;
330 Context.insert(
331 InstARM32Lsl::create(Func, Dest, Src0, Src1, Pred, SetFlags));
332 }
323 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1, 333 void _lsr(Variable *Dest, Variable *Src0, Operand *Src1,
324 CondARM32::Cond Pred = CondARM32::AL) { 334 CondARM32::Cond Pred = CondARM32::AL) {
325 Context.insert(InstARM32Lsr::create(Func, Dest, Src0, Src1, Pred)); 335 Context.insert(InstARM32Lsr::create(Func, Dest, Src0, Src1, Pred));
326 } 336 }
327 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, 337 void _mla(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc,
328 CondARM32::Cond Pred = CondARM32::AL) { 338 CondARM32::Cond Pred = CondARM32::AL) {
329 Context.insert(InstARM32Mla::create(Func, Dest, Src0, Src1, Acc, Pred)); 339 Context.insert(InstARM32Mla::create(Func, Dest, Src0, Src1, Acc, Pred));
330 } 340 }
331 void _mls(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc, 341 void _mls(Variable *Dest, Variable *Src0, Variable *Src1, Variable *Acc,
332 CondARM32::Cond Pred = CondARM32::AL) { 342 CondARM32::Cond Pred = CondARM32::AL) {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 CondARM32::Cond Pred = CondARM32::AL) { 645 CondARM32::Cond Pred = CondARM32::AL) {
636 Context.insert(InstARM32Rbit::create(Func, Dest, Src0, Pred)); 646 Context.insert(InstARM32Rbit::create(Func, Dest, Src0, Pred));
637 } 647 }
638 void _rev(Variable *Dest, Variable *Src0, 648 void _rev(Variable *Dest, Variable *Src0,
639 CondARM32::Cond Pred = CondARM32::AL) { 649 CondARM32::Cond Pred = CondARM32::AL) {
640 Context.insert(InstARM32Rev::create(Func, Dest, Src0, Pred)); 650 Context.insert(InstARM32Rev::create(Func, Dest, Src0, Pred));
641 } 651 }
642 void _ret(Variable *LR, Variable *Src0 = nullptr) { 652 void _ret(Variable *LR, Variable *Src0 = nullptr) {
643 Context.insert(InstARM32Ret::create(Func, LR, Src0)); 653 Context.insert(InstARM32Ret::create(Func, LR, Src0));
644 } 654 }
655 void _rscs(Variable *Dest, Variable *Src0, Operand *Src1,
656 CondARM32::Cond Pred = CondARM32::AL) {
657 constexpr bool SetFlags = true;
658 Context.insert(
659 InstARM32Rsc::create(Func, Dest, Src0, Src1, Pred, SetFlags));
660 }
661 void _rsbs(Variable *Dest, Variable *Src0, Operand *Src1,
662 CondARM32::Cond Pred = CondARM32::AL) {
663 constexpr bool SetFlags = true;
664 Context.insert(
665 InstARM32Rsb::create(Func, Dest, Src0, Src1, Pred, SetFlags));
666 }
645 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1, 667 void _rsb(Variable *Dest, Variable *Src0, Operand *Src1,
646 CondARM32::Cond Pred = CondARM32::AL) { 668 CondARM32::Cond Pred = CondARM32::AL) {
647 Context.insert(InstARM32Rsb::create(Func, Dest, Src0, Src1, Pred)); 669 Context.insert(InstARM32Rsb::create(Func, Dest, Src0, Src1, Pred));
648 } 670 }
649 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1, 671 void _sbc(Variable *Dest, Variable *Src0, Operand *Src1,
650 CondARM32::Cond Pred = CondARM32::AL) { 672 CondARM32::Cond Pred = CondARM32::AL) {
651 Context.insert(InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred)); 673 Context.insert(InstARM32Sbc::create(Func, Dest, Src0, Src1, Pred));
652 } 674 }
653 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1, 675 void _sbcs(Variable *Dest, Variable *Src0, Operand *Src1,
654 CondARM32::Cond Pred = CondARM32::AL) { 676 CondARM32::Cond Pred = CondARM32::AL) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 CondARM32::Cond Pred = CondARM32::AL) { 748 CondARM32::Cond Pred = CondARM32::AL) {
727 Context.insert(InstARM32Vcvt::create(Func, Dest, Src, Variant, Pred)); 749 Context.insert(InstARM32Vcvt::create(Func, Dest, Src, Variant, Pred));
728 } 750 }
729 void _vdiv(Variable *Dest, Variable *Src0, Variable *Src1) { 751 void _vdiv(Variable *Dest, Variable *Src0, Variable *Src1) {
730 Context.insert(InstARM32Vdiv::create(Func, Dest, Src0, Src1)); 752 Context.insert(InstARM32Vdiv::create(Func, Dest, Src0, Src1));
731 } 753 }
732 void _vcmp(Variable *Src0, Variable *Src1, 754 void _vcmp(Variable *Src0, Variable *Src1,
733 CondARM32::Cond Pred = CondARM32::AL) { 755 CondARM32::Cond Pred = CondARM32::AL) {
734 Context.insert(InstARM32Vcmp::create(Func, Src0, Src1, Pred)); 756 Context.insert(InstARM32Vcmp::create(Func, Src0, Src1, Pred));
735 } 757 }
758 void _vcmp(Variable *Src0, OperandARM32FlexFpZero *FpZero,
759 CondARM32::Cond Pred = CondARM32::AL) {
760 Context.insert(InstARM32Vcmp::create(Func, Src0, FpZero, Pred));
761 }
736 void _vmrs(CondARM32::Cond Pred = CondARM32::AL) { 762 void _vmrs(CondARM32::Cond Pred = CondARM32::AL) {
737 Context.insert(InstARM32Vmrs::create(Func, Pred)); 763 Context.insert(InstARM32Vmrs::create(Func, Pred));
738 } 764 }
739 void _vmul(Variable *Dest, Variable *Src0, Variable *Src1) { 765 void _vmul(Variable *Dest, Variable *Src0, Variable *Src1) {
740 Context.insert(InstARM32Vmul::create(Func, Dest, Src0, Src1)); 766 Context.insert(InstARM32Vmul::create(Func, Dest, Src0, Src1));
741 } 767 }
742 void _vsqrt(Variable *Dest, Variable *Src, 768 void _vsqrt(Variable *Dest, Variable *Src,
743 CondARM32::Cond Pred = CondARM32::AL) { 769 CondARM32::Cond Pred = CondARM32::AL) {
744 Context.insert(InstARM32Vsqrt::create(Func, Dest, Src, Pred)); 770 Context.insert(InstARM32Vsqrt::create(Func, Dest, Src, Pred));
745 } 771 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 958
933 private: 959 private:
934 ~TargetHeaderARM32() = default; 960 ~TargetHeaderARM32() = default;
935 961
936 TargetARM32Features CPUFeatures; 962 TargetARM32Features CPUFeatures;
937 }; 963 };
938 964
939 } // end of namespace Ice 965 } // end of namespace Ice
940 966
941 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 967 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698