diff options
| author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-11-11 00:51:36 +0000 |
|---|---|---|
| committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-11-11 00:51:36 +0000 |
| commit | 4a856439071995d105ddcb57de01e78e7142cb2d (patch) | |
| tree | 9025e261d3ceb219f3cfcc1e3578a75c770edfde /llvm | |
| parent | de14eb5b4e73ae809997c8f40517dbdcf97b00ea (diff) | |
| download | bcm5719-llvm-4a856439071995d105ddcb57de01e78e7142cb2d.tar.gz bcm5719-llvm-4a856439071995d105ddcb57de01e78e7142cb2d.zip | |
[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).
llvm-svn: 252681
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/MC/MCAsmInfoCOFF.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/MC/MCAsmInfoDarwin.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp | 4 | ||||
| -rw-r--r-- | llvm/test/MC/AsmParser/expr-shr.s | 5 | ||||
| -rw-r--r-- | llvm/test/MC/AsmParser/exprs.s | 2 |
5 files changed, 4 insertions, 15 deletions
diff --git a/llvm/lib/MC/MCAsmInfoCOFF.cpp b/llvm/lib/MC/MCAsmInfoCOFF.cpp index 97fc76a9adb..5b9dd2009f8 100644 --- a/llvm/lib/MC/MCAsmInfoCOFF.cpp +++ b/llvm/lib/MC/MCAsmInfoCOFF.cpp @@ -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; } diff --git a/llvm/lib/MC/MCAsmInfoDarwin.cpp b/llvm/lib/MC/MCAsmInfoDarwin.cpp index bb90ff2c350..ae9486d3db4 100644 --- a/llvm/lib/MC/MCAsmInfoDarwin.cpp +++ b/llvm/lib/MC/MCAsmInfoDarwin.cpp @@ -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; } diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp index 921c4b94a72..fbce26e1d9a 100644 --- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp +++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp @@ -48,10 +48,6 @@ 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( diff --git a/llvm/test/MC/AsmParser/expr-shr.s b/llvm/test/MC/AsmParser/expr-shr.s index fc117b64e95..792bef050d3 100644 --- a/llvm/test/MC/AsmParser/expr-shr.s +++ b/llvm/test/MC/AsmParser/expr-shr.s @@ -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) diff --git a/llvm/test/MC/AsmParser/exprs.s b/llvm/test/MC/AsmParser/exprs.s index c5fc9b594a0..1c3e284bcf7 100644 --- a/llvm/test/MC/AsmParser/exprs.s +++ b/llvm/test/MC/AsmParser/exprs.s @@ -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 |

