summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AVR
diff options
context:
space:
mode:
authorDylan McKay <me@dylanmckay.io>2017-12-11 11:01:27 +0000
committerDylan McKay <me@dylanmckay.io>2017-12-11 11:01:27 +0000
commit2124bcf805f55af3df02d3d56d739bcd6c5d0ef4 (patch)
treedd8cb99868971667694eccb1583312069e3f60a7 /llvm/lib/Target/AVR
parentab6204b1e57aa99788f019b2653d0607fe44c1a5 (diff)
downloadbcm5719-llvm-2124bcf805f55af3df02d3d56d739bcd6c5d0ef4.tar.gz
bcm5719-llvm-2124bcf805f55af3df02d3d56d739bcd6c5d0ef4.zip
[AVR] Implement some missing code paths
This has been broken since r320009. llvm-svn: 320348
Diffstat (limited to 'llvm/lib/Target/AVR')
-rw-r--r--llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp20
-rw-r--r--llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp3
2 files changed, 19 insertions, 4 deletions
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
index 4016773e9b4..2d9dd4f8f83 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
@@ -265,15 +265,19 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup,
adjust::ldi::fixup(Size, Fixup, Value, Ctx);
break;
case AVR::fixup_lo8_ldi:
+ adjust::ldi::lo8(Size, Fixup, Value, Ctx);
+ break;
case AVR::fixup_lo8_ldi_pm:
- if (Kind == AVR::fixup_lo8_ldi_pm) adjust::pm(Value);
-
+ case AVR::fixup_lo8_ldi_gs:
+ adjust::pm(Value);
adjust::ldi::lo8(Size, Fixup, Value, Ctx);
break;
case AVR::fixup_hi8_ldi:
+ adjust::ldi::hi8(Size, Fixup, Value, Ctx);
+ break;
case AVR::fixup_hi8_ldi_pm:
- if (Kind == AVR::fixup_hi8_ldi_pm) adjust::pm(Value);
-
+ case AVR::fixup_hi8_ldi_gs:
+ adjust::pm(Value);
adjust::ldi::hi8(Size, Fixup, Value, Ctx);
break;
case AVR::fixup_hh8_ldi:
@@ -316,6 +320,13 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup,
Value &= 0xffff;
break;
+ case AVR::fixup_16_pm:
+ Value >>= 1; // Flash addresses are always shifted.
+ adjust::unsigned_width(16, Value, std::string("port number"), Fixup, Ctx);
+
+ Value &= 0xffff;
+ break;
+
case AVR::fixup_6_adiw:
adjust::fixup_6_adiw(Fixup, Value, Ctx);
break;
@@ -329,6 +340,7 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup,
break;
// Fixups which do not require adjustments.
+ case FK_Data_1:
case FK_Data_2:
case FK_Data_4:
case FK_Data_8:
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp
index 4e13e7adf39..d4a67973af7 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.cpp
@@ -168,6 +168,9 @@ AVR::Fixups AVRMCExpr::getFixupKind() const {
case VK_AVR_PM_HH8:
Kind = isNegated() ? AVR::fixup_hh8_ldi_pm_neg : AVR::fixup_hh8_ldi_pm;
break;
+ case VK_AVR_GS:
+ Kind = AVR::fixup_16_pm;
+ break;
case VK_AVR_LO8_GS:
Kind = AVR::fixup_lo8_ldi_gs;
break;
OpenPOWER on IntegriCloud