-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
C backend fixes #13093
C backend fixes #13093
Conversation
bd2b4ef
to
0a898b5
Compare
I know this PR is still in draft, but could you extract 1cc6a95 into its own PR? It will make this and the new PR easier to review and we can merge the fixes separately from the C backend improvements. Especially as the fix contains changes to all of the native backends also, which was quite easy to miss from the title and description of this PR. |
Looking forward to this! |
329f3c9
to
d13bfb0
Compare
d13bfb0
to
9893abf
Compare
Interesting 🤔 I'm going to look into enhancing the lowering of inline assembly, so that it can automatically do these transforms (e.g. turning "{x8}" to "{i}" and inserting a "mov" when inside a naked function body). In the meantime, these hacks are nice workarounds 👍 |
Related: #13278 |
238d94d
to
1b80daa
Compare
These ifs were missing a case for f80 which should have shifted by one, but we can just compute the correct value instead. Also, we want the fractional bits to be a multiple of four, not the mantissa bits, since the mantissa could have a leading one which we want to be separated.
* Enable advanced start support. * Enable advanced test_runner support. * Zig Language Reference's Hello World now works.
Global constant initializers can reference functions, so forward declare the constants and initialize them later with the function definitions, which guarantees that they appear after all declarations.
These are needed because clang doesn't support anything in naked functions, not even assembly register inputs.
Sometimes you have to break a test to make progress :)
1b80daa
to
e20d2b3
Compare
Is this still intentionally a draft, or are you perhaps looking for review & merge now? |
This is in as good a state as any to review and merge. I can always open a new PR with further fixes. |
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.
Incredible work. This is ready to be merged.
This enabled all of the behavior tests for the C backend that were passing and fixed all of the C warnings from the flags
-Wextra -Wall -pedantic
for the behavior tests except various unused (but set) and uninitalized (only with safety off) warnings, and then fixes a bunch of disabled behavior tests.Some notable C backend milestones achieved with these changes:
x86_64-linux
(with and without libc).Fixes #12751
Fixes #11651