mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-30 15:10:30 +00:00
[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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252681 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f98fd35fa9
commit
5d2b5c7d99
@ -37,8 +37,7 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() {
|
|||||||
|
|
||||||
UseIntegratedAssembler = true;
|
UseIntegratedAssembler = true;
|
||||||
|
|
||||||
// FIXME: For now keep the previous behavior, AShr. Need to double-check
|
// At least MSVC inline-asm does AShr.
|
||||||
// other COFF-targeting assemblers and change this if necessary.
|
|
||||||
UseLogicalShr = false;
|
UseLogicalShr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,9 +93,4 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
|
|||||||
|
|
||||||
UseIntegratedAssembler = true;
|
UseIntegratedAssembler = true;
|
||||||
SetDirectiveSuppressesReloc = 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;
|
|
||||||
}
|
}
|
||||||
|
@ -48,10 +48,6 @@ AArch64MCAsmInfoDarwin::AArch64MCAsmInfoDarwin() {
|
|||||||
UseDataRegionDirectives = true;
|
UseDataRegionDirectives = true;
|
||||||
|
|
||||||
ExceptionsType = ExceptionHandling::DwarfCFI;
|
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(
|
const MCExpr *AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(
|
||||||
|
@ -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-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-pc-windows-msvc %s | FileCheck %s --check-prefix=MSVC
|
||||||
// RUN: llvm-mc -triple x86_64-unknown-darwin %s | FileCheck %s --check-prefix=DARWIN
|
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
// CHECK: .quad 3
|
// CHECK: .quad 3
|
||||||
|
|
||||||
// Both COFF and Darwin still use AShr.
|
// MSVC does AShr.
|
||||||
// MSVC: .quad -1
|
// MSVC: .quad -1
|
||||||
// DARWIN: .quad -1
|
|
||||||
|
|
||||||
.quad (~0 >> 62)
|
.quad (~0 >> 62)
|
||||||
|
@ -34,7 +34,7 @@ k:
|
|||||||
check_expr 1 | 2, 3
|
check_expr 1 | 2, 3
|
||||||
check_expr 1 << 1, 2
|
check_expr 1 << 1, 2
|
||||||
check_expr 2 >> 1, 1
|
check_expr 2 >> 1, 1
|
||||||
check_expr (~0 >> 1), -1
|
check_expr (~0 >> 62), 3
|
||||||
check_expr 3 - 2, 1
|
check_expr 3 - 2, 1
|
||||||
check_expr 1 ^ 3, 2
|
check_expr 1 ^ 3, 2
|
||||||
check_expr 1 && 2, 1
|
check_expr 1 && 2, 1
|
||||||
|
Loading…
Reference in New Issue
Block a user