aboutsummaryrefslogtreecommitdiff
path: root/src/vectors-4-SSE.h
diff options
context:
space:
mode:
authoreschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a>2011-08-20 00:30:29 +0000
committereschnett <eschnett@105869f7-3296-0410-a4ea-f4349344b45a>2011-08-20 00:30:29 +0000
commitb075a3dfcf5aaa72c086d7896ab0c975f42d04c2 (patch)
treed6fd1425bf823a0cd9a8d69e06231ca95864c831 /src/vectors-4-SSE.h
parenteb2a20c1f75a6de636a4d2c3ff3c3ae5064f5b3f (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-4-SSE.h')
-rw-r--r--src/vectors-4-SSE.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vectors-4-SSE.h b/src/vectors-4-SSE.h
index 9547b03..2f55183 100644
--- a/src/vectors-4-SSE.h
+++ b/src/vectors-4-SSE.h
@@ -313,9 +313,9 @@ static const union {
# define k4ifpos(x,y,z) (_mm_blendv_ps(y,z,x))
#else
# ifdef __cplusplus
-# define Vectors_SGN(x) std::signbit(x)
+# define k4sgn(x) ({ using namespace std; signbit(x); })
# else
-# define Vectors_SGN(x) signbit(x)
+# define k4sgn(x) (signbit(x))
# endif
# define k4ifpos(x,y,z) \
({ \
@@ -325,9 +325,9 @@ static const union {
CCTK_REAL4_VEC const y=yy; \
CCTK_REAL4_VEC const zz=(z_); \
CCTK_REAL4_VEC const z=zz; \
- vec4_set(Vectors_SGN(vec4_elt0(x)) ? vec4_elt0(z) : vec4_elt0(y), \
- Vectors_SGN(vec4_elt1(x)) ? vec4_elt1(z) : vec4_elt1(y), \
- Vectors_SGN(vec4_elt2(x)) ? vec4_elt2(z) : vec4_elt2(y), \
- Vectors_SGN(vec4_elt3(x)) ? vec4_elt3(z) : vec4_elt3(y)); \
+ vec4_set(k4sgn(vec4_elt0(x)) ? vec4_elt0(z) : vec4_elt0(y), \
+ k4sgn(vec4_elt1(x)) ? vec4_elt1(z) : vec4_elt1(y), \
+ k4sgn(vec4_elt2(x)) ? vec4_elt2(z) : vec4_elt2(y), \
+ k4sgn(vec4_elt3(x)) ? vec4_elt3(z) : vec4_elt3(y)); \
})
#endif