Stream: general

Topic: cranelift fprem?


view this post on Zulip Eli Rosenthal (Jan 19 2021 at 20:14):

Hey everyone!

I recently wrote a cranelift backend for a project, and I wanted to confirm that cranelift had no floating point modulo instruction? I don't see it here, but I wanted to confirm that there wasn't another place to look.

an efficient awk-like language. Contribute to ezrosent/frawk development by creating an account on GitHub.

view this post on Zulip Dan Gohman (Jan 20 2021 at 00:14):

The way to do floating-point modulo is to call "fmod" in libm

view this post on Zulip Dan Gohman (Jan 20 2021 at 00:15):

Compilers that have an fmod or frem instruction in their IR just call that same library routine in their backends :-)

view this post on Zulip Eli Rosenthal (Jan 20 2021 at 01:03):

Thanks!

Indeed; that's what I've been doing. But I didn't know that detail about other folks doing exactly that. Thanks for the context :)


Last updated: Nov 22 2024 at 16:03 UTC