-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Add parser and some semantic support for gdc extended asm statements #7562
Conversation
Thanks for your pull request, @ibuclaw! Bugzilla referencesYour 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 locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#7562" |
I wonder if there exists a common subset between the GDC and LDC (non-IR) inline asm (https://wiki.dlang.org/LDC_inline_assembly_expressions), which we can agree on and add to the language, though I guess the main difficulty would be integration with dmd's backend. |
Changing syntax would break existing code though.
It's just a glorified printf, with some more bells and whistles. |
I'm not sure which syntax LDC and GDC are using but Clang is compatible with GCC [1]. |
Forgive my ignorance, but I don't understand the motivation for this PR other than to elicit discussion. It appears that this PR has only a parser and partial semantic support, but ultimately does nothing. Furthermore it's only ever used in GCC. Eventually, do we want to merge code like this so there is one code base shared between the 3 main compilers? Personally, I would love to have one rich ASM syntax to use for all 3 compilers, but that doesn't seem to be the objective of this PR
I suspect that is an honest comment; not facetious. As I've been reviving PRs, my goal has been to give those PRs a quick path to acceptance or a quick path to closure. What's the goal of this PR? |
@ibuclaw why did you revive this? |
I split the mega gdc diff pr into separate patches. From a maintenance standpoint there should be no difference between gdc and dmd frontends... But there is. This is a problem, and dmd needs to be fixed or improved to allow support for these discrepancies to be implemented without touching the frontend. |
If the plan is to have a single front-end code-base with compiler differences |
You'll never accept this, but the dmd inline asm code is all Boost licensed now, so you can use it!! :-) |
I'm on board with it, provided it is properly encapsulated. When support for it is distributed across numerous files, it is not encapsulated and will be an ongoing problem. There should be 4 files:
There should be minimal to no need for As an example of what I mean, take a look at scanelf.d, scanomf.d, scanmach.d, and scanmscoff.d. Another example is libelf.d, libomf.d, libmach.d, libmscoff.d. Look, ma, no versions! I am pretty happy with how these have worked out, there has been little trouble with them, and the extra work in coming up with a generic interface turned out to be far less work in the end. As an example of failure, look at cgobj.c, machobj.c, elfobj.c, mscoffobj.c. Well, sort of failure. I've been slowly moving to a generic interface, and it's getting better. If we can do it with these files, we can do it with the inline assembler. |
I'm not sure if it's possible, but I would prefer a single check in code over special casing the makefile. |
Ahem, packages ( |
Well preferably, I, as a user of dmd frontend, should be able to omit including dmd and ldc iasm implementations in my local mirror without any compiler or build problems. Runtime checks won't satisfy this requirement unless unsightly stubs are added. |
I absolutely agree, but Walter doesn't like packages. I tried: Though everyone else noticing these PRs was in favor of those changes... |
To be fair these files use a
Yes. The following already works
See #7782 and it would be cool if that continues to be the case ;-) |
Looks like this was accidentally closed? |
Nope, closing was deliberate. The PR in #8538 replaced this. |
If I'm right, the diff between gdc and dmd frontend is now no more than 12 lines! ... Ignoring the modules that I do not include in gdc (inline.d, builtins.d, target.d, etc...) |
You'll never accept this, as it's not used anywhere except in gdc.
But, is a revival nonetheless of #4472 which came from #2194 originally.