summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/umath/fast_loop_macros.h25
-rw-r--r--numpy/core/src/umath/loops.c.src12
2 files changed, 10 insertions, 27 deletions
diff --git a/numpy/core/src/umath/fast_loop_macros.h b/numpy/core/src/umath/fast_loop_macros.h
index bab126b45..7a1ed66bc 100644
--- a/numpy/core/src/umath/fast_loop_macros.h
+++ b/numpy/core/src/umath/fast_loop_macros.h
@@ -85,31 +85,6 @@
steps[1] == 0 && \
steps[2] == sizeof(tout))
-
-/*
- * loop with contiguous specialization
- * val should be the value to be stored in `tout *out`
- * combine with NPY_GCC_OPT_3 to allow autovectorization
- * should only be used where its worthwhile to avoid code bloat
- */
-#define BASE_OUTPUT_LOOP(tout, val) \
- OUTPUT_LOOP { \
- tout *out = (tout *)op1; \
- *out = val; \
- }
-
-#define OUTPUT_LOOP_FAST(tout, val) \
- do { \
- /* condition allows compiler to optimize the generic macro */ \
- if (IS_OUTPUT_CONT(tout)) { \
- BASE_OUTPUT_LOOP(tout, val) \
- } \
- else { \
- BASE_OUTPUT_LOOP(tout, val) \
- } \
- } \
- while (0)
-
/*
* loop with contiguous specialization
* op should be the code working on `tin in` and
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src
index b7e28537a..abfd883f7 100644
--- a/numpy/core/src/umath/loops.c.src
+++ b/numpy/core/src/umath/loops.c.src
@@ -652,7 +652,11 @@ BOOL__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UN
NPY_NO_EXPORT void
BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
- OUTPUT_LOOP_FAST(npy_bool, @val@);
+ /*
+ * The (void)in; suppresses an unused variable warning raised by gcc and allows
+ * us to re-use this macro even though we do not depend on in
+ */
+ UNARY_LOOP_FAST(npy_bool, npy_bool, (void)in; *out = @val@);
}
/**end repeat**/
@@ -896,7 +900,11 @@ NPY_NO_EXPORT void
NPY_NO_EXPORT void
@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
- OUTPUT_LOOP_FAST(npy_bool, @val@);
+ /*
+ * The (void)in; suppresses an unused variable warning raised by gcc and allows
+ * us to re-use this macro even though we do not depend on in
+ */
+ UNARY_LOOP_FAST(@type@, npy_bool, (void)in; *out = @val@);
}
/**end repeat1**/