diff options
Diffstat (limited to 'lib/Target/Alpha')
-rw-r--r-- | lib/Target/Alpha/AlphaAsmPrinter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelDAGToDAG.cpp | 7 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.cpp | 8 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.h | 2 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaInstrInfo.cpp | 1 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaInstrInfo.td | 2 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaSubtarget.cpp | 1 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaTargetMachine.cpp | 8 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaTargetMachine.h | 3 | ||||
-rw-r--r-- | lib/Target/Alpha/CMakeLists.txt | 25 | ||||
-rw-r--r-- | lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp | 43 | ||||
-rw-r--r-- | lib/Target/Alpha/MCTargetDesc/CMakeLists.txt | 7 | ||||
-rw-r--r-- | lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp | 2 | ||||
-rw-r--r-- | lib/Target/Alpha/TargetInfo/CMakeLists.txt | 8 |
14 files changed, 75 insertions, 44 deletions
diff --git a/lib/Target/Alpha/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AlphaAsmPrinter.cpp index 46ae286895..5dce06ac86 100644 --- a/lib/Target/Alpha/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AlphaAsmPrinter.cpp @@ -26,8 +26,8 @@ #include "llvm/Target/Mangler.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetRegistry.h" #include "llvm/ADT/SmallString.h" +#include "llvm/Support/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; diff --git a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp index 7b91fea54a..f877c65cd6 100644 --- a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp +++ b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp @@ -80,7 +80,7 @@ namespace { // Otherwise we don't know that the it's okay to zapnot this entire // byte. Only do this iff we can prove that the missing bits are // already null, so the bytezap doesn't need to really null them. - BitsToCheck |= ~Constant & (0xFF << 8*i); + BitsToCheck |= ~Constant & (0xFFULL << 8*i); } } } @@ -114,9 +114,8 @@ namespace { if (!x) return 0; unsigned at = CountLeadingZeros_64(x); uint64_t complow = 1ULL << (63 - at); - uint64_t comphigh = 1ULL << (64 - at); - //cerr << x << ":" << complow << ":" << comphigh << "\n"; - if (abs64(complow - x) <= abs64(comphigh - x)) + uint64_t comphigh = complow << 1; + if (x - complow <= comphigh - x) return complow; else return comphigh; diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp index de003fb4c6..3057eb8c57 100644 --- a/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/lib/Target/Alpha/AlphaISelLowering.cpp @@ -49,6 +49,7 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) // Set up the TargetLowering object. //I am having problems with shr n i8 1 setBooleanContents(ZeroOrOneBooleanContent); + setBooleanVectorContents(ZeroOrOneBooleanContent); // FIXME: Is this correct? addRegisterClass(MVT::i64, Alpha::GPRCRegisterClass); addRegisterClass(MVT::f64, Alpha::F8RCRegisterClass); @@ -153,6 +154,9 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) setOperationAction(ISD::JumpTable, MVT::i64, Custom); setOperationAction(ISD::JumpTable, MVT::i32, Custom); + setOperationAction(ISD::ATOMIC_LOAD, MVT::i32, Expand); + setOperationAction(ISD::ATOMIC_STORE, MVT::i32, Expand); + setStackPointerRegisterToSaveRestore(Alpha::R30); setJumpBufSize(272); @@ -160,10 +164,12 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) setMinFunctionAlignment(4); + setInsertFencesForAtomic(true); + computeRegisterProperties(); } -MVT::SimpleValueType AlphaTargetLowering::getSetCCResultType(EVT VT) const { +EVT AlphaTargetLowering::getSetCCResultType(EVT VT) const { return MVT::i64; } diff --git a/lib/Target/Alpha/AlphaISelLowering.h b/lib/Target/Alpha/AlphaISelLowering.h index 13383f4430..80f8efaea5 100644 --- a/lib/Target/Alpha/AlphaISelLowering.h +++ b/lib/Target/Alpha/AlphaISelLowering.h @@ -66,7 +66,7 @@ namespace llvm { virtual MVT getShiftAmountTy(EVT LHSTy) const { return MVT::i64; } /// getSetCCResultType - Get the SETCC result ValueType - virtual MVT::SimpleValueType getSetCCResultType(EVT VT) const; + virtual EVT getSetCCResultType(EVT VT) const; /// LowerOperation - Provide custom lowering hooks for some operations. /// diff --git a/lib/Target/Alpha/AlphaInstrInfo.cpp b/lib/Target/Alpha/AlphaInstrInfo.cpp index 4dcec8f317..8df2ed75f6 100644 --- a/lib/Target/Alpha/AlphaInstrInfo.cpp +++ b/lib/Target/Alpha/AlphaInstrInfo.cpp @@ -16,7 +16,6 @@ #include "AlphaMachineFunctionInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/Target/TargetRegistry.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/ErrorHandling.h" diff --git a/lib/Target/Alpha/AlphaInstrInfo.td b/lib/Target/Alpha/AlphaInstrInfo.td index b20171224e..c8c9377c3d 100644 --- a/lib/Target/Alpha/AlphaInstrInfo.td +++ b/lib/Target/Alpha/AlphaInstrInfo.td @@ -607,6 +607,8 @@ def : Pat<(membarrier (i64 imm), (i64 imm), (i64 imm), (i64 1), (i64 imm)), def : Pat<(membarrier (i64 imm), (i64 imm), (i64 imm), (i64 imm), (i64 imm)), (MB)>; +def : Pat<(atomic_fence (imm), (imm)), (MB)>; + //Basic Floating point ops //Floats diff --git a/lib/Target/Alpha/AlphaSubtarget.cpp b/lib/Target/Alpha/AlphaSubtarget.cpp index 624a5e2ebd..bd55ce9e31 100644 --- a/lib/Target/Alpha/AlphaSubtarget.cpp +++ b/lib/Target/Alpha/AlphaSubtarget.cpp @@ -13,7 +13,6 @@ #include "AlphaSubtarget.h" #include "Alpha.h" -#include "llvm/Target/TargetRegistry.h" #define GET_SUBTARGETINFO_TARGET_DESC #define GET_SUBTARGETINFO_CTOR diff --git a/lib/Target/Alpha/AlphaTargetMachine.cpp b/lib/Target/Alpha/AlphaTargetMachine.cpp index 4cdd3ab483..fc9a6771a9 100644 --- a/lib/Target/Alpha/AlphaTargetMachine.cpp +++ b/lib/Target/Alpha/AlphaTargetMachine.cpp @@ -14,7 +14,7 @@ #include "AlphaTargetMachine.h" #include "llvm/PassManager.h" #include "llvm/Support/FormattedStream.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" using namespace llvm; extern "C" void LLVMInitializeAlphaTarget() { @@ -23,9 +23,9 @@ extern "C" void LLVMInitializeAlphaTarget() { } AlphaTargetMachine::AlphaTargetMachine(const Target &T, StringRef TT, - StringRef CPU, - StringRef FS, Reloc::Model RM) - : LLVMTargetMachine(T, TT, CPU, FS, RM), + StringRef CPU, StringRef FS, + Reloc::Model RM, CodeModel::Model CM) + : LLVMTargetMachine(T, TT, CPU, FS, RM, CM), DataLayout("e-f128:128:128-n64"), FrameLowering(Subtarget), Subtarget(TT, CPU, FS), diff --git a/lib/Target/Alpha/AlphaTargetMachine.h b/lib/Target/Alpha/AlphaTargetMachine.h index 1d930d0a5c..48bb948a79 100644 --- a/lib/Target/Alpha/AlphaTargetMachine.h +++ b/lib/Target/Alpha/AlphaTargetMachine.h @@ -37,7 +37,8 @@ class AlphaTargetMachine : public LLVMTargetMachine { public: AlphaTargetMachine(const Target &T, StringRef TT, - StringRef CPU, StringRef FS, Reloc::Model RM); + StringRef CPU, StringRef FS, + Reloc::Model RM, CodeModel::Model CM); virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; } virtual const TargetFrameLowering *getFrameLowering() const { diff --git a/lib/Target/Alpha/CMakeLists.txt b/lib/Target/Alpha/CMakeLists.txt index a6027bbf0b..a6d551618b 100644 --- a/lib/Target/Alpha/CMakeLists.txt +++ b/lib/Target/Alpha/CMakeLists.txt @@ -1,11 +1,12 @@ set(LLVM_TARGET_DEFINITIONS Alpha.td) -tablegen(AlphaGenRegisterInfo.inc -gen-register-info) -tablegen(AlphaGenInstrInfo.inc -gen-instr-info) -tablegen(AlphaGenAsmWriter.inc -gen-asm-writer) -tablegen(AlphaGenDAGISel.inc -gen-dag-isel) -tablegen(AlphaGenCallingConv.inc -gen-callingconv) -tablegen(AlphaGenSubtargetInfo.inc -gen-subtarget) +llvm_tablegen(AlphaGenRegisterInfo.inc -gen-register-info) +llvm_tablegen(AlphaGenInstrInfo.inc -gen-instr-info) +llvm_tablegen(AlphaGenAsmWriter.inc -gen-asm-writer) +llvm_tablegen(AlphaGenDAGISel.inc -gen-dag-isel) +llvm_tablegen(AlphaGenCallingConv.inc -gen-callingconv) +llvm_tablegen(AlphaGenSubtargetInfo.inc -gen-subtarget) +add_public_tablegen_target(AlphaCommonTableGen) add_llvm_target(AlphaCodeGen AlphaAsmPrinter.cpp @@ -21,5 +22,17 @@ add_llvm_target(AlphaCodeGen AlphaSelectionDAGInfo.cpp ) +add_llvm_library_dependencies(LLVMAlphaCodeGen + LLVMAlphaDesc + LLVMAlphaInfo + LLVMAsmPrinter + LLVMCodeGen + LLVMCore + LLVMMC + LLVMSelectionDAG + LLVMSupport + LLVMTarget + ) + add_subdirectory(TargetInfo) add_subdirectory(MCTargetDesc) diff --git a/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp b/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp index 04bc434862..4ad021ca67 100644 --- a/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp +++ b/lib/Target/Alpha/MCTargetDesc/AlphaMCTargetDesc.cpp @@ -13,10 +13,11 @@ #include "AlphaMCTargetDesc.h" #include "AlphaMCAsmInfo.h" +#include "llvm/MC/MCCodeGenInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" #define GET_INSTRINFO_MC_DESC #include "AlphaGenInstrInfo.inc" @@ -36,20 +37,12 @@ static MCInstrInfo *createAlphaMCInstrInfo() { return X; } -extern "C" void LLVMInitializeAlphaMCInstrInfo() { - TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo); -} - static MCRegisterInfo *createAlphaMCRegisterInfo(StringRef TT) { MCRegisterInfo *X = new MCRegisterInfo(); InitAlphaMCRegisterInfo(X, Alpha::R26); return X; } -extern "C" void LLVMInitializeAlphaMCRegisterInfo() { - TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo); -} - static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS) { MCSubtargetInfo *X = new MCSubtargetInfo(); @@ -57,23 +50,29 @@ static MCSubtargetInfo *createAlphaMCSubtargetInfo(StringRef TT, StringRef CPU, return X; } -extern "C" void LLVMInitializeAlphaMCSubtargetInfo() { - TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget, - createAlphaMCSubtargetInfo); -} - -extern "C" void LLVMInitializeAlphaMCAsmInfo() { - RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget); -} - -MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM) { +static MCCodeGenInfo *createAlphaMCCodeGenInfo(StringRef TT, Reloc::Model RM, + CodeModel::Model CM) { MCCodeGenInfo *X = new MCCodeGenInfo(); - X->InitMCCodeGenInfo(Reloc::PIC_); + X->InitMCCodeGenInfo(Reloc::PIC_, CM); return X; } -extern "C" void LLVMInitializeAlphaMCCodeGenInfo() { +// Force static initialization. +extern "C" void LLVMInitializeAlphaTargetMC() { + // Register the MC asm info. + RegisterMCAsmInfo<AlphaMCAsmInfo> X(TheAlphaTarget); + + // Register the MC codegen info. TargetRegistry::RegisterMCCodeGenInfo(TheAlphaTarget, createAlphaMCCodeGenInfo); -} + // Register the MC instruction info. + TargetRegistry::RegisterMCInstrInfo(TheAlphaTarget, createAlphaMCInstrInfo); + + // Register the MC register info. + TargetRegistry::RegisterMCRegInfo(TheAlphaTarget, createAlphaMCRegisterInfo); + + // Register the MC subtarget info. + TargetRegistry::RegisterMCSubtargetInfo(TheAlphaTarget, + createAlphaMCSubtargetInfo); +} diff --git a/lib/Target/Alpha/MCTargetDesc/CMakeLists.txt b/lib/Target/Alpha/MCTargetDesc/CMakeLists.txt index ad0dd26aaf..f745ecbdb6 100644 --- a/lib/Target/Alpha/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/Alpha/MCTargetDesc/CMakeLists.txt @@ -2,3 +2,10 @@ add_llvm_library(LLVMAlphaDesc AlphaMCTargetDesc.cpp AlphaMCAsmInfo.cpp ) + +add_llvm_library_dependencies(LLVMAlphaDesc + LLVMAlphaInfo + LLVMMC + ) + +add_dependencies(LLVMAlphaDesc AlphaCommonTableGen) diff --git a/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp b/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp index f7099b9ae9..bdc69e788b 100644 --- a/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp +++ b/lib/Target/Alpha/TargetInfo/AlphaTargetInfo.cpp @@ -9,7 +9,7 @@ #include "Alpha.h" #include "llvm/Module.h" -#include "llvm/Target/TargetRegistry.h" +#include "llvm/Support/TargetRegistry.h" using namespace llvm; llvm::Target llvm::TheAlphaTarget; diff --git a/lib/Target/Alpha/TargetInfo/CMakeLists.txt b/lib/Target/Alpha/TargetInfo/CMakeLists.txt index 2a7291b90a..cac3178b78 100644 --- a/lib/Target/Alpha/TargetInfo/CMakeLists.txt +++ b/lib/Target/Alpha/TargetInfo/CMakeLists.txt @@ -4,4 +4,10 @@ add_llvm_library(LLVMAlphaInfo AlphaTargetInfo.cpp ) -add_dependencies(LLVMAlphaInfo AlphaCodeGenTable_gen) +add_llvm_library_dependencies(LLVMAlphaInfo + LLVMMC + LLVMSupport + LLVMTarget + ) + +add_dependencies(LLVMAlphaInfo AlphaCommonTableGen) |