summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2014-06-09 14:23:18 -0600
committerCharles Harris <charlesr.harris@gmail.com>2014-06-09 14:23:18 -0600
commit89d9add9ff1f46ee0e0c7c4e106500d13c833bde (patch)
tree3b71a6e4fe9b896eac9993d06c3e0465776a28b5
parent10098daf387b9468a0aee19c3eb3e0cdd21f874c (diff)
parentfb35105da6b443da6e07c7bf404ee67cee67aa20 (diff)
downloadnumpy-89d9add9ff1f46ee0e0c7c4e106500d13c833bde.tar.gz
Merge pull request #4796 from juliantaylor/msvc-fix
BLD: workaround msvc being stupid
-rw-r--r--numpy/core/src/umath/simd.inc.src18
1 files changed, 11 insertions, 7 deletions
diff --git a/numpy/core/src/umath/simd.inc.src b/numpy/core/src/umath/simd.inc.src
index 92dc0c659..7944d5f47 100644
--- a/numpy/core/src/umath/simd.inc.src
+++ b/numpy/core/src/umath/simd.inc.src
@@ -480,14 +480,18 @@ sse2_binary_scalar2_@kind@_@TYPE@(@type@ * op, @type@ * ip1, @type@ * ip2, npy_i
/**end repeat1**/
-/* compress 4 vectors to 4/8 bytes in op with filled with 0 or 1 */
+/*
+ * compress 4 vectors to 4/8 bytes in op with filled with 0 or 1
+ * the last vector is passed as a pointer as MSVC 2010 is unable to ignore the
+ * calling convention leading to C2719 on 32 bit, see #4795
+ */
static NPY_INLINE void
-sse2_compress4_to_byte_@TYPE@(@vtype@ r1, @vtype@ r2, @vtype@ r3, @vtype@ r4,
+sse2_compress4_to_byte_@TYPE@(@vtype@ r1, @vtype@ r2, @vtype@ r3, @vtype@ * r4,
npy_bool * op)
{
const __m128i mask = @vpre@_set1_epi8(0x1);
__m128i ir1 = @vpre@_packs_epi32(@cast@(r1), @cast@(r2));
- __m128i ir2 = @vpre@_packs_epi32(@cast@(r3), @cast@(r4));
+ __m128i ir2 = @vpre@_packs_epi32(@cast@(r3), @cast@(*r4));
__m128i rr = @vpre@_packs_epi16(ir1, ir2);
#if @double@
rr = @vpre@_packs_epi16(rr, rr);
@@ -535,7 +539,7 @@ sse2_binary_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy_intp n)
@vtype@ r2 = @vpre@_@VOP@_@vsuf@(b, b);
@vtype@ r3 = @vpre@_@VOP@_@vsuf@(c, c);
@vtype@ r4 = @vpre@_@VOP@_@vsuf@(d, d);
- sse2_compress4_to_byte_@TYPE@(r1, r2, r3, r4, &op[i]);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
}
}
else {
@@ -552,7 +556,7 @@ sse2_binary_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy_intp n)
@vtype@ r2 = @vpre@_@VOP@_@vsuf@(b1, b2);
@vtype@ r3 = @vpre@_@VOP@_@vsuf@(c1, c2);
@vtype@ r4 = @vpre@_@VOP@_@vsuf@(d1, d2);
- sse2_compress4_to_byte_@TYPE@(r1, r2, r3, r4, &op[i]);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
}
}
LOOP_BLOCKED_END {
@@ -577,7 +581,7 @@ sse2_binary_scalar1_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy
@vtype@ r2 = @vpre@_@VOP@_@vsuf@(s, b);
@vtype@ r3 = @vpre@_@VOP@_@vsuf@(s, c);
@vtype@ r4 = @vpre@_@VOP@_@vsuf@(s, d);
- sse2_compress4_to_byte_@TYPE@(r1, r2, r3, r4, &op[i]);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
}
LOOP_BLOCKED_END {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[0], ip2[i]);
@@ -601,7 +605,7 @@ sse2_binary_scalar2_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy
@vtype@ r2 = @vpre@_@VOP@_@vsuf@(b, s);
@vtype@ r3 = @vpre@_@VOP@_@vsuf@(c, s);
@vtype@ r4 = @vpre@_@VOP@_@vsuf@(d, s);
- sse2_compress4_to_byte_@TYPE@(r1, r2, r3, r4, &op[i]);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
}
LOOP_BLOCKED_END {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[i], ip2[0]);