mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Mac OS X X86-64 low 4G address not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -614,7 +614,8 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
|
|||||||
bool isStatic = TM.getRelocationModel() == Reloc::Static;
|
bool isStatic = TM.getRelocationModel() == Reloc::Static;
|
||||||
SDOperand N0 = N.getOperand(0);
|
SDOperand N0 = N.getOperand(0);
|
||||||
// Mac OS X X86-64 lower 4G address is not available.
|
// Mac OS X X86-64 lower 4G address is not available.
|
||||||
bool isAbs32 = !is64Bit || (isStatic && !Subtarget->isTargetDarwin());
|
bool isAbs32 = !is64Bit ||
|
||||||
|
(isStatic && Subtarget->hasLow4GUserSpaceAddress());
|
||||||
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(N0)) {
|
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(N0)) {
|
||||||
GlobalValue *GV = G->getGlobal();
|
GlobalValue *GV = G->getGlobal();
|
||||||
if (isAbs32 || isRoot) {
|
if (isAbs32 || isRoot) {
|
||||||
|
@@ -162,6 +162,7 @@ def HasSSSE3 : Predicate<"Subtarget->hasSSSE3()">;
|
|||||||
def FPStack : Predicate<"!Subtarget->hasSSE2()">;
|
def FPStack : Predicate<"!Subtarget->hasSSE2()">;
|
||||||
def In32BitMode : Predicate<"!Subtarget->is64Bit()">;
|
def In32BitMode : Predicate<"!Subtarget->is64Bit()">;
|
||||||
def In64BitMode : Predicate<"Subtarget->is64Bit()">;
|
def In64BitMode : Predicate<"Subtarget->is64Bit()">;
|
||||||
|
def HasLow4G : Predicate<"Subtarget->hasLow4GUserSpaceAddress()">;
|
||||||
def SmallCode : Predicate<"TM.getCodeModel() == CodeModel::Small">;
|
def SmallCode : Predicate<"TM.getCodeModel() == CodeModel::Small">;
|
||||||
def NotSmallCode : Predicate<"TM.getCodeModel() != CodeModel::Small">;
|
def NotSmallCode : Predicate<"TM.getCodeModel() != CodeModel::Small">;
|
||||||
def IsStatic : Predicate<"TM.getRelocationModel() == Reloc::Static">;
|
def IsStatic : Predicate<"TM.getRelocationModel() == Reloc::Static">;
|
||||||
|
@@ -225,6 +225,7 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
|
|||||||
// FIXME: this is a known good value for Yonah. How about others?
|
// FIXME: this is a known good value for Yonah. How about others?
|
||||||
, MinRepStrSizeThreshold(128)
|
, MinRepStrSizeThreshold(128)
|
||||||
, Is64Bit(is64Bit)
|
, Is64Bit(is64Bit)
|
||||||
|
, HasLow4GUserAddress(true)
|
||||||
, TargetType(isELF) { // Default to ELF unless otherwise specified.
|
, TargetType(isELF) { // Default to ELF unless otherwise specified.
|
||||||
|
|
||||||
// Determine default and user specified characteristics
|
// Determine default and user specified characteristics
|
||||||
@@ -285,6 +286,9 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TargetType == isDarwin && Is64Bit)
|
||||||
|
HasLow4GUserAddress = false;
|
||||||
|
|
||||||
if (TargetType == isDarwin ||
|
if (TargetType == isDarwin ||
|
||||||
TargetType == isCygwin ||
|
TargetType == isCygwin ||
|
||||||
TargetType == isMingw ||
|
TargetType == isMingw ||
|
||||||
|
@@ -46,18 +46,23 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// AsmFlavor - Which x86 asm dialect to use.
|
/// AsmFlavor - Which x86 asm dialect to use.
|
||||||
|
///
|
||||||
AsmWriterFlavorTy AsmFlavor;
|
AsmWriterFlavorTy AsmFlavor;
|
||||||
|
|
||||||
/// PICStyle - Which PIC style to use
|
/// PICStyle - Which PIC style to use
|
||||||
|
///
|
||||||
PICStyle::Style PICStyle;
|
PICStyle::Style PICStyle;
|
||||||
|
|
||||||
/// X86SSELevel - MMX, SSE1, SSE2, SSE3, SSSE3, or none supported.
|
/// X86SSELevel - MMX, SSE1, SSE2, SSE3, SSSE3, or none supported.
|
||||||
|
///
|
||||||
X86SSEEnum X86SSELevel;
|
X86SSEEnum X86SSELevel;
|
||||||
|
|
||||||
/// X863DNowLevel - 3DNow or 3DNow Athlon, or none supported.
|
/// X863DNowLevel - 3DNow or 3DNow Athlon, or none supported.
|
||||||
|
///
|
||||||
X863DNowEnum X863DNowLevel;
|
X863DNowEnum X863DNowLevel;
|
||||||
|
|
||||||
/// HasX86_64 - True if the processor supports X86-64 instructions.
|
/// HasX86_64 - True if the processor supports X86-64 instructions.
|
||||||
|
///
|
||||||
bool HasX86_64;
|
bool HasX86_64;
|
||||||
|
|
||||||
/// stackAlignment - The minimum alignment known to hold of the stack frame on
|
/// stackAlignment - The minimum alignment known to hold of the stack frame on
|
||||||
@@ -65,6 +70,7 @@ protected:
|
|||||||
unsigned stackAlignment;
|
unsigned stackAlignment;
|
||||||
|
|
||||||
/// Min. memset / memcpy size that is turned into rep/movs, rep/stos ops.
|
/// Min. memset / memcpy size that is turned into rep/movs, rep/stos ops.
|
||||||
|
///
|
||||||
unsigned MinRepStrSizeThreshold;
|
unsigned MinRepStrSizeThreshold;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -72,6 +78,10 @@ private:
|
|||||||
/// pointer size is 64 bit.
|
/// pointer size is 64 bit.
|
||||||
bool Is64Bit;
|
bool Is64Bit;
|
||||||
|
|
||||||
|
/// HasLow4GUserAddress - True if the low 4G user-space address is available.
|
||||||
|
///
|
||||||
|
bool HasLow4GUserAddress;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
isELF, isCygwin, isDarwin, isWindows, isMingw
|
isELF, isCygwin, isDarwin, isWindows, isMingw
|
||||||
@@ -103,6 +113,10 @@ public:
|
|||||||
|
|
||||||
bool is64Bit() const { return Is64Bit; }
|
bool is64Bit() const { return Is64Bit; }
|
||||||
|
|
||||||
|
/// hasLow4GUserSpaceAddress - True if lower 4G user-space address is
|
||||||
|
/// available.
|
||||||
|
bool hasLow4GUserSpaceAddress() const { return HasLow4GUserAddress; }
|
||||||
|
|
||||||
PICStyle::Style getPICStyle() const { return PICStyle; }
|
PICStyle::Style getPICStyle() const { return PICStyle; }
|
||||||
void setPICStyle(PICStyle::Style Style) { PICStyle = Style; }
|
void setPICStyle(PICStyle::Style Style) { PICStyle = Style; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user