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

Fcmpo cror on dtk has a different format #277

Open
dbalatoni13 opened this issue May 28, 2024 · 3 comments
Open

Fcmpo cror on dtk has a different format #277

dbalatoni13 opened this issue May 28, 2024 · 3 comments

Comments

@dbalatoni13
Copy link
Contributor

We currently have an asm pattern for Fcmpo cror, it looks like this:

fcmpo $cr0, $x, $y
cror 2, N, 2

but in the asm format of dtk it's like this:

fcmpo $cr0, $x, $y
cror eq, gt, eq

or lt respectively.

What would be the nicest way to make m2c support both formats?

@simonlindholm
Copy link
Collaborator

The way this is meant to work is that you have a .set eq, 2 directive in your asm file that gets expanded during parsing. If dtk is assuming an implicit prelude then we may want to add that prelude to m2c.

@dbalatoni13
Copy link
Contributor Author

dbalatoni13 commented May 28, 2024

dtk asm files include macros.inc which does not contain this directive.

My question is: even if it did, would the include be needed to be manually pasted into the file before running m2c or is there an automatic way?

@simonlindholm
Copy link
Collaborator

It would currently need to be either manually pasted, yes. I think we can add an arch-specific prelude to deal with this? It would go in defines in parse_file. This approach does mean btw that reloc references to a global named eq gets treated as a literal with the value 2 instead, which is not ideal, but I think in practice the breakage will be non-existent.

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

No branches or pull requests

2 participants