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

Side by Side Diff: src/IceTargetLoweringX8664.cpp

Issue 1427973003: Subzero: Refactor x86 register representation to actively use aliases. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Reformat 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
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.h » ('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/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8664.cpp - x86-64 lowering -----------===//
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ICMPX8664_TABLE 67 ICMPX8664_TABLE
68 #undef X 68 #undef X
69 }; 69 };
70 70
71 const size_t MachineTraits<TargetX8664>::TableIcmp64Size = 71 const size_t MachineTraits<TargetX8664>::TableIcmp64Size =
72 llvm::array_lengthof(TableIcmp64); 72 llvm::array_lengthof(TableIcmp64);
73 73
74 const MachineTraits<TargetX8664>::TableTypeX8664AttributesType 74 const MachineTraits<TargetX8664>::TableTypeX8664AttributesType
75 MachineTraits<TargetX8664>::TableTypeX8664Attributes[] = { 75 MachineTraits<TargetX8664>::TableTypeX8664Attributes[] = {
76 #define X(tag, elementty, cvt, sdss, pack, width, fld) \ 76 #define X(tag, elementty, cvt, sdss, pack, width, fld) \
77 { elementty } \ 77 { IceType_##elementty } \
78 , 78 ,
79 ICETYPEX8664_TABLE 79 ICETYPEX8664_TABLE
80 #undef X 80 #undef X
81 }; 81 };
82 82
83 const size_t MachineTraits<TargetX8664>::TableTypeX8664AttributesSize = 83 const size_t MachineTraits<TargetX8664>::TableTypeX8664AttributesSize =
84 llvm::array_lengthof(TableTypeX8664Attributes); 84 llvm::array_lengthof(TableTypeX8664Attributes);
85 85
86 const uint32_t MachineTraits<TargetX8664>::X86_STACK_ALIGNMENT_BYTES = 16; 86 const uint32_t MachineTraits<TargetX8664>::X86_STACK_ALIGNMENT_BYTES = 16;
87 const char *MachineTraits<TargetX8664>::TargetName = "X8664"; 87 const char *MachineTraits<TargetX8664>::TargetName = "X8664";
88 88
89 template <> 89 template <>
90 std::array<llvm::SmallBitVector, IceType_NUM> 90 std::array<llvm::SmallBitVector, RCX86_NUM>
91 TargetX86Base<TargetX8664>::TypeToRegisterSet = {}; 91 TargetX86Base<TargetX8664>::TypeToRegisterSet = {};
92 92
93 template <> 93 template <>
94 std::array<llvm::SmallBitVector, 94 std::array<llvm::SmallBitVector,
95 TargetX86Base<TargetX8664>::Traits::RegisterSet::Reg_NUM> 95 TargetX86Base<TargetX8664>::Traits::RegisterSet::Reg_NUM>
96 TargetX86Base<TargetX8664>::RegisterAliases = {}; 96 TargetX86Base<TargetX8664>::RegisterAliases = {};
97 97
98 template <> 98 template <>
99 llvm::SmallBitVector 99 llvm::SmallBitVector
100 TargetX86Base<TargetX8664>::ScratchRegs = llvm::SmallBitVector(); 100 TargetX86Base<TargetX8664>::ScratchRegs = llvm::SmallBitVector();
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 namespace dummy3 { 948 namespace dummy3 {
949 // Define a temporary set of enum values based on low-level table entries. 949 // Define a temporary set of enum values based on low-level table entries.
950 enum _tmp_enum { 950 enum _tmp_enum {
951 #define X(tag, elementty, cvt, sdss, pack, width, fld) _tmp_##tag, 951 #define X(tag, elementty, cvt, sdss, pack, width, fld) _tmp_##tag,
952 ICETYPEX8664_TABLE 952 ICETYPEX8664_TABLE
953 #undef X 953 #undef X
954 _num 954 _num
955 }; 955 };
956 // Define a set of constants based on high-level table entries. 956 // Define a set of constants based on high-level table entries.
957 #define X(tag, sizeLog2, align, elts, elty, str) \ 957 #define X(tag, sizeLog2, align, elts, elty, str) \
958 static const int _table1_##tag = tag; 958 static const int _table1_##tag = IceType_##tag;
959 ICETYPE_TABLE 959 ICETYPE_TABLE
960 #undef X 960 #undef X
961 // Define a set of constants based on low-level table entries, and ensure the 961 // Define a set of constants based on low-level table entries, and ensure the
962 // table entry keys are consistent. 962 // table entry keys are consistent.
963 #define X(tag, elementty, cvt, sdss, pack, width, fld) \ 963 #define X(tag, elementty, cvt, sdss, pack, width, fld) \
964 static const int _table2_##tag = _tmp_##tag; \ 964 static const int _table2_##tag = _tmp_##tag; \
965 static_assert(_table1_##tag == _table2_##tag, \ 965 static_assert(_table1_##tag == _table2_##tag, \
966 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); 966 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE");
967 ICETYPEX8664_TABLE 967 ICETYPEX8664_TABLE
968 #undef X 968 #undef X
969 // Repeat the static asserts with respect to the high-level table entries in 969 // Repeat the static asserts with respect to the high-level table entries in
970 // case the high-level table has extra entries. 970 // case the high-level table has extra entries.
971 #define X(tag, sizeLog2, align, elts, elty, str) \ 971 #define X(tag, sizeLog2, align, elts, elty, str) \
972 static_assert(_table1_##tag == _table2_##tag, \ 972 static_assert(_table1_##tag == _table2_##tag, \
973 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE"); 973 "Inconsistency between ICETYPEX8664_TABLE and ICETYPE_TABLE");
974 ICETYPE_TABLE 974 ICETYPE_TABLE
975 #undef X 975 #undef X
976 } // end of namespace dummy3 976 } // end of namespace dummy3
977 } // end of anonymous namespace 977 } // end of anonymous namespace
978 978
979 } // end of namespace Ice 979 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632Traits.h ('k') | src/IceTargetLoweringX8664Traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698