Stream: cranelift

Topic: why `f{32,64}const` instead of `fconst`?


view this post on Zulip fitzgen (he/him) (Mar 06 2020 at 19:38):

  1. Unlike all the other constant-value-creating instructions are bit width polymorphic (eg bconst, iconst, vconst) creating float constants requires using either f32const or f64const

  2. However, fadd and fmul are bit width polymorphic, the same way as how iadd and imul are bit width polymorphic

So why don't we have fconst instead of f{32,64}const? Is this just an accident of history or something deeper?

view this post on Zulip Andrew Brown (Mar 06 2020 at 19:48):

I remember asking this same question

view this post on Zulip Andrew Brown (Mar 06 2020 at 19:48):

It's the formats: unary_ieee32 vs unary_ieee64

view this post on Zulip Andrew Brown (Mar 06 2020 at 19:51):

but it would be cool if there was a way to decouple the formats a bit more from the instructions


Last updated: Dec 23 2024 at 13:07 UTC