-
-
Couldn't load subscription status.
- Fork 3.1k
feat: init x86_16 arch via CBE #25691
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
Conversation
| // Technically x86 can use segmentation... | ||
| .far => (arch == .x86_16), |
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.
In this case, the question is what compilers support, not what the architecture supports.
Which might actually be an argument for moving supportsAddressSpace to std.zig.target... but that's a problem for another day.
| // x86_16 extra address spaces. | ||
| /// Allows addressing the entire address space by storing both segment and offset. | ||
| far, |
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 we have precedent for addrspace affecting pointer size; we kind of just assume that all pointers have the same size. That's wrong for many reasons and will have to change one way or another, but just so you know, here be dragons.
This comment was marked as resolved.
This comment was marked as resolved.
This reverts commit 446c343. Dropped in favor of ziglang#25691 (0d1e26e)
|
This looks good to me now. Just to keep history clean, would you mind rewriting this into 4 commits:
|
874966e to
104c272
Compare
This reverts commit 446c343. Dropped in favor of ziglang#25691 (0d1e26e)
This adds support for x86_16, a.k.a IA-16, a.k.a i86 via CBE targeting the IA-16 fork of GCC.
Primarily targeted for
freestandingand DOS programs (other). Support forfarpointers should be done in a follow-up PR as it involves lowering them in CBE.As
usizeis 16-bits I had to add some explicit@intCasts incompiler_rt, I'm sure a lot ofstdcode will have the same issue (#10669).Here's a snippet I tested in DOSBOX:
Partially addresses #7469