aboutsummaryrefslogtreecommitdiff
path: root/pffft.c
diff options
context:
space:
mode:
authormeng ke <m1engk1e@gmail.com>2018-11-23 03:58:44 +0800
committerGitHub <noreply@github.com>2018-11-23 03:58:44 +0800
commit57bd4681a8d7a4e4e4f661cb23e7f21100efc0c9 (patch)
tree0a2b11c60ebd38cb9a6473adc294367790d1e8e4 /pffft.c
parenta82d03473368f08cdcde6f7bf6efab7bf9fd9aa5 (diff)
downloadpffft-57bd4681a8d7a4e4e4f661cb23e7f21100efc0c9.tar.gz
avoid some warnings.
pointers should be 64bit on x64, so we can not convert it to 'long', but to 'uintptr_t'. as all those are just asserts to check if the pointers are aligned, convert to long should be ok but I think it should be fixed to avoid MSVC warnings.
Diffstat (limited to 'pffft.c')
-rw-r--r--pffft.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pffft.c b/pffft.c
index 0428b60..ef7e8be 100644
--- a/pffft.c
+++ b/pffft.c
@@ -131,7 +131,7 @@ inline v4sf ld_ps1(const float *p) { v4sf v=vec_lde(0,p); return vec_splat(vec_p
x3 = vec_mergel(y1, y3); \
}
# define VSWAPHL(a,b) vec_perm(a,b, (vector unsigned char)(16,17,18,19,20,21,22,23,8,9,10,11,12,13,14,15))
-# define VALIGNED(ptr) ((((long)(ptr)) & 0xF) == 0)
+# define VALIGNED(ptr) ((((uintptr_t)(ptr)) & 0xF) == 0)
/*
SSE1 support macros
@@ -151,7 +151,7 @@ typedef __m128 v4sf;
# define UNINTERLEAVE2(in1, in2, out1, out2) { v4sf tmp__ = _mm_shuffle_ps(in1, in2, _MM_SHUFFLE(2,0,2,0)); out2 = _mm_shuffle_ps(in1, in2, _MM_SHUFFLE(3,1,3,1)); out1 = tmp__; }
# define VTRANSPOSE4(x0,x1,x2,x3) _MM_TRANSPOSE4_PS(x0,x1,x2,x3)
# define VSWAPHL(a,b) _mm_shuffle_ps(b, a, _MM_SHUFFLE(3,2,1,0))
-# define VALIGNED(ptr) ((((long)(ptr)) & 0xF) == 0)
+# define VALIGNED(ptr) ((((uintptr_t)(ptr)) & 0xF) == 0)
/*
ARM NEON support macros
@@ -178,7 +178,7 @@ typedef float32x4_t v4sf;
// marginally faster version
//# define VTRANSPOSE4(x0,x1,x2,x3) { asm("vtrn.32 %q0, %q1;\n vtrn.32 %q2,%q3\n vswp %f0,%e2\n vswp %f1,%e3" : "+w"(x0), "+w"(x1), "+w"(x2), "+w"(x3)::); }
# define VSWAPHL(a,b) vcombine_f32(vget_low_f32(b), vget_high_f32(a))
-# define VALIGNED(ptr) ((((long)(ptr)) & 0x3) == 0)
+# define VALIGNED(ptr) ((((uintptr_t)(ptr)) & 0x3) == 0)
#else
# if !defined(PFFFT_SIMD_DISABLE)
# warning "building with simd disabled !\n";
@@ -196,7 +196,7 @@ typedef float v4sf;
# define VMADD(a,b,c) ((a)*(b)+(c))
# define VSUB(a,b) ((a)-(b))
# define LD_PS1(p) (p)
-# define VALIGNED(ptr) ((((long)(ptr)) & 0x3) == 0)
+# define VALIGNED(ptr) ((((uintptr_t)(ptr)) & 0x3) == 0)
#endif
// shortcuts for complex multiplcations