-
Notifications
You must be signed in to change notification settings - Fork 10.5k
16 bit pointer fixes #74693
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
base: main
Are you sure you want to change the base?
16 bit pointer fixes #74693
Conversation
@swift-ci please test |
Quick comment, I moved over a change to this PR that was going to the AVR architecture branch, because it's actually more accurately a 16 bit pointer change (see discussion on #74818 for details). |
I think this is on the right track, but will need tests, but IIUC we can't really have any tests that target AVR until the target triple is accepted by the compiler (not even parse-only tests)? Let's then work on getting the target triple accepted first, I guess in #74818 ? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
add a sensible default for atomics on 16 bit platform
@kubamracek as I said on the call, some of these fixes may not be necessary for code compiled in embedded mode. But, theoretically, some 16-bit platforms may still want to use things like metadata and resilient classes some day. So it's really a question of whether we want to do these fixes now to help anyone in that situation? Or is it better to address this PR strictly for what's needed for AVR, and remove these fixes? It was a bit tiresome tracking down these issues and creating these fixes, but that might have been more my lack of experience than anything else. emitClassResilientInstanceSizeAndAlignMask - I'm guessing resilient class layout isn't relevant for AVR If we omit all the above, that probably just leaves us with getExtraInhabitantIndex. Are extra inhabitants still used on embedded mode Swift, even without metadata or runtime? |
I think the metadata runtime will never even closely fit onto a 16-bit platform. |
+1 I think we should not try to support full swift for 16bit triples. Related I think we need to improve our diagnostics when building with the wrong mode, see: #75077 |
These changes fix some crashes when trying to build programs for 16-bit targets.
Note: I'm not sure if there are any 16-bit pointer targets yet for Swift. I hope to add AVR in the near future.
The AVR architecture is extremely space constrained and will use the "embedded" compiler mode, which makes some of the fixes here not important for that platform, but they're included for completeness, in case someone wants to add other 16-bit platforms in the future where embedded mode is not used and where metadata is still important.