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

Side by Side Diff: src/IceRegistersARM32.h

Issue 1540653003: Add VADD instruction to the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits and show extracted DART code. Created 5 years 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/IceRegistersARM32.h - Register information ---*- C++ -*-===// 1 //===- subzero/src/IceRegistersARM32.h - Register information ---*- 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 /// used to binary encode register operands in instructions. 75 /// used to binary encode register operands in instructions.
76 enum QRegister { 76 enum QRegister {
77 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \ 77 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \
78 isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \ 78 isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \
79 Encoded_##val = encode, 79 Encoded_##val = encode,
80 REGARM32_VEC128_TABLE 80 REGARM32_VEC128_TABLE
81 #undef X 81 #undef X
82 Encoded_Not_QReg = -1 82 Encoded_Not_QReg = -1
83 }; 83 };
84 84
85 static inline SizeT getNumGPRRegs() {
86 return Reg_GPR_Last + 1 - Reg_GPR_First;
87 }
88
85 static inline GPRRegister getEncodedGPR(int32_t RegNum) { 89 static inline GPRRegister getEncodedGPR(int32_t RegNum) {
86 assert(Reg_GPR_First <= RegNum); 90 assert(Reg_GPR_First <= RegNum);
87 assert(RegNum <= Reg_GPR_Last); 91 assert(RegNum <= Reg_GPR_Last);
88 return GPRRegister(RegNum - Reg_GPR_First); 92 return GPRRegister(RegNum - Reg_GPR_First);
89 } 93 }
90 94
91 static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) { 95 static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) {
92 assert(Reg_I64PAIR_First <= RegNum); 96 assert(Reg_I64PAIR_First <= RegNum);
93 assert(RegNum <= Reg_I64PAIR_Last); 97 assert(RegNum <= Reg_I64PAIR_Last);
94 return GPRRegister(2 * (RegNum - Reg_I64PAIR_First + Reg_GPR_First)); 98 return GPRRegister(2 * (RegNum - Reg_I64PAIR_First + Reg_GPR_First));
(...skipping 11 matching lines...) Expand all
106 110
107 static inline bool isEncodedSReg(int32_t RegNum) { 111 static inline bool isEncodedSReg(int32_t RegNum) {
108 return Reg_SREG_First <= RegNum && RegNum <= Reg_SREG_Last; 112 return Reg_SREG_First <= RegNum && RegNum <= Reg_SREG_Last;
109 } 113 }
110 114
111 static inline SizeT getNumSRegs() { 115 static inline SizeT getNumSRegs() {
112 return Reg_SREG_Last + 1 - Reg_SREG_First; 116 return Reg_SREG_Last + 1 - Reg_SREG_First;
113 } 117 }
114 118
115 static inline SRegister getEncodedSReg(int32_t RegNum) { 119 static inline SRegister getEncodedSReg(int32_t RegNum) {
116 assert(Reg_SREG_First <= RegNum); 120 assert(isEncodedSReg(RegNum));
117 assert(RegNum <= Reg_SREG_Last);
118 return SRegister(RegNum - Reg_SREG_First); 121 return SRegister(RegNum - Reg_SREG_First);
119 } 122 }
120 123
124 // Note: D registers are listed from largest to smallest.
Jim Stichnoth 2015/12/19 15:31:25 We should not be assuming any ordering (including
Karl 2016/01/05 20:24:31 If you note the functions above this one, ALL of t
125
126 static inline bool isEncodedDReg(int32_t RegNum) {
127 return Reg_DREG_First >= RegNum && RegNum >= Reg_DREG_Last;
128 }
129
130 static inline SizeT getNumDRegs() {
131 return Reg_DREG_First + 1 - Reg_DREG_Last;
132 }
133
121 static inline DRegister getEncodedDReg(int32_t RegNum) { 134 static inline DRegister getEncodedDReg(int32_t RegNum) {
122 assert(Reg_DREG_First <= RegNum); 135 assert(isEncodedDReg(RegNum));
123 assert(RegNum <= Reg_DREG_Last); 136 return DRegister(Reg_DREG_First - RegNum);
124 return DRegister(RegNum - Reg_DREG_First);
125 } 137 }
126 138
127 static inline QRegister getEncodedQReg(int32_t RegNum) { 139 static inline QRegister getEncodedQReg(int32_t RegNum) {
128 assert(Reg_QREG_First <= RegNum); 140 assert(Reg_QREG_First <= RegNum);
129 assert(RegNum <= Reg_QREG_Last); 141 assert(RegNum <= Reg_QREG_Last);
130 return QRegister(RegNum - Reg_QREG_First); 142 return QRegister(RegNum - Reg_QREG_First);
131 } 143 }
132 144
133 static const char *RegNames[]; 145 static const char *RegNames[];
134 }; 146 };
135 147
136 // Extend enum RegClass with ARM32-specific register classes (if any). 148 // Extend enum RegClass with ARM32-specific register classes (if any).
137 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target }; 149 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target };
138 150
139 } // end of namespace Ice 151 } // end of namespace Ice
140 152
141 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H 153 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698