summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2015-04-28 01:37:11 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2015-04-28 01:37:11 +0000
commit190528703f8362c530c7867a44dac6cde938b5ac (patch)
tree98881d10b5b86f276329d3d39b0cc14d9a6ac4e0 /llvm/lib
parent09bff88fc4de030f3881674f23a865fa4da374e4 (diff)
downloadbcm5719-llvm-190528703f8362c530c7867a44dac6cde938b5ac.tar.gz
bcm5719-llvm-190528703f8362c530c7867a44dac6cde938b5ac.zip
[MC] Use LShr for constant evaluation of ">>" on ELF/arm64--darwin.
This matches other assemblers and is less unexpected (e.g. PR23227). On ELF, I tried binutils gas v2.24 and nasm 2.10.09, and they both agree on LShr. On COFF, I couldn't get my hands on an assembler yet, so don't change the behavior. For now, don't change it on non-AArch64 Darwin either, as the other assembler is gas v1.38, which does an AShr. llvm-svn: 235963
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCAsmInfo.cpp2
-rw-r--r--llvm/lib/MC/MCAsmInfoCOFF.cpp4
-rw-r--r--llvm/lib/MC/MCAsmInfoDarwin.cpp5
-rw-r--r--llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp4
4 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCAsmInfo.cpp b/llvm/lib/MC/MCAsmInfo.cpp
index 22de8bd13dc..1a45b5a389f 100644
--- a/llvm/lib/MC/MCAsmInfo.cpp
+++ b/llvm/lib/MC/MCAsmInfo.cpp
@@ -90,7 +90,7 @@ MCAsmInfo::MCAsmInfo() {
DwarfRegNumForCFI = false;
NeedsDwarfSectionOffsetDirective = false;
UseParensForSymbolVariant = false;
- UseLogicalShr = false;
+ UseLogicalShr = true;
// FIXME: Clang's logic should be synced with the logic used to initialize
// this member and the two implementations should be merged.
diff --git a/llvm/lib/MC/MCAsmInfoCOFF.cpp b/llvm/lib/MC/MCAsmInfoCOFF.cpp
index bb3f0d3a429..97fc76a9adb 100644
--- a/llvm/lib/MC/MCAsmInfoCOFF.cpp
+++ b/llvm/lib/MC/MCAsmInfoCOFF.cpp
@@ -36,6 +36,10 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
NeedsDwarfSectionOffsetDirective = true;
UseIntegratedAssembler = true;
+
+ // FIXME: For now keep the previous behavior, AShr. Need to double-check
+ // other COFF-targeting assemblers and change this if necessary.
+ UseLogicalShr = false;
}
void MCAsmInfoMicrosoft::anchor() { }
diff --git a/llvm/lib/MC/MCAsmInfoDarwin.cpp b/llvm/lib/MC/MCAsmInfoDarwin.cpp
index ae9486d3db4..bb90ff2c350 100644
--- a/llvm/lib/MC/MCAsmInfoDarwin.cpp
+++ b/llvm/lib/MC/MCAsmInfoDarwin.cpp
@@ -93,4 +93,9 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
UseIntegratedAssembler = true;
SetDirectiveSuppressesReloc = true;
+
+ // FIXME: For now keep the previous behavior, AShr, matching the previous
+ // behavior of as(1) (both -q and -Q: resp. LLVM and gas v1.38).
+ // If/when this changes, the AArch64 Darwin special case can go away.
+ UseLogicalShr = false;
}
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
index f048474fd4a..c4122040041 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
@@ -48,6 +48,10 @@ AArch64MCAsmInfoDarwin::AArch64MCAsmInfoDarwin() {
UseDataRegionDirectives = true;
ExceptionsType = ExceptionHandling::DwarfCFI;
+
+ // AArch64 Darwin doesn't have the baggage of X86/ARM, so it's fine to use
+ // LShr instead of AShr.
+ UseLogicalShr = true;
}
const MCExpr *AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(
OpenPOWER on IntegriCloud