Skip to content

Adding machine info #575

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

Merged
merged 7 commits into from
May 9, 2025
Merged

Adding machine info #575

merged 7 commits into from
May 9, 2025

Conversation

dkcumming
Copy link
Collaborator

@dkcumming dkcumming commented May 8, 2025

The MachineInfo semantics productions are now connected to the JSON which now includes it with an update. This is ignored in the Pgm currently, but could be used to make isize and usize dynamic on pointer-width - although, I am not sure how to do that atm.

This is currently pointing to a different branch of stable mir json

@dkcumming dkcumming requested review from jberthold and gtrepta May 8, 2025 23:04
@dkcumming dkcumming self-assigned this May 8, 2025
@ehildenb
Copy link
Member

ehildenb commented May 9, 2025

We shouldn't merge with it pointing to a different branch of stable-mir-json, that should be merged first (which I think is not a breaking change here?)

Also, what are we using the machine info for? Specifically for constants? maybe we should process those in the Python first, so that we only build K terms that have the higher-level data present in them?

@dkcumming
Copy link
Collaborator Author

dkcumming commented May 9, 2025

@ehildenb
I only had it pointing at a branch while I was figuring out how to get it working.
It is needed for knowing the bit width of a usize and isize as well. But I brought it into the K config for two reasons:

  1. There were already the productions for it in target.md
  2. I thought I would be able to add it to the K configuration and make usize and isize work with the appropriate bitwidth there instead of hard coding it to 64.

I couldn't see an easy way to achieve 2. (@gtrepta also helped and couldn't see a neat solution). But with all the parsing connected I figured I would open the PR. Do you think there is a way of getting around the usize and isize with python also?

@dkcumming dkcumming requested a review from ehildenb May 9, 2025 16:40
@dkcumming dkcumming merged commit 30021dd into master May 9, 2025
6 checks passed
@dkcumming dkcumming deleted the dc/machine-info branch May 9, 2025 17:50
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.

4 participants