Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

@ljmf00
Copy link
Member

@ljmf00 ljmf00 commented Mar 11, 2022

Signed-off-by: Luís Ferreira contact@lsferreira.net


Related to dlang/dmd#13287 .

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ljmf00!

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 "master + druntime#3779"

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 11, 2022

@RazvanN7 how can I fix this interdependency? There is probably a lot to fix tho, but one idea would be to build some manual runtime checks on the args registers to check correct calling convention and when the compiler PR is merged, remove them?

@ljmf00 ljmf00 changed the title Fix calling convention for functions with D linkage Fix x86_64 calling convention for functions with D linkage Mar 11, 2022
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
@RazvanN7
Copy link
Contributor

@ljmf00 This is problematic. It seems that we need to merge these both at once. But this gives me some chills since we cannot test this properly using our CI infrastructure. I think that the path of least resistance would be to merge this one and then make sure that the dmd pr passes all of the tests. My reasoning is that the dmd pr has a bigger area of changes and therefore should be tested properly before merging. However, this means that the pipeline will be broken for quite some time.

Offtopic: Fingers crossed that maybe we will get the monorepo project going cc @PetarKirov .

@RazvanN7
Copy link
Contributor

Hmm maybe we can temporarily disable the tests that use atomicCompareExchangeStrongNoResult and atomicFetchAdd ? Are there many?

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 11, 2022

@ljmf00 This is problematic. It seems that we need to merge these both at once. But this gives me some chills since we cannot test this properly using our CI infrastructure. I think that the path of least resistance would be to merge this one and then make sure that the dmd pr passes all of the tests. My reasoning is that the dmd pr has a bigger area of changes and therefore should be tested properly before merging. However, this means that the pipeline will be broken for quite some time.

Offtopic: Fingers crossed that maybe we will get the monorepo project going cc @PetarKirov .

I can try to test this as much as possible locally, although testsuite fails on master on my machine for some specific tests. I have to check them and try to fix it to avoid problems. Another problem we should care is that intrinsics are relying on this calling convention thing, some of which, directly mapped to opcodes, e.g. bts from core.bitops. The signature of bts function doesn't match with the intrinsic, making it binary incompatible. We could have a module called __intrinsics and remap args there to avoid this. I think it is a really bad decision mapping intrinsics directly to end user calls.

@dkorpel
Copy link
Contributor

dkorpel commented Mar 11, 2022

How about introducing a new version condition, say, version(D_reversedParametersAbi)? That also allows user code to transition and keep compatibility with multiple dmd versions.

@kinke
Copy link
Contributor

kinke commented Mar 11, 2022

how can I fix this interdependency?

Create same-named branches on the upstream repos. E.g., fix-call-conv branches on the DMD/druntime/Phobos repos. (Most) CI systems check out these branches then; Buildkite still needs dlang/ci#452.

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 11, 2022

how can I fix this interdependency?

Create same-named branches on the upstream repos. E.g., fix-call-conv branches on the DMD/druntime/Phobos repos. (Most) CI systems check out these branches then; Buildkite still needs dlang/ci#452.

That's a cool feature.

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 11, 2022

How about introducing a new version condition, say, version(D_reversedParametersAbi)? That also allows user code to transition and keep compatibility with multiple dmd versions.

I would say, a version specific to DMD. It was never a thing on the specification but rather a vendor-specific issue (actually LDC does the same thing), so it is weird to specify that.

@ljmf00
Copy link
Member Author

ljmf00 commented Mar 11, 2022

Ultimately, this atomic ops should be intrinsics, but I'm not willing to implement those on the DMD backend.

@Geod24
Copy link
Member

Geod24 commented Jul 9, 2022

@ljmf00 : Now you can re-submit against DMD without worrying about inter-dependency :)

@Geod24 Geod24 closed this Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants