From 8d19e7f91825749c8971e4ba49aacaf9f142cea9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 26 Aug 2010 21:30:24 +0200 Subject: [PATCH] Use ULL as qualifier for 64 bit integer constants --- orc/orcemulateopcodes.c | 6 +++--- orc/orcfunctions.c | 6 +++--- orc/orcprogram-c.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/orc/orcemulateopcodes.c b/orc/orcemulateopcodes.c index f7d7a1a..c7559d0 100644 --- a/orc/orcemulateopcodes.c +++ b/orc/orcemulateopcodes.c @@ -33,7 +33,7 @@ #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) -#define ORC_SWAP_Q(x) ((((x)&0xffU)<<56) | (((x)&0xff00U)<<40) | (((x)&0xff0000U)<<24) | (((x)&0xff000000U)<<8) | (((x)&0xff00000000U)>>8) | (((x)&0xff0000000000U)>>24) | (((x)&0xff000000000000U)>>40) | (((x)&0xff00000000000000U)>>56)) +#define ORC_SWAP_Q(x) ((((x)&0xffULL)<<56) | (((x)&0xff00ULL)<<40) | (((x)&0xff0000ULL)<<24) | (((x)&0xff000000ULL)<<8) | (((x)&0xff00000000ULL)>>8) | (((x)&0xff0000000000ULL)>>24) | (((x)&0xff000000000000ULL)>>40) | (((x)&0xff00000000000000ULL)>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_RECAST_INT(x) (((orc_union32)(x)).i) #define ORC_RECAST_FLOAT(x) (((orc_union32)(orc_int32)(x)).f) @@ -43,8 +43,8 @@ #define ORC_MAXF(a,b) (ORC_ISNAN(a) ? a : ORC_ISNAN(b) ? b : ((a)>(b)) ? (a) : (b)) #define ORC_RECAST_INT64(x) (((orc_union64)(x)).i) #define ORC_RECAST_DOUBLE(x) (((orc_union64)(orc_int64)(x)).f) -#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000) == 0) ? 0xfff0000000000000 : 0xffffffffffffffff)) -#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000) == 0x7ff0000000000000) && ((ORC_RECAST_INT64(x)&0x000fffffffffffff) != 0)) +#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0) ? 0xfff0000000000000ULL : 0xffffffffffffffffULL)) +#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0x7ff0000000000000ULL) && ((ORC_RECAST_INT64(x)&0x000fffffffffffffULL) != 0)) #define ORC_MIND(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)<(b)) ? (a) : (b)) #define ORC_MAXD(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)>(b)) ? (a) : (b)) #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L diff --git a/orc/orcfunctions.c b/orc/orcfunctions.c index 13fde14..43ae9a2 100644 --- a/orc/orcfunctions.c +++ b/orc/orcfunctions.c @@ -79,7 +79,7 @@ void orc_memset (void * d1, int p1, int n); #define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX) #define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8)) #define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24)) -#define ORC_SWAP_Q(x) ((((x)&0xffU)<<56) | (((x)&0xff00U)<<40) | (((x)&0xff0000U)<<24) | (((x)&0xff000000U)<<8) | (((x)&0xff00000000U)>>8) | (((x)&0xff0000000000U)>>24) | (((x)&0xff000000000000U)>>40) | (((x)&0xff00000000000000U)>>56)) +#define ORC_SWAP_Q(x) ((((x)&0xffULL)<<56) | (((x)&0xff00ULL)<<40) | (((x)&0xff0000ULL)<<24) | (((x)&0xff000000ULL)<<8) | (((x)&0xff00000000ULL)>>8) | (((x)&0xff0000000000ULL)>>24) | (((x)&0xff000000000000ULL)>>40) | (((x)&0xff00000000000000ULL)>>56)) #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset))) #define ORC_RECAST_INT(x) (((orc_union32)(x)).i) #define ORC_RECAST_FLOAT(x) (((orc_union32)(orc_int32)(x)).f) @@ -89,8 +89,8 @@ void orc_memset (void * d1, int p1, int n); #define ORC_MAXF(a,b) (ORC_ISNAN(a) ? a : ORC_ISNAN(b) ? b : ((a)>(b)) ? (a) : (b)) #define ORC_RECAST_INT64(x) (((orc_union64)(x)).i) #define ORC_RECAST_DOUBLE(x) (((orc_union64)(orc_int64)(x)).f) -#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000) == 0) ? 0xfff0000000000000 : 0xffffffffffffffff)) -#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000) == 0x7ff0000000000000) && ((ORC_RECAST_INT64(x)&0x000fffffffffffff) != 0)) +#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0) ? 0xfff0000000000000ULL : 0xffffffffffffffffULL)) +#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0x7ff0000000000000ULL) && ((ORC_RECAST_INT64(x)&0x000fffffffffffffULL) != 0)) #define ORC_MIND(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)<(b)) ? (a) : (b)) #define ORC_MAXD(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)>(b)) ? (a) : (b)) #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L diff --git a/orc/orcprogram-c.c b/orc/orcprogram-c.c index 64c2035..9c0c084 100644 --- a/orc/orcprogram-c.c +++ b/orc/orcprogram-c.c @@ -101,7 +101,7 @@ orc_target_c_get_asm_preamble (void) "#define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)\n" "#define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8))\n" "#define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24))\n" - "#define ORC_SWAP_Q(x) ((((x)&0xffU)<<56) | (((x)&0xff00U)<<40) | (((x)&0xff0000U)<<24) | (((x)&0xff000000U)<<8) | (((x)&0xff00000000U)>>8) | (((x)&0xff0000000000U)>>24) | (((x)&0xff000000000000U)>>40) | (((x)&0xff00000000000000U)>>56))\n" + "#define ORC_SWAP_Q(x) ((((x)&0xffULL)<<56) | (((x)&0xff00ULL)<<40) | (((x)&0xff0000ULL)<<24) | (((x)&0xff000000ULL)<<8) | (((x)&0xff00000000ULL)>>8) | (((x)&0xff0000000000ULL)>>24) | (((x)&0xff000000000000ULL)>>40) | (((x)&0xff00000000000000ULL)>>56))\n" "#define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))\n" "#define ORC_RECAST_INT(x) (((orc_union32)(x)).i)\n" "#define ORC_RECAST_FLOAT(x) (((orc_union32)(orc_int32)(x)).f)\n" @@ -111,8 +111,8 @@ orc_target_c_get_asm_preamble (void) "#define ORC_MAXF(a,b) (ORC_ISNAN(a) ? a : ORC_ISNAN(b) ? b : ((a)>(b)) ? (a) : (b))\n" "#define ORC_RECAST_INT64(x) (((orc_union64)(x)).i)\n" "#define ORC_RECAST_DOUBLE(x) (((orc_union64)(orc_int64)(x)).f)\n" - "#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000) == 0) ? 0xfff0000000000000 : 0xffffffffffffffff))\n" - "#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000) == 0x7ff0000000000000) && ((ORC_RECAST_INT64(x)&0x000fffffffffffff) != 0))\n" + "#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0) ? 0xfff0000000000000ULL : 0xffffffffffffffffULL))\n" + "#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0x7ff0000000000000ULL) && ((ORC_RECAST_INT64(x)&0x000fffffffffffffULL) != 0))\n" "#define ORC_MIND(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)<(b)) ? (a) : (b))\n" "#define ORC_MAXD(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)>(b)) ? (a) : (b))\n" "#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n" -- 2.7.4