diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-03-29 17:38:47 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-03-29 17:38:47 +0000 |
| commit | f60c556b918eb9a4dcb88da9c1701dd0812b6369 (patch) | |
| tree | 19612d71b5a659ba616e0fd9c512a384e2a0ef94 /llvm/lib/Target/CellSPU/SPU.h | |
| parent | 61f3bd677277475312ffa8d1842a9201c4807c27 (diff) | |
| download | bcm5719-llvm-f60c556b918eb9a4dcb88da9c1701dd0812b6369.tar.gz bcm5719-llvm-f60c556b918eb9a4dcb88da9c1701dd0812b6369.zip | |
From Kalle Raiskila:
"the bigstack patch for SPU, with testcase. It is essentially the patch committed as 97091, and reverted as 97099, but with the following additions:
-in vararg handling, registers are marked to be live, to not confuse the register scavenger
-function prologue and epilogue are not emitted, if the stack size is 16. 16 means it is empty - there is only the register scavenger emergency spill slot, which is not used as there is no stack."
llvm-svn: 99819
Diffstat (limited to 'llvm/lib/Target/CellSPU/SPU.h')
| -rw-r--r-- | llvm/lib/Target/CellSPU/SPU.h | 67 |
1 files changed, 64 insertions, 3 deletions
diff --git a/llvm/lib/Target/CellSPU/SPU.h b/llvm/lib/Target/CellSPU/SPU.h index c96097494ea..c6208121902 100644 --- a/llvm/lib/Target/CellSPU/SPU.h +++ b/llvm/lib/Target/CellSPU/SPU.h @@ -66,9 +66,6 @@ namespace llvm { //! Predicate test for an unsigned 10-bit value /*! \param Value The input value to be tested - - This predicate tests for an unsigned 10-bit value, returning the 10-bit value - as a short if true. */ inline bool isU10Constant(short Value) { return (Value == (Value & 0x3ff)); @@ -90,6 +87,70 @@ namespace llvm { return (Value == (Value & 0x3ff)); } + //! Predicate test for a signed 14-bit value + /*! + \param Value The input value to be tested + */ + template<typename T> + inline bool isS14Constant(T Value); + + template<> + inline bool isS14Constant<short>(short Value) { + return (Value >= -(1 << 13) && Value <= (1 << 13) - 1); + } + + template<> + inline bool isS14Constant<int>(int Value) { + return (Value >= -(1 << 13) && Value <= (1 << 13) - 1); + } + + template<> + inline bool isS14Constant<uint32_t>(uint32_t Value) { + return (Value <= ((1 << 13) - 1)); + } + + template<> + inline bool isS14Constant<int64_t>(int64_t Value) { + return (Value >= -(1 << 13) && Value <= (1 << 13) - 1); + } + + template<> + inline bool isS14Constant<uint64_t>(uint64_t Value) { + return (Value <= ((1 << 13) - 1)); + } + + //! Predicate test for a signed 16-bit value + /*! + \param Value The input value to be tested + */ + template<typename T> + inline bool isS16Constant(T Value); + + template<> + inline bool isS16Constant<short>(short Value) { + return true; + } + + template<> + inline bool isS16Constant<int>(int Value) { + return (Value >= -(1 << 15) && Value <= (1 << 15) - 1); + } + + template<> + inline bool isS16Constant<uint32_t>(uint32_t Value) { + return (Value <= ((1 << 15) - 1)); + } + + template<> + inline bool isS16Constant<int64_t>(int64_t Value) { + return (Value >= -(1 << 15) && Value <= (1 << 15) - 1); + } + + template<> + inline bool isS16Constant<uint64_t>(uint64_t Value) { + return (Value <= ((1 << 15) - 1)); + } + extern Target TheCellSPUTarget; } |

