[llvm] r262400 - [Hexagon] Modifying r262258 to only be in effect in the hand assembler path, not the integrated assembler.
Colin LeMahieu via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 1 13:37:41 PST 2016
Author: colinl
Date: Tue Mar 1 15:37:41 2016
New Revision: 262400
URL: http://llvm.org/viewvc/llvm-project?rev=262400&view=rev
Log:
[Hexagon] Modifying r262258 to only be in effect in the hand assembler path, not the integrated assembler.
Modified:
llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp
Modified: llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp?rev=262400&r1=262399&r2=262400&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp Tue Mar 1 15:37:41 2016
@@ -35,6 +35,7 @@
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/MC/MCValue.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ELF.h"
@@ -1433,6 +1434,21 @@ bool HexagonAsmParser::parseInstruction(
Expr = MCBinaryExpr::createAnd(Expr,
MCConstantExpr::create(0xffff, Context),
Context);
+ } else {
+ MCValue Value;
+ if (Expr->evaluateAsRelocatable(Value, nullptr, nullptr)) {
+ if (!Value.isAbsolute()) {
+ switch(Value.getAccessVariant()) {
+ case MCSymbolRefExpr::VariantKind::VK_TPREL:
+ case MCSymbolRefExpr::VariantKind::VK_DTPREL:
+ // Don't lazy extend these expression variants
+ MustNotExtend = !MustExtend;
+ break;
+ default:
+ break;
+ }
+ }
+ }
}
Expr = HexagonMCExpr::create(Expr, Context);
HexagonMCInstrInfo::setMustNotExtend(*Expr, MustNotExtend);
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp?rev=262400&r1=262399&r2=262400&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp Tue Mar 1 15:37:41 2016
@@ -21,7 +21,6 @@
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
-#include "llvm/MC/MCValue.h"
namespace llvm {
void HexagonMCInstrInfo::addConstant(MCInst &MI, uint64_t Value,
@@ -432,19 +431,8 @@ bool HexagonMCInstrInfo::isConstExtended
HexagonMCInstrInfo::mustNotExtend(*MO.getExpr()))
return false;
int64_t Value;
- if (!MO.getExpr()->evaluateAsAbsolute(Value)) {
- MCValue Value;
- if (!MO.getExpr()->evaluateAsRelocatable(Value, nullptr, nullptr))
- return true;
- switch(Value.getAccessVariant()) {
- case MCSymbolRefExpr::VariantKind::VK_TPREL:
- case MCSymbolRefExpr::VariantKind::VK_DTPREL:
- // Don't lazy extend these expression variants
- return false;
- default:
- return true;
- }
- }
+ if (!MO.getExpr()->evaluateAsAbsolute(Value))
+ return true;
int MinValue = HexagonMCInstrInfo::getMinValue(MCII, MCI);
int MaxValue = HexagonMCInstrInfo::getMaxValue(MCII, MCI);
return (MinValue > Value || Value > MaxValue);
More information about the llvm-commits
mailing list