예제 #1
0
def atan2_f32_impl(context, builder, sig, args):
    assert len(args) == 2
    mod = builder.module
    fnty = Type.function(Type.float(), [Type.float(), Type.float()])
    fn = cgutils.insert_pure_function(builder.module, fnty, name="atan2f")
    res = builder.call(fn, args)
    return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #2
0
파일: mathimpl.py 프로젝트: MPOWER4RU/numba
def atan2_f32_impl(context, builder, sig, args):
    assert len(args) == 2
    mod = builder.module
    fnty = Type.function(Type.float(), [Type.float(), Type.float()])
    fn = cgutils.insert_pure_function(builder.module, fnty, name="atan2f")
    res = builder.call(fn, args)
    return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #3
0
def ldexp_impl(context, builder, sig, args):
    val, exp = args
    fltty, intty = map(context.get_data_type, sig.args)
    fnty = Type.function(fltty, (fltty, intty))
    fname = {"float": "numba_ldexpf", "double": "numba_ldexp"}[str(fltty)]
    fn = cgutils.insert_pure_function(builder.module, fnty, name=fname)
    res = builder.call(fn, (val, exp))
    return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #4
0
def atan2_f64_impl(context, builder, sig, args):
    assert len(args) == 2
    mod = builder.module
    fnty = Type.function(Type.double(), [Type.double(), Type.double()])
    # Workaround atan2() issues under Windows
    fname = "atan2_fixed" if sys.platform == "win32" else "atan2"
    fn = cgutils.insert_pure_function(builder.module, fnty, name=fname)
    return builder.call(fn, args)
예제 #5
0
def atan2_f64_impl(context, builder, sig, args):
    assert len(args) == 2
    mod = builder.module
    fnty = Type.function(Type.double(), [Type.double(), Type.double()])
    # Workaround atan2() issues under Windows
    fname = "atan2_fixed" if sys.platform == "win32" else "atan2"
    fn = cgutils.insert_pure_function(builder.module, fnty, name=fname)
    return builder.call(fn, args)
예제 #6
0
파일: mathimpl.py 프로젝트: MPOWER4RU/numba
 def implementer(context, builder, sig, args):
     [val] = args
     mod = builder.module
     lty = context.get_value_type(input_type)
     fnty = Type.function(lty, [lty])
     fn = cgutils.insert_pure_function(builder.module, fnty, name=extern_func)
     res = builder.call(fn, (val,))
     if restype is not None:
         res = context.cast(builder, res, input_type, restype)
     return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #7
0
def ldexp_impl(context, builder, sig, args):
    val, exp = args
    fltty, intty = map(context.get_data_type, sig.args)
    fnty = Type.function(fltty, (fltty, intty))
    fname = {
        "float": "numba_ldexpf",
        "double": "numba_ldexp",
    }[str(fltty)]
    fn = cgutils.insert_pure_function(builder.module, fnty, name=fname)
    return builder.call(fn, (val, exp))
예제 #8
0
파일: mathimpl.py 프로젝트: menghaozhu/hat
 def implementer(context, builder, sig, args):
     [val] = args
     mod = builder.module
     lty = context.get_value_type(input_type)
     fnty = Type.function(lty, [lty])
     fn = cgutils.insert_pure_function(builder.module, fnty, name=extern_func)
     res = builder.call(fn, (val,))
     if restype is not None:
         res = context.cast(builder, res, input_type, restype)
     return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #9
0
def atan2_float_impl(context, builder, sig, args):
    assert len(args) == 2
    mod = builder.module
    ty = sig.args[0]
    lty = context.get_value_type(ty)
    func_name = {
        types.float32: "atan2f",
        types.float64: "atan2"
        }[ty]
    fnty = Type.function(lty, (lty, lty))
    fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name)
    res = builder.call(fn, args)
    return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #10
0
def atan2_float_impl(context, builder, sig, args):
    assert len(args) == 2
    mod = builder.module
    ty = sig.args[0]
    lty = context.get_value_type(ty)
    func_name = {
        types.float32: "atan2f",
        # Workaround atan2() issues under Windows
        types.float64: "atan2_fixed" if sys.platform == "win32" else "atan2"
        }[ty]
    fnty = Type.function(lty, (lty, lty))
    fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name)
    res = builder.call(fn, args)
    return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #11
0
파일: mathimpl.py 프로젝트: esc/numba
def atan2_float_impl(context, builder, sig, args):
    assert len(args) == 2
    mod = builder.module
    ty = sig.args[0]
    lty = context.get_value_type(ty)
    func_name = {
        types.float32: "atan2f",
        # Workaround atan2() issues under Windows
        types.float64: "atan2_fixed" if sys.platform == "win32" else "atan2"
        }[ty]
    fnty = Type.function(lty, (lty, lty))
    fn = cgutils.insert_pure_function(builder.module, fnty, name=func_name)
    res = builder.call(fn, args)
    return impl_ret_untracked(context, builder, sig.return_type, res)
예제 #12
0
 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)
     func_name = {
         types.float32: f32extern,
         types.float64: f64extern,
         }[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)
예제 #13
0
파일: mathimpl.py 프로젝트: esc/numba
 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)
     func_name = {
         types.float32: f32extern,
         types.float64: f64extern,
         }[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)