From f60c556b918eb9a4dcb88da9c1701dd0812b6369 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 29 Mar 2010 17:38:47 +0000 Subject: 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 --- llvm/lib/Target/CellSPU/SPU.h | 67 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Target/CellSPU/SPU.h') 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 + inline bool isS14Constant(T Value); + + template<> + inline bool isS14Constant(short Value) { + return (Value >= -(1 << 13) && Value <= (1 << 13) - 1); + } + + template<> + inline bool isS14Constant(int Value) { + return (Value >= -(1 << 13) && Value <= (1 << 13) - 1); + } + + template<> + inline bool isS14Constant(uint32_t Value) { + return (Value <= ((1 << 13) - 1)); + } + + template<> + inline bool isS14Constant(int64_t Value) { + return (Value >= -(1 << 13) && Value <= (1 << 13) - 1); + } + + template<> + inline bool isS14Constant(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 + inline bool isS16Constant(T Value); + + template<> + inline bool isS16Constant(short Value) { + return true; + } + + template<> + inline bool isS16Constant(int Value) { + return (Value >= -(1 << 15) && Value <= (1 << 15) - 1); + } + + template<> + inline bool isS16Constant(uint32_t Value) { + return (Value <= ((1 << 15) - 1)); + } + + template<> + inline bool isS16Constant(int64_t Value) { + return (Value >= -(1 << 15) && Value <= (1 << 15) - 1); + } + + template<> + inline bool isS16Constant(uint64_t Value) { + return (Value <= ((1 << 15) - 1)); + } + extern Target TheCellSPUTarget; } -- cgit v1.2.3