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

Side by Side Diff: src/IceRegistersX8664.h

Issue 1224173006: Adds the x86-64 assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments; make format Created 5 years, 4 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/IceInstX8664.def ('k') | src/IceTargetLoweringX8632Traits.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/IceRegistersX8664.h - Register information ---*- C++ -*-===// 1 //===- subzero/src/IceRegistersX8664.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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 assert(Reg_GPR_First <= RegNum && RegNum <= Reg_GPR_Last); 72 assert(Reg_GPR_First <= RegNum && RegNum <= Reg_GPR_Last);
73 return GPRRegister(RegNum - Reg_GPR_First); 73 return GPRRegister(RegNum - Reg_GPR_First);
74 } 74 }
75 75
76 static inline XmmRegister getEncodedXmm(int32_t RegNum) { 76 static inline XmmRegister getEncodedXmm(int32_t RegNum) {
77 assert(Reg_XMM_First <= RegNum && RegNum <= Reg_XMM_Last); 77 assert(Reg_XMM_First <= RegNum && RegNum <= Reg_XMM_Last);
78 return XmmRegister(RegNum - Reg_XMM_First); 78 return XmmRegister(RegNum - Reg_XMM_First);
79 } 79 }
80 80
81 static inline ByteRegister getEncodedByteReg(int32_t RegNum) { 81 static inline ByteRegister getEncodedByteReg(int32_t RegNum) {
82 // In x86-64, AH is not encodable when the REX prefix is used; the same
83 // encoding is used for spl. Therefore, ah needs special handling.
84 if (RegNum == Reg_ah)
85 return Encoded_Reg_spl;
86 return ByteRegister(RegNum - Reg_GPR_First); 82 return ByteRegister(RegNum - Reg_GPR_First);
87 } 83 }
88 84
89 static inline GPRRegister getEncodedByteRegOrGPR(Type Ty, int32_t RegNum) { 85 static inline GPRRegister getEncodedByteRegOrGPR(Type Ty, int32_t RegNum) {
90 if (isByteSizedType(Ty)) 86 if (isByteSizedType(Ty))
91 return GPRRegister(getEncodedByteReg(RegNum)); 87 return GPRRegister(getEncodedByteReg(RegNum));
92 else 88 else
93 return getEncodedGPR(RegNum); 89 return getEncodedGPR(RegNum);
94 } 90 }
95 }; 91 };
96 92
97 } // end of namespace Ice 93 } // end of namespace Ice
98 94
99 #endif // SUBZERO_SRC_ICEREGISTERSX8664_H 95 #endif // SUBZERO_SRC_ICEREGISTERSX8664_H
OLDNEW
« no previous file with comments | « src/IceInstX8664.def ('k') | src/IceTargetLoweringX8632Traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698