diff options
author | Logan Chien <loganchien@google.com> | 2011-12-16 09:08:45 +0800 |
---|---|---|
committer | Logan Chien <loganchien@google.com> | 2011-12-16 13:28:58 +0800 |
commit | a1e6e241a813f81be2d2f36ab60c950ca297574b (patch) | |
tree | cf2d7ec5c63f40e2b66d8be7737496719a0d7902 /lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp | |
parent | ac212abcc6d858470ad35ce7d660af0c1800364a (diff) | |
parent | ddecfe54a35ffbe0675f7f33e493734fd60b2495 (diff) | |
download | external_llvm-a1e6e241a813f81be2d2f36ab60c950ca297574b.zip external_llvm-a1e6e241a813f81be2d2f36ab60c950ca297574b.tar.gz external_llvm-a1e6e241a813f81be2d2f36ab60c950ca297574b.tar.bz2 |
Merge with LLVM upstream r146714 (Dec 16th 2011)
Change-Id: Ied458adb08bf9a69250cbcee9b14b44d17e8701a
Diffstat (limited to 'lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp')
-rw-r--r-- | lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp b/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp index 08f7d46..d5acbe9 100644 --- a/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp +++ b/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp @@ -58,6 +58,11 @@ public: bool MayNeedRelaxation(const MCInst &Inst) const; + bool fixupNeedsRelaxation(const MCFixup &Fixup, + uint64_t Value, + const MCInstFragment *DF, + const MCAsmLayout &Layout) const; + void RelaxInstruction(const MCInst &Inst, MCInst &Res) const; bool WriteNopData(uint64_t Count, MCObjectWriter *OW) const; @@ -87,6 +92,18 @@ bool MBlazeAsmBackend::MayNeedRelaxation(const MCInst &Inst) const { return hasExprOrImm; } +bool MBlazeAsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup, + uint64_t Value, + const MCInstFragment *DF, + const MCAsmLayout &Layout) const { + // FIXME: Is this right? It's what the "generic" code was doing before, + // but is X86 specific. Is it actually true for MBlaze also, or was it + // just close enough to not be a big deal? + // + // Relax if the value is too big for a (signed) i8. + return int64_t(Value) != int64_t(int8_t(Value)); +} + void MBlazeAsmBackend::RelaxInstruction(const MCInst &Inst, MCInst &Res) const { Res = Inst; Res.setOpcode(getRelaxedOpcode(Inst.getOpcode())); |