diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-03-13 23:20:37 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-13 23:20:37 +0000 |
commit | 2dd2c652b21f9cbfd67d7524b80bb86c51130b90 (patch) | |
tree | 63054a50b9d8a8e7cc2fbc94f5bb2a870f7198df /llvm/lib/Target/PowerPC/PPCISelLowering.cpp | |
parent | 60f495100a048cc1a6e50e7e68ee5157b2b6c83c (diff) | |
download | bcm5719-llvm-2dd2c652b21f9cbfd67d7524b80bb86c51130b90.tar.gz bcm5719-llvm-2dd2c652b21f9cbfd67d7524b80bb86c51130b90.zip |
Added getTargetLowering() to TargetMachine. Refactored targets to support this.
llvm-svn: 26742
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index dac58f53680..0590b9ed687 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -14,6 +14,7 @@ #include "PPCISelLowering.h" #include "PPCTargetMachine.h" #include "llvm/ADT/VectorExtras.h" +#include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" @@ -1174,3 +1175,10 @@ isOperandValidForConstraint(SDOperand Op, char Letter) { // Handle standard constraint letters. return TargetLowering::isOperandValidForConstraint(Op, Letter); } + +/// isLegalAddressImmediate - Return true if the integer value can be used +/// as the offset of the target addressing mode. +bool PPCTargetLowering::isLegalAddressImmediate(int64_t V) const { + // PPC allows a sign-extended 16-bit immediate field. + return (V > -(1 << 16) && V < (1 << 16)-1); +} |