Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

double NaN to float conversion problem #7

Closed
pcpa opened this issue Jul 30, 2013 · 5 comments
Closed

double NaN to float conversion problem #7

pcpa opened this issue Jul 30, 2013 · 5 comments

Comments

@pcpa
Copy link

pcpa commented Jul 30, 2013

I have been told to report here an issue I suspected could be a Hercules emulator problem, and was told it works (does not abort) on actual hardware. This small test program fails on hercules-3.08.2-1.fc20.x86_64 using a fedora 16 image:

extern void abort(void);

void
test(float f)
{
    float fnan = 0.0f/0.0f;
    if (*(int*)&f != *(int*)&fnan)
        abort();
}

int
main(int argc, char *argv[])
{
        double dnan = 0.0/0.0;
        test(dnan);
        return 0;
}
@sharkcz
Copy link
Contributor

sharkcz commented Jul 30, 2013

from Paulo's email sent to me:
...
But reading objdump output, it is supposed to be
done by the hardware, in both cases, the instruction:

ledbr %f0,%f0

@rbowler
Copy link
Owner

rbowler commented Aug 1, 2013

All production versions of Hercules up to 3.09 contain only a partial implementation of IEEE floating point (BFP in mainframe terminology). This partial implementation is known to produce incorrect results for certain operations. The development version of Hercules has addressed this problem by replacing the partial BFP implementation by calls to the softfloat package, which while slower does produce correct results. The modification has not yet been retrofitted into the production versions of Hercules but it is in the plan.

@rbowler
Copy link
Owner

rbowler commented Oct 24, 2013

This bug is now scheduled for correction in release 3.10

@rbowler
Copy link
Owner

rbowler commented Dec 30, 2013

Bug has been corrected by spinhawk commit ee5f56a which will be included in the next release (3.10)

@rbowler
Copy link
Owner

rbowler commented Feb 10, 2014

Fixed by release 3.10

@rbowler rbowler closed this as completed Feb 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants