diff --git a/numba/cpython/mathimpl.py b/numba/cpython/mathimpl.py index 9189f5f8aad..e79d7cf3956 100644 --- a/numba/cpython/mathimpl.py +++ b/numba/cpython/mathimpl.py @@ -171,45 +171,6 @@ def float_impl(context, builder, sig, args): return float_impl -def unary_sqrt_extern(fn, int_restype=False): - """ - Register implementations of Python function *fn* using the - external function named *f32extern* and *f64extern* (for float32 - and float64 inputs, respectively). - If *int_restype* is true, then the function's return value should be - integral, otherwise floating-point. - """ - f_restype = types.int64 if int_restype else None - - def float_impl(context, builder, sig, args): - """ - Implement *fn* for a types.Float input. - """ - [val] = args - mod = builder.module - input_type = sig.args[0] - lty = context.get_value_type(input_type) - sqrt32extern = getattr(context, 'sqrt32extern', "sqrtf") - sqrt64extern = getattr(context, 'sqrt64extern', "sqrt") - - func_name = { - types.float32: sqrt32extern, - types.float64: sqrt64extern, - }[input_type] - fnty = Type.function(lty, [lty]) - fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name) - res = builder.call(fn, (val,)) - res = context.cast(builder, res, input_type, sig.return_type) - return impl_ret_untracked(context, builder, sig.return_type, res) - - lower(fn, types.Float)(float_impl) - - # Implement wrapper for integer inputs - unary_math_int_impl(fn, float_impl) - - return float_impl - - unary_math_intr(math.fabs, lc.INTR_FABS) #unary_math_intr(math.sqrt, lc.INTR_SQRT) @@ -244,8 +205,7 @@ def float_impl(context, builder, sig, args): floor_impl = unary_math_extern(math.floor, "floorf", "floor", True) gamma_impl = unary_math_extern(math.gamma, "numba_gammaf", "numba_gamma") # work-around -sqrt_impl = unary_sqrt_extern(math.sqrt) -#sqrt_impl = unary_math_extern(math.sqrt, "sqrtf", "sqrt") +sqrt_impl = unary_math_extern(math.sqrt, "sqrtf", "sqrt") trunc_impl = unary_math_extern(math.trunc, "truncf", "trunc", True) lgamma_impl = unary_math_extern(math.lgamma, "lgammaf", "lgamma")