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

fix Issue 21526 - x87 not rounding to precision on assignment on some… #12102

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

WalterBright
Copy link
Member

… platforms

The comment in the code explains it. Maybe @9il can provide the test values?

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
21526 normal x87 not rounding to precision on assignment on some platforms

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#12102"

Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WalterBright
Copy link
Member Author

Does this also fix https://issues.dlang.org/show_bug.cgi?id=21376?

No.

@WalterBright
Copy link
Member Author

Can someone with the Azure setup let me know what code is being generated for the f21526 function in mars1.d?

@MoonlightSentinel
Copy link
Contributor

Can someone with the Azure setup let me know what code is being generated for the f21526 function in mars1.d?

Disassembly of section .text:

00000000 <__D5mars16f21256FddZd>:
   0:	c8 08 00 00          	enter  $0x8,$0x0
   4:	dd 45 10             	fldl   0x10(%ebp)
   7:	dc 45 08             	faddl  0x8(%ebp)
   a:	dd 5d f8             	fstpl  -0x8(%ebp)
   d:	dd 45 f8             	fldl   -0x8(%ebp)
  10:	c9                   	leave  
  11:	c2 10 00             	ret    $0x10

mars1.txt

@WalterBright
Copy link
Member Author

Thank you, @MoonlightSentinel
And that's what the generated code should be (see the store and reload).

@WalterBright
Copy link
Member Author

With some more investigation, I was able to duplicate the problem. Unfortunately, I cannot get the x87 to always produce the same value as XMM. But this change still gets it to do a write/read, which improves things.

@RazvanN7 RazvanN7 merged commit afeda67 into dlang:master Jan 8, 2021
@WalterBright WalterBright deleted the fix21526 branch January 8, 2021 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants