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

Side by Side Diff: src/IceRegistersX8632.h

Issue 595093002: Handle "inplace" ops and unary ops w/ assembler (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: format Created 6 years, 2 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/IceInstX8632.cpp ('k') | src/assembler_ia32.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/IceRegistersX8632.h - Register information ---*- C++ -*-===// 1 //===- subzero/src/IceRegistersX8632.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 // This file declares the registers and their encodings for x86-32. 10 // This file declares the registers and their encodings for x86-32.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #ifndef SUBZERO_SRC_ICEREGISTERSX8632_H 14 #ifndef SUBZERO_SRC_ICEREGISTERSX8632_H
15 #define SUBZERO_SRC_ICEREGISTERSX8632_H 15 #define SUBZERO_SRC_ICEREGISTERSX8632_H
16 16
17 #include "IceDefs.h" 17 #include "IceDefs.h"
18 #include "IceInstX8632.def" 18 #include "IceInstX8632.def"
19 #include "IceTypes.h"
19 20
20 namespace Ice { 21 namespace Ice {
21 22
22 namespace RegX8632 { 23 namespace RegX8632 {
23 24
24 // An enum of every register. The enum value may not match the encoding 25 // An enum of every register. The enum value may not match the encoding
25 // used to binary encode register operands in instructions. 26 // used to binary encode register operands in instructions.
26 enum AllRegisters { 27 enum AllRegisters {
27 #define X(val, encode, name, name16, name8, scratch, preserved, stackptr, \ 28 #define X(val, encode, name, name16, name8, scratch, preserved, stackptr, \
28 frameptr, isI8, isInt, isFP) \ 29 frameptr, isI8, isInt, isFP) \
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 return XmmRegister(RegNum - Reg_XMM_First); 77 return XmmRegister(RegNum - Reg_XMM_First);
77 } 78 }
78 79
79 static inline ByteRegister getEncodedByteReg(int32_t RegNum) { 80 static inline ByteRegister getEncodedByteReg(int32_t RegNum) {
80 assert(RegNum == Reg_ah || (Reg_GPR_First <= RegNum && RegNum <= Reg_ebx)); 81 assert(RegNum == Reg_ah || (Reg_GPR_First <= RegNum && RegNum <= Reg_ebx));
81 if (RegNum == Reg_ah) 82 if (RegNum == Reg_ah)
82 return Encoded_Reg_ah; 83 return Encoded_Reg_ah;
83 return ByteRegister(RegNum - Reg_GPR_First); 84 return ByteRegister(RegNum - Reg_GPR_First);
84 } 85 }
85 86
87 static inline GPRRegister getEncodedByteRegOrGPR(Type Ty, int32_t RegNum) {
88 if (Ty == IceType_i8 || Ty == IceType_i1)
89 return GPRRegister(getEncodedByteReg(RegNum));
90 else
91 return getEncodedGPR(RegNum);
92 }
93
86 } // end of namespace RegX8632 94 } // end of namespace RegX8632
87 95
88 } // end of namespace Ice 96 } // end of namespace Ice
89 97
90 #endif // SUBZERO_SRC_ICEREGISTERSX8632_H 98 #endif // SUBZERO_SRC_ICEREGISTERSX8632_H
OLDNEW
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698