What is the proper way to get the bit pattern associated with a ConstantFP? The 32 bit pattern if MVT::f32 or pair of 32 bit patterns with MVT::f64 ? Tia. Reed
Matt Arsenault
2014-May-05 18:06 UTC
[LLVMdev] get unsigned integer pattern for ConstantFP
On 05/05/2014 10:12 AM, reed kotler wrote:> What is the proper way to get the bit pattern associated with a > ConstantFP? > > The 32 bit pattern if MVT::f32 or pair of 32 bit patterns with MVT::f64 ? >I recently did this, and I used ConstantFP::getValueAPF().bitcastToAPInt()
On 05/05/2014 11:06 AM, Matt Arsenault wrote:> On 05/05/2014 10:12 AM, reed kotler wrote: >> What is the proper way to get the bit pattern associated with a >> ConstantFP? >> >> The 32 bit pattern if MVT::f32 or pair of 32 bit patterns with >> MVT::f64 ? >> > I recently did this, and I used > ConstantFP::getValueAPF().bitcastToAPInt()thanks. I just found that too. I guess it's safe to do it this way then. Reed
On 05/05/2014 11:06 AM, Matt Arsenault wrote:> On 05/05/2014 10:12 AM, reed kotler wrote: >> What is the proper way to get the bit pattern associated with a >> ConstantFP? >> >> The 32 bit pattern if MVT::f32 or pair of 32 bit patterns with >> MVT::f64 ? >> > I recently did this, and I used > ConstantFP::getValueAPF().bitcastToAPInt()What about rounding? I guess it will give the proper rounded value for MVT:f32 or MVT:64?