This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [WebAssembly] Disassembler support

Hi Alan,

On Sun, Apr 9, 2017 at 10:35 AM, Alan Modra <> wrote:
> On Fri, Apr 07, 2017 at 10:56:57PM +0000, Pip Cet wrote:
>> Hi Alan,
>> you're right; it was my mistake to use DECIMAL_DIG in the first place.
>> I still believe the right fix is to avoid that constant entirely, and
>> use one specific to IEEE 754 doubles, which are what we want to print
>> anyway; but if you can think of a better fix, please let me know.
> I hadn't been following the thread, and have only just now seen
> Simon's email.  Sorry to gang up on you.  :)

No worries at all, at least from this side! I appreciate the suggestions.

> I think what I'd be inclined to do is print your WebAssembly floats
> and doubles in %a format.

Wouldn't that also be a C99 thing? I know I looked into using %a and
decided it wasn't a good idea, probably for that reason. (Possibly,
also, because I personally find it hard to read, but that's less of a

> You can probably do that without converting
> to host doubles.

Well, I certainly would have to convert 32-bit floats to doubles
before calling printf...

> If that idea doesn't fly, just use a constant
> specific to your target floats and doubles, hoping the host is
> reasonably compatible.

I think that's what my patch does, and I think it's the best thing to
do for now; should non-IEEE floats become significant again,
floatformat should probably provide its own printing functions.

Thanks for your comments,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]