-
-
Notifications
You must be signed in to change notification settings - Fork 421
Issue 19924 - Make core.bitop.bswap(ulong) work in betterC #2621
Conversation
|
Thanks for your pull request, @n8sh! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#2621" |
| auto sv = Split64(v); | ||
| version (CoreDdoc) {} | ||
| else version (LDC) { /+ LDC treats bswap(ulong) as an intrinsic so don't change the mangling. +/ } | ||
| else version (GNU) { /+ GDC treats bswap(ulong) as an intrinsic so don't change the mangling. +/ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to special-case these since LDC and GDC maintain their own versions of druntime anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. You could also just use pragma(inline, true) to make it work for betterC instead of dummy-templatizing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works with dmd -betterC -inline but not if -inline is omitted (I just tested).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a DMD bug then, https://dlang.org/spec/pragma.html#inline:
The default inline behavior is typically selectable with a compiler switch such as -inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's factually accurate. GDC maintains its own implementation of rt, everything else is ad verbatim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to special-case these since LDC and GDC maintain their own versions of druntime anyway?
Even if they maintain their own fork of druntime I think they prefer to have as few differences as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I'm aware, the regression introduced in #2426 has never been fixed either (GDC treats all of core.checkedint as intrinsics, so mangling was broken there too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
80935a9 to
b1291c3
Compare
No description provided.