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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1208663002: Fixes the X86 Base template. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 5 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/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 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 // This file declares the TargetLoweringX86 template class, which 10 // This file declares the TargetLoweringX86 template class, which
11 // implements the TargetLowering base interface for the x86 11 // implements the TargetLowering base interface for the x86
12 // architecture. 12 // architecture.
13 // 13 //
14 //===----------------------------------------------------------------------===// 14 //===----------------------------------------------------------------------===//
15 15
16 #ifndef SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 16 #ifndef SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
17 #define SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 17 #define SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
18 18
19 #include <type_traits>
19 #include <unordered_map> 20 #include <unordered_map>
20 21
21 #include "IceDefs.h" 22 #include "IceDefs.h"
22 #include "IceInst.h" 23 #include "IceInst.h"
23 #include "IceTargetLowering.h" 24 #include "IceTargetLowering.h"
24 25
25 namespace Ice { 26 namespace Ice {
26 namespace X86Internal { 27 namespace X86Internal {
27 28
28 template <class MachineTraits> class BoolFolding; 29 template <class MachineTraits> class BoolFolding;
29 30
30 template <class Machine> struct MachineTraits {}; 31 template <class Machine> struct MachineTraits {};
31 32
32 template <class Machine> class TargetX86Base : public Machine { 33 template <class Machine> class TargetX86Base : public Machine {
34 static_assert(std::is_base_of<::Ice::TargetLowering, Machine>::value, "Machine template parameter must be a TargetLowering.");
Jim Stichnoth 2015/06/24 21:58:46 80-col
John 2015/06/24 22:56:24 Done.
35
33 TargetX86Base() = delete; 36 TargetX86Base() = delete;
34 TargetX86Base(const TargetX86Base &) = delete; 37 TargetX86Base(const TargetX86Base &) = delete;
35 TargetX86Base &operator=(const TargetX86Base &) = delete; 38 TargetX86Base &operator=(const TargetX86Base &) = delete;
36 39
37 protected: 40 protected:
38 using TargetLowering::H_bitcast_16xi1_i16; 41 using Machine::H_bitcast_16xi1_i16;
39 using TargetLowering::H_bitcast_8xi1_i8; 42 using Machine::H_bitcast_8xi1_i8;
40 using TargetLowering::H_bitcast_i16_16xi1; 43 using Machine::H_bitcast_i16_16xi1;
41 using TargetLowering::H_bitcast_i8_8xi1; 44 using Machine::H_bitcast_i8_8xi1;
42 using TargetLowering::H_call_ctpop_i32; 45 using Machine::H_call_ctpop_i32;
43 using TargetLowering::H_call_ctpop_i64; 46 using Machine::H_call_ctpop_i64;
44 using TargetLowering::H_call_longjmp; 47 using Machine::H_call_longjmp;
45 using TargetLowering::H_call_memcpy; 48 using Machine::H_call_memcpy;
46 using TargetLowering::H_call_memmove; 49 using Machine::H_call_memmove;
47 using TargetLowering::H_call_memset; 50 using Machine::H_call_memset;
48 using TargetLowering::H_call_read_tp; 51 using Machine::H_call_read_tp;
49 using TargetLowering::H_call_setjmp; 52 using Machine::H_call_setjmp;
50 using TargetLowering::H_fptosi_f32_i64; 53 using Machine::H_fptosi_f32_i64;
51 using TargetLowering::H_fptosi_f64_i64; 54 using Machine::H_fptosi_f64_i64;
52 using TargetLowering::H_fptoui_4xi32_f32; 55 using Machine::H_fptoui_4xi32_f32;
53 using TargetLowering::H_fptoui_f32_i32; 56 using Machine::H_fptoui_f32_i32;
54 using TargetLowering::H_fptoui_f32_i64; 57 using Machine::H_fptoui_f32_i64;
55 using TargetLowering::H_fptoui_f64_i32; 58 using Machine::H_fptoui_f64_i32;
56 using TargetLowering::H_fptoui_f64_i64; 59 using Machine::H_fptoui_f64_i64;
57 using TargetLowering::H_frem_f32; 60 using Machine::H_frem_f32;
58 using TargetLowering::H_frem_f64; 61 using Machine::H_frem_f64;
59 using TargetLowering::H_sdiv_i64; 62 using Machine::H_sdiv_i64;
60 using TargetLowering::H_sitofp_i64_f32; 63 using Machine::H_sitofp_i64_f32;
61 using TargetLowering::H_sitofp_i64_f64; 64 using Machine::H_sitofp_i64_f64;
62 using TargetLowering::H_srem_i64; 65 using Machine::H_srem_i64;
63 using TargetLowering::H_udiv_i64; 66 using Machine::H_udiv_i64;
64 using TargetLowering::H_uitofp_4xi32_4xf32; 67 using Machine::H_uitofp_4xi32_4xf32;
65 using TargetLowering::H_uitofp_i32_f32; 68 using Machine::H_uitofp_i32_f32;
66 using TargetLowering::H_uitofp_i32_f64; 69 using Machine::H_uitofp_i32_f64;
67 using TargetLowering::H_uitofp_i64_f32; 70 using Machine::H_uitofp_i64_f32;
68 using TargetLowering::H_uitofp_i64_f64; 71 using Machine::H_uitofp_i64_f64;
69 using TargetLowering::H_urem_i64; 72 using Machine::H_urem_i64;
70 73
71 using TargetLowering::alignStackSpillAreas; 74 using Machine::alignStackSpillAreas;
72 using TargetLowering::assignVarStackSlots; 75 using Machine::assignVarStackSlots;
73 using TargetLowering::inferTwoAddress; 76 using Machine::inferTwoAddress;
74 using TargetLowering::makeHelperCall; 77 using Machine::makeHelperCall;
75 using TargetLowering::getVarStackSlotParams; 78 using Machine::getVarStackSlotParams;
76 79
77 public: 80 public:
78 using Traits = MachineTraits<Machine>; 81 using Traits = MachineTraits<Machine>;
79 using BoolFolding = ::Ice::X86Internal::BoolFolding<Traits>; 82 using BoolFolding = ::Ice::X86Internal::BoolFolding<Traits>;
80 83
81 using TargetLowering::RegSet_All; 84 using Machine::RegSet_All;
82 using TargetLowering::RegSet_CalleeSave; 85 using Machine::RegSet_CalleeSave;
83 using TargetLowering::RegSet_CallerSave; 86 using Machine::RegSet_CallerSave;
84 using TargetLowering::RegSet_FramePointer; 87 using Machine::RegSet_FramePointer;
85 using TargetLowering::RegSet_None; 88 using Machine::RegSet_None;
86 using TargetLowering::RegSet_StackPointer; 89 using Machine::RegSet_StackPointer;
87 using TargetLowering::Context; 90 using Machine::Context;
88 using TargetLowering::Ctx; 91 using Machine::Ctx;
89 using TargetLowering::Func; 92 using Machine::Func;
90 using TargetLowering::RegSetMask; 93 using RegSetMask = typename Machine::RegSetMask;
91 94
92 using TargetLowering::_bundle_lock; 95 using Machine::_bundle_lock;
93 using TargetLowering::_bundle_unlock; 96 using Machine::_bundle_unlock;
94 using TargetLowering::getContext; 97 using Machine::getContext;
95 using TargetLowering::getStackAdjustment; 98 using Machine::getStackAdjustment;
96 using TargetLowering::regAlloc; 99 using Machine::regAlloc;
97 using TargetLowering::resetStackAdjustment; 100 using Machine::resetStackAdjustment;
98 101
99 static TargetX86Base *create(Cfg *Func) { return new TargetX86Base(Func); } 102 static TargetX86Base *create(Cfg *Func) { return new TargetX86Base(Func); }
100 103
101 void translateOm1() override; 104 void translateOm1() override;
102 void translateO2() override; 105 void translateO2() override;
103 void doLoadOpt(); 106 void doLoadOpt();
104 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; 107 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override;
105 108
106 SizeT getNumRegisters() const override { return RegX8632::Reg_NUM; } 109 SizeT getNumRegisters() const override { return RegX8632::Reg_NUM; }
107 Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override; 110 Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override;
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 private: 604 private:
602 ~TargetX86Base() override {} 605 ~TargetX86Base() override {}
603 BoolFolding FoldingInfo; 606 BoolFolding FoldingInfo;
604 }; 607 };
605 } // end of namespace X86Internal 608 } // end of namespace X86Internal
606 } // end of namespace Ice 609 } // end of namespace Ice
607 610
608 #include "IceTargetLoweringX86BaseImpl.h" 611 #include "IceTargetLoweringX86BaseImpl.h"
609 612
610 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 613 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698