Skip to content

Commit 8dde6f8

Browse files
authored
Merge pull request numpy#19431 from seberg/maint-delete-unused-see-absolut
MAINT: Delete old SSE2 `absolute` implementation
2 parents 1f95d79 + 7a317fc commit 8dde6f8

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

numpy/core/src/umath/simd.inc.src

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ run_unary_@isa@_@func@_@TYPE@(char **args, npy_intp const *dimensions, npy_intp
205205
*/
206206

207207
/**begin repeat1
208-
* #func = absolute, negative, minimum, maximum#
209-
* #check = IS_BLOCKABLE_UNARY*2, IS_BLOCKABLE_REDUCE*2 #
210-
* #name = unary*2, unary_reduce*2#
208+
* #func = negative, minimum, maximum#
209+
* #check = IS_BLOCKABLE_UNARY, IS_BLOCKABLE_REDUCE*2 #
210+
* #name = unary, unary_reduce*2#
211211
*/
212212

213213
#if @vector@ && defined NPY_HAVE_SSE2_INTRINSICS
@@ -644,26 +644,9 @@ sse2_binary_scalar2_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy
644644
}
645645
/**end repeat1**/
646646

647-
static NPY_INLINE
648-
@type@ scalar_abs_@type@(@type@ v)
649-
{
650-
/* add 0 to clear -0.0 */
651-
return (v > 0 ? v: -v) + 0;
652-
}
653647

654-
static NPY_INLINE
655-
@type@ scalar_neg_@type@(@type@ v)
656-
{
657-
return -v;
658-
}
659-
660-
/**begin repeat1
661-
* #kind = absolute, negative#
662-
* #VOP = andnot, xor#
663-
* #scalar = scalar_abs, scalar_neg#
664-
**/
665648
static void
666-
sse2_@kind@_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n)
649+
sse2_negative_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n)
667650
{
668651
/*
669652
* get 0x7FFFFFFF mask (everything but signbit set)
@@ -674,24 +657,24 @@ sse2_@kind@_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n)
674657

675658
/* align output to VECTOR_SIZE_BYTES bytes */
676659
LOOP_BLOCK_ALIGN_VAR(op, @type@, VECTOR_SIZE_BYTES) {
677-
op[i] = @scalar@_@type@(ip[i]);
660+
op[i] = -ip[i];
678661
}
679662
assert((npy_uintp)n < (VECTOR_SIZE_BYTES / sizeof(@type@)) ||
680663
npy_is_aligned(&op[i], VECTOR_SIZE_BYTES));
681664
if (npy_is_aligned(&ip[i], VECTOR_SIZE_BYTES)) {
682665
LOOP_BLOCKED(@type@, VECTOR_SIZE_BYTES) {
683666
@vtype@ a = @vpre@_load_@vsuf@(&ip[i]);
684-
@vpre@_store_@vsuf@(&op[i], @vpre@_@VOP@_@vsuf@(mask, a));
667+
@vpre@_store_@vsuf@(&op[i], @vpre@_xor_@vsuf@(mask, a));
685668
}
686669
}
687670
else {
688671
LOOP_BLOCKED(@type@, VECTOR_SIZE_BYTES) {
689672
@vtype@ a = @vpre@_loadu_@vsuf@(&ip[i]);
690-
@vpre@_store_@vsuf@(&op[i], @vpre@_@VOP@_@vsuf@(mask, a));
673+
@vpre@_store_@vsuf@(&op[i], @vpre@_xor_@vsuf@(mask, a));
691674
}
692675
}
693676
LOOP_BLOCKED_END {
694-
op[i] = @scalar@_@type@(ip[i]);
677+
op[i] = -ip[i];
695678
}
696679
}
697680
/**end repeat1**/

0 commit comments

Comments
 (0)