diff options
author | eschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a> | 2011-08-20 00:30:29 +0000 |
---|---|---|
committer | eschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a> | 2011-08-20 00:30:29 +0000 |
commit | b075a3dfcf5aaa72c086d7896ab0c975f42d04c2 (patch) | |
tree | d6fd1425bf823a0cd9a8d69e06231ca95864c831 /src/vectors-8-SSE2.h | |
parent | eb2a20c1f75a6de636a4d2c3ff3c3ae5064f5b3f (diff) |
Make more C++ compilers understand the signbit function
Several C++ compilers cannot handle std::signbit; use a work-around
instead.
Correct a namespace problem when using the same identifier Vectors_SGN
for different precisions (real*4 and real*8).
Correct kifpos implementation incorrectly on several architectures.
git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/Vectors/trunk@29 105869f7-3296-0410-a4ea-f4349344b45a
Diffstat (limited to 'src/vectors-8-SSE2.h')
-rw-r--r-- | src/vectors-8-SSE2.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vectors-8-SSE2.h b/src/vectors-8-SSE2.h index b530d10..56c614d 100644 --- a/src/vectors-8-SSE2.h +++ b/src/vectors-8-SSE2.h @@ -235,9 +235,9 @@ static const union { }) #else # ifdef __cplusplus -# define Vectors_SGN(x) std::signbit(x) +# define k8sgn(x) ({ using namespace std; signbit(x); }) # else -# define Vectors_SGN(x) signbit(x) +# define k4sgn(x) (signbit(x)) # endif # define k8ifpos(x_,y_,z_) \ ({ \ @@ -247,7 +247,7 @@ static const union { CCTK_REAL8_VEC const y=yy; \ CCTK_REAL8_VEC const zz=(z_); \ CCTK_REAL8_VEC const z=zz; \ - vec8_set(Vectors_SGN(vec8_elt0(x)) ? vec8_elt0(z) : vec8_elt0(y), \ - Vectors_SGN(vec8_elt1(x)) ? vec8_elt1(z) : vec8_elt1(y)); \ + vec8_set(k8sgn(vec8_elt0(x)) ? vec8_elt0(z) : vec8_elt0(y), \ + k8sgn(vec8_elt1(x)) ? vec8_elt1(z) : vec8_elt1(y)); \ }) #endif |