summaryrefslogtreecommitdiff
path: root/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
diff options
context:
space:
mode:
authorPreston Gurd <preston.gurd@intel.com>2013-04-10 20:11:59 +0000
committerPreston Gurd <preston.gurd@intel.com>2013-04-10 20:11:59 +0000
commit15b64d0e28efc625bd740b19ad4138f48d5b98b0 (patch)
tree8692d04fd8744bf234beb1c4ae5deae0c26abef7 /lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
parent37c04bcff28ae24aa84c44d73b1079bdab09c8c5 (diff)
downloadllvm-15b64d0e28efc625bd740b19ad4138f48d5b98b0.tar.gz
llvm-15b64d0e28efc625bd740b19ad4138f48d5b98b0.tar.bz2
llvm-15b64d0e28efc625bd740b19ad4138f48d5b98b0.tar.xz
In the X86 back end, getMemoryOperandNo() returns the offset
into the operand array of the start of the memory reference descriptor. Additional code in EncodeInstruction provides an additional adjustment. This patch places that additional code in a separate function, called getOperandBias, so that any caller of getMemoryOperandNo can also call getOperandBias. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp')
-rw-r--r--lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp b/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
index 776cee1e35..d1ea2fe368 100644
--- a/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
+++ b/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
@@ -979,18 +979,8 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
if ((TSFlags & X86II::FormMask) == X86II::Pseudo)
return;
- // If this is a two-address instruction, skip one of the register operands.
- // FIXME: This should be handled during MCInst lowering.
unsigned NumOps = Desc.getNumOperands();
- unsigned CurOp = 0;
- if (NumOps > 1 && Desc.getOperandConstraint(1, MCOI::TIED_TO) == 0)
- ++CurOp;
- else if (NumOps > 3 && Desc.getOperandConstraint(2, MCOI::TIED_TO) == 0) {
- assert(Desc.getOperandConstraint(NumOps - 1, MCOI::TIED_TO) == 1);
- // Special case for GATHER with 2 TIED_TO operands
- // Skip the first 2 operands: dst, mask_wb
- CurOp += 2;
- }
+ unsigned CurOp = X86II::getOperandBias(Desc);
// Keep track of the current byte being emitted.
unsigned CurByte = 0;