On Wed, 27 Apr 2022, Richard Biener via Gcc-patches wrote:

> Is this the correct strathegy to deal with this problem?  Would
> it be valid to just set ->is_decimal in build_real based on

Just setting ->decimal isn't correct; that signifies that ->sig stores the 
number in decimal128 format (host-endian DPD), so it's only correct for a 
REAL_VALUE_TYPE that actually is encoded in decimal128 format, not one 
copied from dconst*.

I think build_real is a reasonable place to handle the dconst* special 
cases, but it would need to have an explicit mapping from the binary 
dconst* to corresponding constants using the decimal128 format, in the 
case where the REAL_VALUE_TYPE passed in is binary but the requested type 
is decimal.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to