[llvm-commits] [llvm] r78793 - in /llvm/trunk: include/llvm/Support/MathExtras.h lib/Target/Blackfin/BlackfinInstrInfo.td lib/Target/Blackfin/BlackfinRegisterInfo.cpp lib/Target/Blackfin/BlackfinRegisterInfo.h

Daniel Dunbar daniel at zuster.org
Wed Aug 12 19:56:28 PDT 2009


Hi Jakob,

On Tue, Aug 11, 2009 at 11:22 PM, Jakob Stoklund Olesen<stoklund at 2pi.dk> wrote:
> +template<unsigned N>
> +inline bool isInt(int64_t x) {
> +  return -(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1));
> +}
> +
> +template<unsigned N>
> +inline bool isUint(uint64_t x) {
> +  return x < (UINT64_C(1)<<N);
> +}

It's probably worth fixing this for N == 64, just in case.

 - Daniel




More information about the llvm-commits mailing list