summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2015-03-28 15:48:25 +0100
committerStefan Behnel <stefan_ml@behnel.de>2015-03-28 15:48:25 +0100
commit20a10e73e5108e47ef374ccdcb7b972778086b92 (patch)
tree5c0606b285cbe11abb3113433fc03c20439138f0 /Cython/Utility/ModuleSetupCode.c
parentb79a55d8fb444f8af821a4f2115dc09c71e4deef (diff)
downloadcython-20a10e73e5108e47ef374ccdcb7b972778086b92.tar.gz
tune PyLong optimisations at (gcc) assembly level so that they prefer the most common case of a single-digit
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 3b228819c..fb49a84e5 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -183,6 +183,10 @@
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
+#define __Pyx_sst_abs(value) \
+ (sizeof(int) >= sizeof(Py_ssize_t) ? abs(value) : \
+ (sizeof(long) >= sizeof(Py_ssize_t) ? labs(value) : llabs(value)))
+
/* inline attribute */
#ifndef CYTHON_INLINE
#if defined(__GNUC__)