diff options
author | David Terei <davidterei@gmail.com> | 2011-11-19 11:36:21 -0800 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2011-11-22 11:06:18 -0800 |
commit | 610e424879e8d9f3b5190647eb02f8b7a9e370d1 (patch) | |
tree | ceac417ac070c1f678a1dcc69945664e4d6b5a19 /includes/Stg.h | |
parent | 95768f4a15ae4141a68560c78736803bed6ef64c (diff) | |
download | haskell-610e424879e8d9f3b5190647eb02f8b7a9e370d1.tar.gz |
Tabs -> Spaces
Diffstat (limited to 'includes/Stg.h')
-rw-r--r-- | includes/Stg.h | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/includes/Stg.h b/includes/Stg.h index 1791795a0a..5f1f0799c5 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -117,7 +117,7 @@ * 'Portable' inlining: * INLINE_HEADER is for inline functions in header files (macros) * STATIC_INLINE is for inline functions in source files - * EXTERN_INLINE is for functions that we want to inline sometimes + * EXTERN_INLINE is for functions that we want to inline sometimes * (we also compile a static version of the function; see Inlines.c) */ #if defined(__GNUC__) || defined( __INTEL_COMPILER) @@ -177,7 +177,7 @@ #define GNU_ATTRIBUTE(at) #endif -#if __GNUC__ >= 3 +#if __GNUC__ >= 3 #define GNUC3_ATTRIBUTE(at) __attribute__((at)) #else #define GNUC3_ATTRIBUTE(at) @@ -202,18 +202,18 @@ Shorthand forms -------------------------------------------------------------------------- */ -typedef StgChar C_; -typedef StgWord W_; -typedef StgWord* P_; -typedef StgInt I_; +typedef StgChar C_; +typedef StgWord W_; +typedef StgWord* P_; +typedef StgInt I_; typedef StgWord StgWordArray[]; typedef StgFunPtr F_; #define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) #define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) -#define IF_(f) static StgFunPtr GNUC3_ATTRIBUTE(used) f(void) -#define FN_(f) StgFunPtr f(void) -#define EF_(f) extern StgFunPtr f(void) +#define IF_(f) static StgFunPtr GNUC3_ATTRIBUTE(used) f(void) +#define FN_(f) StgFunPtr f(void) +#define EF_(f) extern StgFunPtr f(void) /* ----------------------------------------------------------------------------- Tail calls @@ -236,25 +236,25 @@ typedef StgFunPtr F_; #if IN_STG_CODE /* * This is included later for RTS sources, after definitions of - * StgInfoTable, StgClosure and so on. + * StgInfoTable, StgClosure and so on. */ #include "stg/MiscClosures.h" #endif -#include "stg/SMP.h" // write_barrier() inline is required +#include "stg/SMP.h" // write_barrier() inline is required /* ----------------------------------------------------------------------------- Moving Floats and Doubles ASSIGN_FLT is for assigning a float to memory (usually the stack/heap). The memory address is guaranteed to be - StgWord aligned (currently == sizeof(void *)). + StgWord aligned (currently == sizeof(void *)). PK_FLT is for pulling a float out of memory. The memory is guaranteed to be StgWord aligned. -------------------------------------------------------------------------- */ -INLINE_HEADER void ASSIGN_FLT (W_ [], StgFloat); +INLINE_HEADER void ASSIGN_FLT (W_ [], StgFloat); INLINE_HEADER StgFloat PK_FLT (W_ []); #if ALIGNMENT_FLOAT <= ALIGNMENT_LONG @@ -282,13 +282,13 @@ INLINE_HEADER StgFloat PK_FLT(W_ p_src[]) #if ALIGNMENT_DOUBLE <= ALIGNMENT_LONG -INLINE_HEADER void ASSIGN_DBL (W_ [], StgDouble); +INLINE_HEADER void ASSIGN_DBL (W_ [], StgDouble); INLINE_HEADER StgDouble PK_DBL (W_ []); INLINE_HEADER void ASSIGN_DBL(W_ p_dest[], StgDouble src) { *(StgDouble *)p_dest = src; } INLINE_HEADER StgDouble PK_DBL (W_ p_src[]) { return *(StgDouble *)p_src; } -#else /* ALIGNMENT_DOUBLE > ALIGNMENT_LONG */ +#else /* ALIGNMENT_DOUBLE > ALIGNMENT_LONG */ /* Sparc uses two floating point registers to hold a double. We can * write ASSIGN_DBL and PK_DBL by directly accessing the registers @@ -300,19 +300,19 @@ INLINE_HEADER StgDouble PK_DBL (W_ p_src[]) { return *(StgDou #define ASSIGN_DBL(dst0,src) \ { StgPtr dst = (StgPtr)(dst0); \ __asm__("st %2,%0\n\tst %R2,%1" : "=m" (((P_)(dst))[0]), \ - "=m" (((P_)(dst))[1]) : "f" (src)); \ + "=m" (((P_)(dst))[1]) : "f" (src)); \ } #define PK_DBL(src0) \ ( { StgPtr src = (StgPtr)(src0); \ register double d; \ __asm__("ld %1,%0\n\tld %2,%R0" : "=f" (d) : \ - "m" (((P_)(src))[0]), "m" (((P_)(src))[1])); d; \ + "m" (((P_)(src))[0]), "m" (((P_)(src))[1])); d; \ } ) #else /* ! sparc_HOST_ARCH */ -INLINE_HEADER void ASSIGN_DBL (W_ [], StgDouble); +INLINE_HEADER void ASSIGN_DBL (W_ [], StgDouble); INLINE_HEADER StgDouble PK_DBL (W_ []); typedef struct @@ -337,8 +337,8 @@ INLINE_HEADER void ASSIGN_DBL(W_ p_dest[], StgDouble src) the same code as the previous one, and is not ANSI #define ASSIGN_DBL( p_dest, src ) \ - *p_dest = ((double_thing) src).du.dhi; \ - *(p_dest+1) = ((double_thing) src).du.dlo \ + *p_dest = ((double_thing) src).du.dhi; \ + *(p_dest+1) = ((double_thing) src).du.dlo \ */ INLINE_HEADER StgDouble PK_DBL(W_ p_src[]) @@ -416,7 +416,7 @@ INLINE_HEADER StgInt64 PK_Int64(W_ p_src[]) INLINE_HEADER void ASSIGN_Word64(W_ p_dest[], StgWord64 src) { - p_dest[0] = src; + p_dest[0] = src; } INLINE_HEADER StgWord64 PK_Word64(W_ p_src[]) @@ -457,12 +457,12 @@ INLINE_HEADER StgInt64 PK_Int64(W_ p_src[]) INLINE_HEADER void wcStore (StgPtr p, StgWord w) { -#ifdef x86_64_HOST_ARCH +#ifdef x86_64_HOST_ARCH __asm__( - "movnti\t%1, %0" - : "=m" (*p) - : "r" (w) - ); + "movnti\t%1, %0" + : "=m" (*p) + : "r" (w) + ); #else *p = w; #endif @@ -474,7 +474,7 @@ wcStore (StgPtr p, StgWord w) /* Multiply with overflow checking. * - * This is tricky - the usual sign rules for add/subtract don't apply. + * This is tricky - the usual sign rules for add/subtract don't apply. * * On 32-bit machines we use gcc's 'long long' types, finding * overflow with some careful bit-twiddling. @@ -504,17 +504,17 @@ typedef union { StgInt32 i[2]; } long_long_u ; -#define mulIntMayOflo(a,b) \ +#define mulIntMayOflo(a,b) \ ({ \ - StgInt32 r, c; \ - long_long_u z; \ - z.l = (StgInt64)a * (StgInt64)b; \ - r = z.i[RTS_REM_IDX__]; \ - c = z.i[RTS_CARRY_IDX__]; \ - if (c == 0 || c == -1) { \ - c = ((StgWord)((a^b) ^ r)) \ - >> (BITS_IN (I_) - 1); \ - } \ + StgInt32 r, c; \ + long_long_u z; \ + z.l = (StgInt64)a * (StgInt64)b; \ + r = z.i[RTS_REM_IDX__]; \ + c = z.i[RTS_CARRY_IDX__]; \ + if (c == 0 || c == -1) { \ + c = ((StgWord)((a^b) ^ r)) \ + >> (BITS_IN (I_) - 1); \ + } \ c; \ }) @@ -531,15 +531,15 @@ typedef union { #define HALF_POS_INT (((I_)1) << ((BITS_IN (I_) - 1) / 2)) #define HALF_NEG_INT (-HALF_POS_INT) -#define mulIntMayOflo(a,b) \ +#define mulIntMayOflo(a,b) \ ({ \ - I_ c; \ + I_ c; \ if ((I_)a <= HALF_NEG_INT || a >= HALF_POS_INT \ || (I_)b <= HALF_NEG_INT || b >= HALF_POS_INT) {\ - c = 1; \ - } else { \ - c = 0; \ - } \ + c = 1; \ + } else { \ + c = 0; \ + } \ c; \ }) #endif |