Trouble when using `tvm.call_pure_extern` to call `ldexp`


#1

https://en.cppreference.com/w/cpp/numeric/math/ldexp

>>> import tvm
>>> A = tvm.placeholder([tvm.var() for _ in range(2)], name='A', dtype="float32")
>>> B = tvm.placeholder([tvm.var() for _ in range(2)], name='B', dtype="int32")
>>> C = tvm.compute([tvm.var() for _ in range(2)],
...                 lambda *i: tvm.call_pure_extern("float32", "ldexp", A[i], B[i]), name='C')
>>> s = tvm.create_schedule(C.op)
>>> f = tvm.build(s, [A, B, C], "llvm", name="my_ldexp")
>>> import numpy as np
>>> a = tvm.nd.array(np.ones((1, 2), dtype="float32"))
>>> b = tvm.nd.array(np.ones((1, 2), dtype="int32") * 2)
>>> c = tvm.nd.array(np.zeros((1, 2), dtype="float32"))
>>> f(a, b, c)
>>> c
<tvm.NDArray shape=(1, 2), cpu(0)>
array([[-4.2535296e+37, -4.2535296e+37]], dtype=float32)
>>>

I want to use ldexp by using tvm.call_pure_extern, however I have some difficulties.
In the above case, the result is wrong, if I change ldexp to ldexpf, I get correct result.
Besides, I cannot use a’s dtype equal to int types, if so, I always get 0 on Mac and wrong result on Linux for both ldexp and ldexpf.
How can I use int dtypes?