diff options
| author | 2016-03-09 02:25:00 -0500 | |
|---|---|---|
| committer | 2016-03-09 02:25:00 -0500 | |
| commit | 77bcdafc94927afeb4555be42d4b638dfb1470f2 (patch) | |
| tree | 83e8f72d2381413a404c045ade06c7cdda794885 /src | |
| parent | emitter: Remove unimplemented prototype (diff) | |
| download | yuzu-77bcdafc94927afeb4555be42d4b638dfb1470f2.tar.gz yuzu-77bcdafc94927afeb4555be42d4b638dfb1470f2.tar.xz yuzu-77bcdafc94927afeb4555be42d4b638dfb1470f2.zip | |
emitter: friend class OpArg with XEmitter
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/x64/emitter.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/x64/emitter.h b/src/common/x64/emitter.h index 05a269859..0efc0d202 100644 --- a/src/common/x64/emitter.h +++ b/src/common/x64/emitter.h | |||
| @@ -157,6 +157,8 @@ class XEmitter; | |||
| 157 | // RIP addressing does not benefit from micro op fusion on Core arch | 157 | // RIP addressing does not benefit from micro op fusion on Core arch |
| 158 | struct OpArg | 158 | struct OpArg |
| 159 | { | 159 | { |
| 160 | friend class XEmitter; | ||
| 161 | |||
| 160 | OpArg() {} // dummy op arg, used for storage | 162 | OpArg() {} // dummy op arg, used for storage |
| 161 | OpArg(u64 _offset, int _scale, X64Reg rmReg = RAX, X64Reg scaledReg = RAX) | 163 | OpArg(u64 _offset, int _scale, X64Reg rmReg = RAX, X64Reg scaledReg = RAX) |
| 162 | { | 164 | { |
| @@ -176,9 +178,6 @@ struct OpArg | |||
| 176 | void WriteVex(XEmitter* emit, X64Reg regOp1, X64Reg regOp2, int L, int pp, int mmmmm, int W = 0) const; | 178 | void WriteVex(XEmitter* emit, X64Reg regOp1, X64Reg regOp2, int L, int pp, int mmmmm, int W = 0) const; |
| 177 | void WriteRest(XEmitter *emit, int extraBytes=0, X64Reg operandReg=INVALID_REG, bool warn_64bit_offset = true) const; | 179 | void WriteRest(XEmitter *emit, int extraBytes=0, X64Reg operandReg=INVALID_REG, bool warn_64bit_offset = true) const; |
| 178 | void WriteSingleByteOp(XEmitter *emit, u8 op, X64Reg operandReg, int bits); | 180 | void WriteSingleByteOp(XEmitter *emit, u8 op, X64Reg operandReg, int bits); |
| 179 | // This one is public - must be written to | ||
| 180 | u64 offset; // use RIP-relative as much as possible - 64-bit immediates are not available. | ||
| 181 | u16 operandReg; | ||
| 182 | 181 | ||
| 183 | void WriteNormalOp(XEmitter *emit, bool toRM, NormalOp op, const OpArg &operand, int bits) const; | 182 | void WriteNormalOp(XEmitter *emit, bool toRM, NormalOp op, const OpArg &operand, int bits) const; |
| 184 | bool IsImm() const {return scale == SCALE_IMM8 || scale == SCALE_IMM16 || scale == SCALE_IMM32 || scale == SCALE_IMM64;} | 183 | bool IsImm() const {return scale == SCALE_IMM8 || scale == SCALE_IMM16 || scale == SCALE_IMM32 || scale == SCALE_IMM64;} |
| @@ -240,6 +239,8 @@ private: | |||
| 240 | u8 scale; | 239 | u8 scale; |
| 241 | u16 offsetOrBaseReg; | 240 | u16 offsetOrBaseReg; |
| 242 | u16 indexReg; | 241 | u16 indexReg; |
| 242 | u64 offset; // use RIP-relative as much as possible - 64-bit immediates are not available. | ||
| 243 | u16 operandReg; | ||
| 243 | }; | 244 | }; |
| 244 | 245 | ||
| 245 | inline OpArg M(const void *ptr) {return OpArg((u64)ptr, (int)SCALE_RIP);} | 246 | inline OpArg M(const void *ptr) {return OpArg((u64)ptr, (int)SCALE_RIP);} |