Revise x86_64 inline asm: Fix for LDC v1.29+, and enable on Windows and with GDC too#458
Revise x86_64 inline asm: Fix for LDC v1.29+, and enable on Windows and with GDC too#458RazvanN7 merged 2 commits intodlang-community:masterfrom
Conversation
…nd with GDC too Resolves dlang-community#457.
|
The GDC/GCC-style inline asm syntax is also inline-able with LDC, unlike naked DMD-style one. IIRC, LDC v1.22 added support for that syntax. |
|
@dd86k can you review this? |
Codecov Report
@@ Coverage Diff @@
## master #458 +/- ##
==========================================
+ Coverage 82.85% 82.86% +0.01%
==========================================
Files 11 11
Lines 8315 8321 +6
==========================================
+ Hits 6889 6895 +6
Misses 1426 1426
Continue to review full report at Codecov.
|
|
FWIW, here's the almost-identical GCC-style one for C++, supported by gcc and clang: godbolt |
@WebFreak001: I don't mind testing this, but what would I be able to test, or should I expect from this PR, precisely? |
|
The unittest runner ( |
|
To resume: Run tests with this PR on a Linux system with SSE4.2 using LDC 1.29.0 and GDC? Optionally on Windows? |
|
Yep, that should cover everything I think. - Note that LDC versions < 1.22 couldn't be used anymore to compile libdparse; that would require some more static if + enum business to use the DMD-style syntax for those. |
|
Cloned Commit: Tests using
Didn't test GDC on Windows because last time I tried using GDC on Windows last year, it couldn't compile D code at all. Hope this answers it for you! I'll be here if you need anything else. Processor infoLinux (host): Windows 10 (guest, should be same for 11): |
| * given $(B chars). | ||
| */ | ||
| void skip(bool matching, chars...)(const ubyte*, ulong*, ulong*) pure nothrow | ||
| void skip(bool matching, chars...)(const ubyte* bytes, ulong* pindex, ulong* pcolumn) pure nothrow |
There was a problem hiding this comment.
Can these attributes not be inferred?
There was a problem hiding this comment.
Most likely, but I didn't want to mix in other refactorings (the pointers would have been gone first and replaced by refs obviously...).
There was a problem hiding this comment.
I think avoiding refactoring solely on principle is a good way to kill progress.
There was a problem hiding this comment.
I don't avoid it by principle, I decide from time to time. The point here is clearly asm, not tampering with a codebase I've seen first yesterday and don't plan to contribute to regularly.
There was a problem hiding this comment.
no one contributes to this codebase regularly ;)
|
[pushed a little extension to make LDC < v1.22 work again] |
|
In some quick tests I did, this whitespace skipping approach doesn't seem to be particularly quick, I'm not convinced there's all that much point in keeping this at all. |
|
Merging this to unblock the D-Scanner pipeline |
I agree. While I like reading some assembly as much as the next person, I don't think we should use inline asm anymore. I believe that the inline asm should be removed in a future PR. This will prevent future issues like this one, and will enable the compiler to perform optimizations as the compiler and architectures evolve without requiring code patches. |
|
This PR: dlang-community/D-Scanner#866 confirms that this fix is correct, however, we still need a new tag so that the dub test also passes. cc @WebFreak001 |
|
ok will tag release |
|
@WebFreak001 Is there anything else that needs to be done for the dub registry to pick up the new tag or does it simply take a while before it gets updated? I see that the dub registry [1] still thinks that 0.19.1 is the latest tag. |
|
ping @Hackerpilot otherwise wait for 0~8 hours |
|
ok, no problem, I can wait. I just wanted to make sure that we are on track. Thanks for your assistance! |
Resolves #457.