Where can I find @llvm.floor and @llvm.ceil ops in llvmlite?

I couldn’t find them.

How will I do ceil and floor operations in llvmlite?

Any pointer would be appreciated.

Numba has a function call_fp_intrinsic() you can look to for inspiration:

def call_fp_intrinsic(builder, name, args):
    """
    Call a LLVM intrinsic floating-point operation.
    """
    mod = builder.module
    intr = mod.declare_intrinsic(name, [a.type for a in args])
    return builder.call(intr, args)

For example calling this with call_fp_intrinsic(builder, "llvm.ceil", args) should result in the operation you’re looking for. (In this example, builder is the IR builder for your module, and args should be the arguments as llvmlite values).

1 Like

Working now, thanks!

1 Like