Commit b6b796a8 authored by da-woods's avatar da-woods

Now uses specialised functions for complex abs

Also doesn't require gil for int and long abs.

Notes:
* I don't think the correct utility code is loaded for complex abs
  (but it should be loaded by the complex data types hopefully)
* Would probably be worth making double and float abs not require gil
parent 7dfa5d63
......@@ -100,21 +100,39 @@ builtin_function_table = [
PyrexTypes.c_uint_type, [
PyrexTypes.CFuncTypeArg("arg", PyrexTypes.c_int_type, None)
],
is_strict_signature = True)),
is_strict_signature = True, nogil=True)),
BuiltinFunction('abs', None, None, "__Pyx_abs_long",
utility_code = UtilityCode.load("abs_long", "Builtins.c"),
func_type = PyrexTypes.CFuncType(
PyrexTypes.c_ulong_type, [
PyrexTypes.CFuncTypeArg("arg", PyrexTypes.c_long_type, None)
],
is_strict_signature = True)),
is_strict_signature = True, nogil=True)),
BuiltinFunction('abs', None, None, "__Pyx_abs_longlong",
utility_code = UtilityCode.load("abs_longlong", "Builtins.c"),
func_type = PyrexTypes.CFuncType(
PyrexTypes.c_ulonglong_type, [
PyrexTypes.CFuncTypeArg("arg", PyrexTypes.c_longlong_type, None)
],
is_strict_signature = True)),
is_strict_signature = True, nogil=True)),
BuiltinFunction('abs', None, None, "__Pyx_c_abs{0}".format(PyrexTypes.c_double_complex_type.funcsuffix),
func_type = PyrexTypes.CFuncType(
PyrexTypes.c_double_type, [
PyrexTypes.CFuncTypeArg("arg", PyrexTypes.c_double_complex_type, None)
],
is_strict_signature = True, nogil=True)),
BuiltinFunction('abs', None, None, "__Pyx_c_abs{0}".format(PyrexTypes.c_float_complex_type.funcsuffix),
func_type = PyrexTypes.CFuncType(
PyrexTypes.c_float_type, [
PyrexTypes.CFuncTypeArg("arg", PyrexTypes.c_float_complex_type, None)
],
is_strict_signature = True, nogil=True)),
BuiltinFunction('abs', None, None, "__Pyx_c_abs{0}".format(PyrexTypes.c_longdouble_complex_type.funcsuffix),
func_type = PyrexTypes.CFuncType(
PyrexTypes.c_longdouble_type, [
PyrexTypes.CFuncTypeArg("arg", PyrexTypes.c_longdouble_complex_type, None)
],
is_strict_signature = True, nogil=True)),
BuiltinFunction('abs', "O", "O", "PyNumber_Absolute"),
#('all', "", "", ""),
#('any', "", "", ""),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment