[llvm] r252681 - [MC] Use LShr for constant evaluation of ">>" on non-arm64 darwin.
Ahmed Bougacha via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 16:51:37 PST 2015
Author: ab
Date: Tue Nov 10 18:51:36 2015
New Revision: 252681
URL: http://llvm.org/viewvc/llvm-project?rev=252681&view=rev
Log:
[MC] Use LShr for constant evaluation of ">>" on non-arm64 darwin.
Follow-up to r235963: this matches other assemblers and is less
unexpected (e.g. PR23227).
Modified:
llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp
llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
llvm/trunk/test/MC/AsmParser/expr-shr.s
llvm/trunk/test/MC/AsmParser/exprs.s
Modified: llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp?rev=252681&r1=252680&r2=252681&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmInfoCOFF.cpp Tue Nov 10 18:51:36 2015
@@ -37,8 +37,7 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
UseIntegratedAssembler = true;
- // FIXME: For now keep the previous behavior, AShr. Need to double-check
- // other COFF-targeting assemblers and change this if necessary.
+ // At least MSVC inline-asm does AShr.
UseLogicalShr = false;
}
Modified: llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp?rev=252681&r1=252680&r2=252681&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmInfoDarwin.cpp Tue Nov 10 18:51:36 2015
@@ -93,9 +93,4 @@ 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;
}
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp?rev=252681&r1=252680&r2=252681&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp Tue Nov 10 18:51:36 2015
@@ -48,10 +48,6 @@ AArch64MCAsmInfoDarwin::AArch64MCAsmInfo
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(
Modified: llvm/trunk/test/MC/AsmParser/expr-shr.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/expr-shr.s?rev=252681&r1=252680&r2=252681&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/expr-shr.s (original)
+++ llvm/trunk/test/MC/AsmParser/expr-shr.s Tue Nov 10 18:51:36 2015
@@ -1,13 +1,12 @@
// RUN: llvm-mc -triple x86_64-unknown-unknown-elf %s | FileCheck %s --check-prefix=CHECK
+// RUN: llvm-mc -triple x86_64-unknown-darwin %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 does AShr.
// MSVC: .quad -1
-// DARWIN: .quad -1
.quad (~0 >> 62)
Modified: llvm/trunk/test/MC/AsmParser/exprs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/exprs.s?rev=252681&r1=252680&r2=252681&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/exprs.s (original)
+++ llvm/trunk/test/MC/AsmParser/exprs.s Tue Nov 10 18:51:36 2015
@@ -34,7 +34,7 @@ k:
check_expr 1 | 2, 3
check_expr 1 << 1, 2
check_expr 2 >> 1, 1
- check_expr (~0 >> 1), -1
+ check_expr (~0 >> 62), 3
check_expr 3 - 2, 1
check_expr 1 ^ 3, 2
check_expr 1 && 2, 1
More information about the llvm-commits
mailing list