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

Side by Side Diff: src/IceRegistersMIPS32.h

Issue 1993993004: Subzero, MIPS32: Introduction of floating point registers (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Added floating point register pairs Created 4 years, 6 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
« no previous file with comments | « src/IceInstMIPS32.def ('k') | src/IceTargetLoweringMIPS32.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/IceRegistersMIPS32.h - Register information --*- C++ -*-===// 1 //===- subzero/src/IceRegistersMIPS32.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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 enum GPRRegister { 43 enum GPRRegister {
44 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ 44 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \
45 isI64Pair, isFP32, isFP64, isVec128, alias_init) \ 45 isI64Pair, isFP32, isFP64, isVec128, alias_init) \
46 \ 46 \
47 Encoded_##val = encode, 47 Encoded_##val = encode,
48 REGMIPS32_GPR_TABLE 48 REGMIPS32_GPR_TABLE
49 #undef X 49 #undef X
50 Encoded_Not_GPR = -1 50 Encoded_Not_GPR = -1
51 }; 51 };
52 52
53 /// An enum of FPR Registers. The enum value does match the encoding used
54 /// to binary encode register operands in instructions.
55 enum FPRRegister {
56 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \
57 isI64Pair, isFP32, isFP64, isVec128, alias_init) \
58 \
59 Encoded_##val = encode,
60 REGMIPS32_FPR_TABLE
61 #undef X
62 Encoded_Not_FPR = -1
63 };
64
53 // TODO(jvoung): Floating point and vector registers... 65 // TODO(jvoung): Floating point and vector registers...
54 // Need to model overlap and difference in encoding too. 66 // Need to model overlap and difference in encoding too.
55 67
56 static inline GPRRegister getEncodedGPR(RegNumT RegNum) { 68 static inline GPRRegister getEncodedGPR(RegNumT RegNum) {
57 assert(int(Reg_GPR_First) <= int(RegNum)); 69 assert(int(Reg_GPR_First) <= int(RegNum));
58 assert(unsigned(RegNum) <= Reg_GPR_Last); 70 assert(unsigned(RegNum) <= Reg_GPR_Last);
59 return GPRRegister(RegNum - Reg_GPR_First); 71 return GPRRegister(RegNum - Reg_GPR_First);
60 } 72 }
61 73
74 static inline bool isGPRReg(RegNumT RegNum) {
75 return (int(Reg_GPR_First) <= int(RegNum)) &&
76 (unsigned(RegNum) <= Reg_GPR_Last);
77 }
78
79 static inline FPRRegister getEncodedFPR(RegNumT RegNum) {
80 assert(int(Reg_FPR_First) <= int(RegNum));
81 assert(unsigned(RegNum) <= Reg_FPR_Last);
82 return FPRRegister(RegNum - Reg_FPR_First);
83 }
84
85 static inline bool isFPRReg(RegNumT RegNum) {
86 return (int(Reg_FPR_First) <= int(RegNum)) &&
87 (unsigned(RegNum) <= Reg_FPR_Last);
88 }
89
62 const char *getRegName(RegNumT RegNum); 90 const char *getRegName(RegNumT RegNum);
63 91
64 } // end of namespace RegMIPS32 92 } // end of namespace RegMIPS32
65 93
66 // Extend enum RegClass with MIPS32-specific register classes (if any). 94 // Extend enum RegClass with MIPS32-specific register classes (if any).
67 enum RegClassMIPS32 : uint8_t { RCMIPS32_NUM = RC_Target }; 95 enum RegClassMIPS32 : uint8_t { RCMIPS32_NUM = RC_Target };
68 96
69 } // end of namespace MIPS32 97 } // end of namespace MIPS32
70 } // end of namespace Ice 98 } // end of namespace Ice
71 99
72 #endif // SUBZERO_SRC_ICEREGISTERSMIPS32_H 100 #endif // SUBZERO_SRC_ICEREGISTERSMIPS32_H
OLDNEW
« no previous file with comments | « src/IceInstMIPS32.def ('k') | src/IceTargetLoweringMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698