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
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.
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() { }
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;
}
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(
--- /dev/null
+// RUN: llvm-mc -triple aarch64-unknown-unknown-elf %s | FileCheck %s --check-prefix=ELF
+// RUN: llvm-mc -triple aarch64-unknown-darwin %s | FileCheck %s --check-prefix=DARWIN
+
+.data
+
+// ELF: .xword 3
+// DARWIN: .quad 3
+.quad (~0 >> 62)
// RUN: llvm-mc -triple arm-unknown-linux %s | FileCheck %s
// CHECK: .byte 1
-.if [~0 >> 1] == -1
+.if [~0 >> 63] == 1
.byte 1
.else
.byte 2
--- /dev/null
+// RUN: llvm-mc -triple x86_64-unknown-unknown-elf %s | FileCheck %s --check-prefix=CHECK
+// RUN: llvm-mc -triple x86_64-pc-windows-msvc %s | FileCheck %s --check-prefix=MSVC
+// RUN: llvm-mc -triple x86_64-unknown-darwin %s | FileCheck %s --check-prefix=DARWIN
+
+.data
+
+// CHECK: .quad 3
+
+// Both COFF and Darwin still use AShr.
+// MSVC: .quad -1
+// DARWIN: .quad -1
+
+.quad (~0 >> 62)
// RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
// CHECK: .byte 1
-.if [~0 >> 1] == -1
+.if [~0 >> 63] == 1
.byte 1
.else
.byte 2