Stream: cranelift

Topic: float power


view this post on Zulip Riccardo D'Ambrosio (Jun 08 2021 at 04:23):

Hello!

Stupid question, how do i make a powf intrinsic with cranelift_codegen? i cannot find it in InstrBuilder, i saw that rustc_codegen_cranelift does some easy_call stuff with powf but im not really sure how i should do it lol

view this post on Zulip bjorn3 (Jun 08 2021 at 08:46):

You have to use declare_function with powf as name. This gives a FuncId that you can pass to declare_function_in_function to get a FuncRef that you can call using the call instruction. powf is a regular function defined in libm.

view this post on Zulip bjorn3 (Jun 08 2021 at 08:46):

@Riccardo D'Ambrosio

view this post on Zulip Riccardo D'Ambrosio (Jun 08 2021 at 22:14):

I see, thanks! :smile:


Last updated: Oct 23 2024 at 20:03 UTC