Skip to content
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

X86 backend wip #100

Merged
merged 8 commits into from
Dec 18, 2024
Merged

X86 backend wip #100

merged 8 commits into from
Dec 18, 2024

Conversation

pointbazaar
Copy link
Owner

No description provided.

~ handwritten svg ~ :)

html would have probably been the better choice.
TAC_RETURN did not correctly calculate the stackframe size and there was
bunch of assumptions about it throughout the code.

All of this should now use the correct lvst_* functions to calculate the
stack frame size.

Also link the program when using '-x86' flag to eliminate that manual
step. Example:

$ sd -x86 ifstatement.dg
ld -o /tmp/program ifstatement.o

So it prints that it called 'ld' and where the program is stored.
Copy link

netlify bot commented Dec 15, 2024

Deploy Preview for espl1000 ready!

Name Link
🔨 Latest commit bb26be7
🔍 Latest deploy log https://app.netlify.com/sites/espl1000/deploys/67632fb85cbf0500088757c2
😎 Deploy Preview https://deploy-preview-100--espl1000.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

allow the lvst size to be different based on the testcase.
Create fake instances of sst, lvst with greater flexibility.
This eliminates some edge cases in the compiler which were previously
there to compensate for the lack of these tables in testing.

Also start writing tests for TAC_CALL.
Implement a test for a function call with 1 argument.
Adjust the offset calculation for rbp.
IR statements can 'use' and 'define' IR temporaries.

This can be used to calculate sets 'in', 'out'
which describe which temporaries are live on an incoming respective
outgoing edge of an IR statement.

2 IR temporaries (used by struct TAC in our case) can share a register
if they are not both live at the some point in the program.

Tests: 2 very basic tests, needs to be extended
      TODO: probably make a '_liveness_struct.h' file
      to define 'struct Liveness' so it can be inspected
      from the testcases.

References:
  https://lambda.uta.edu/cse5317/notes/node40.html
Test the contents of 'in','out','def','use' map
for different IR statements (struct TAC).

'use' and 'def' map are the inputs for liveness analysis,
so they have test coverage for many IR statements.
@pointbazaar pointbazaar merged commit 3669bd6 into master Dec 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant