diff options
author | tege <tege@gmplib.org> | 2001-10-03 00:07:22 +0200 |
---|---|---|
committer | tege <tege@gmplib.org> | 2001-10-03 00:07:22 +0200 |
commit | b8466db62f7358cd060111ba44326c4359c3b0a4 (patch) | |
tree | 8fb40c9fc0b56145310e48a4a73b7410c2a29e09 /gmp-impl.h | |
parent | 0a1117a0e433f24c12af2dfa92c0dc83bf2a8449 (diff) | |
download | gmp-b8466db62f7358cd060111ba44326c4359c3b0a4.tar.gz |
Implement separate MPN_COPY_INCR and MPN_COPY_DECR macros for CRAY systems.
(CRAY _MPN_COPY): Delete.
Diffstat (limited to 'gmp-impl.h')
-rw-r--r-- | gmp-impl.h | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/gmp-impl.h b/gmp-impl.h index 20e18e624..23a1c5561 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -638,6 +638,16 @@ int mpn_divisible_p _PROTO ((mp_srcptr ap, mp_size_t asize, } while (0) #endif +#if defined (_CRAY) +#define MPN_COPY_INCR(dst, src, n) \ + do { \ + int i; /* Faster on some Crays with plain int */ \ + _Pragma ("_CRI ivdep"); \ + for (i = 0; i < (n); i++) \ + (dst)[i] = (src)[i]; \ + } while (0) +#endif + #define mpn_copyi __MPN(copyi) void mpn_copyi _PROTO ((mp_ptr, mp_srcptr, mp_size_t)); @@ -681,6 +691,16 @@ void mpn_copyi _PROTO ((mp_ptr, mp_srcptr, mp_size_t)); } while (0) #endif +#if defined (_CRAY) +#define MPN_COPY_DECR(dst, src, n) \ + do { \ + int i; /* Faster on some Crays with plain int */ \ + _Pragma ("_CRI ivdep"); \ + for (i = (n) - 1; i >= 0; i--) \ + (dst)[i] = (src)[i]; \ + } while (0) +#endif + #define mpn_copyd __MPN(copyd) void mpn_copyd _PROTO ((mp_ptr, mp_srcptr, mp_size_t)); @@ -706,23 +726,6 @@ void mpn_copyd _PROTO ((mp_ptr, mp_srcptr, mp_size_t)); #endif -/* Define MPN_COPY for vector computers. Since #pragma cannot be in a macro, - rely on function inlining. - Enhancement: Does this suit MPN_COPY_INCR too, and maybe MPN_COPY_DECR if - the loop direction is reversed? */ -#if defined (_CRAY) || defined (__uxp__) -static inline void -_MPN_COPY (d, s, n) mp_ptr d; mp_srcptr s; mp_size_t n; -{ - int i; /* Faster for Cray with plain int */ -#pragma _CRI ivdep /* Cray PVP systems */ -#pragma loop noalias d,s /* Fujitsu VPP systems */ - for (i = 0; i < n; i++) - d[i] = s[i]; -} -#define MPN_COPY _MPN_COPY -#endif - #ifndef MPN_COPY #define MPN_COPY(d,s,n) \ do { \ |