diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2015-03-28 15:48:25 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2015-03-28 15:48:25 +0100 |
commit | 20a10e73e5108e47ef374ccdcb7b972778086b92 (patch) | |
tree | 5c0606b285cbe11abb3113433fc03c20439138f0 /Cython/Utility/ModuleSetupCode.c | |
parent | b79a55d8fb444f8af821a4f2115dc09c71e4deef (diff) | |
download | cython-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.c | 4 |
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__) |