Skip to content

std.math.exponential: Disable use of fyl2x and fyl2xp1 intrinsics on dmd/macOS port#8705

Merged
ibuclaw merged 1 commit intodlang:stablefrom
ibuclaw:debug/darwin22
Mar 3, 2023
Merged

std.math.exponential: Disable use of fyl2x and fyl2xp1 intrinsics on dmd/macOS port#8705
ibuclaw merged 1 commit intodlang:stablefrom
ibuclaw:debug/darwin22

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Mar 2, 2023

After some probing, looks like Apple M1 emulation of x86 instructions is bugged. Nothing we can do besides opening a ticket with Apple, so disabling use fyl2xp1 intrinsics on the target.

@dlang-bot
Copy link
Contributor

dlang-bot commented Mar 2, 2023

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

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 "stable + phobos#8705"

@ibuclaw ibuclaw force-pushed the debug/darwin22 branch 7 times, most recently from c95c2f9 to 1db469a Compare March 2, 2023 22:49
@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 2, 2023

log1p(0x1p-16382): expected: 0x1p-16382 | got: 0x0p+0
****** FAIL release64 std.math.exponential
core.exception.AssertError@std/math/exponential.d(3765): Assertion failure
----------------

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 2, 2023

The fyl2x{p1} instruction that dmd makes use of appears to have problems when emulated on macOS 13's version of Rosetta.

fabs(0x1p-16382) = 3.3621e-4932
fabs(0x1p-16382) <= 0.25 = true
yl2xp1(0x1p-16382) = 0x0p+0

Not a lot we can do other than disable it, and file a bug report against Apple, which they'll probably just ignore.

@ibuclaw ibuclaw changed the base branch from master to stable March 3, 2023 00:43
@ibuclaw ibuclaw changed the title Debug/darwin22 std.math.exponential: Disable use of fyl2x and fyl2xp1 intrinsics on dmd/macOS port Mar 3, 2023
@ibuclaw ibuclaw added math Severity:Regression Issues that are regressions/PRs that fix regressions labels Mar 3, 2023
@ibuclaw ibuclaw marked this pull request as ready for review March 3, 2023 00:47
@ibuclaw ibuclaw requested a review from dnadlinger as a code owner March 3, 2023 00:47
@WalterBright
Copy link
Member

If you file a bug report with Apple, please include a link to it in the code. And mebbe a link to this PR in the code, too, so there's more of an explanation.

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 3, 2023

If you file a bug report with Apple, please include a link to it in the code. And mebbe a link to this PR in the code, too, so there's more of an explanation.

I don't recall the site where dev issues are tracked, there was one raised for the ctor/dtor regression too.

@ibuclaw ibuclaw merged commit ab09084 into dlang:stable Mar 3, 2023
@ibuclaw ibuclaw deleted the debug/darwin22 branch March 3, 2023 02:08
@maxhaton
Copy link
Member

maxhaton commented Mar 4, 2023

There basically isn't a (public) bug tracker for apple things as far as I can tell.

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 4, 2023

There basically isn't a (public) bug tracker for apple things as far as I can tell.

Radar was the tracker. I did have a url to the site at one point, but can't find it anymore. I'm pretty sure I previously linked to it for the macOS crt dtor bug either here or bugzilla.

@maxhaton
Copy link
Member

maxhaton commented Mar 4, 2023

Are you thinking of https://openradar.appspot.com/page/1 ?

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 4, 2023

Are you thinking of https://openradar.appspot.com/page/1 ?

Aha, yes.

https://openradar.appspot.com/FB9733712

Issue still ignored after 2 years :-(

@maxhaton
Copy link
Member

maxhaton commented Mar 4, 2023

Note:

Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!

(Openradar is for telling people bug reports you have filed with apple, I think, apple don't maintain it although they'd be stupid to not look at it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

math Merge:auto-merge Severity:Regression Issues that are regressions/PRs that fix regressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants