Skip to content

Add missing register class conversion for inline asm #232

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

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Oct 13, 2022

Part of #60.

@GuillaumeGomez GuillaumeGomez force-pushed the more-inline-asm-register-class-conversion branch from dd56ca2 to d532473 Compare October 13, 2022 19:52
@GuillaumeGomez GuillaumeGomez force-pushed the more-inline-asm-register-class-conversion branch from d532473 to 0301d4a Compare October 14, 2022 09:21
@Amanieu
Copy link
Member

Amanieu commented Oct 14, 2022

You'll probably want to run the tests in src/test/assembly/asm to check that the constraints for all targets are correct.

@GuillaumeGomez GuillaumeGomez force-pushed the more-inline-asm-register-class-conversion branch from 0301d4a to 26d58e2 Compare October 14, 2022 14:38
src/base.rs Outdated
context.add_command_line_option(arg);
if !arg.starts_with("--x86-asm-syntax=") {
context.add_command_line_option(arg);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would break anyone that needs a specific assembly syntax in rustc's output, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're currently doing some tests.

This option is an LLVM option; for gcc it should be -masm=intel. I'm not sure what's the plan for supporting setting options for the different backends, but cg_gcc currently uses llvm-args to set gcc options. Since this option is to send arguments to the backend, I'm not sure it makes sense to do the mapping between the LLVM options and GCC options.

I guess we would need to discuss this somewhere to agree on the correct solution, though.

@GuillaumeGomez GuillaumeGomez force-pushed the more-inline-asm-register-class-conversion branch 2 times, most recently from 636346a to ffd1df7 Compare October 15, 2022 14:30
@GuillaumeGomez GuillaumeGomez force-pushed the more-inline-asm-register-class-conversion branch 5 times, most recently from 51b6ba1 to 68e0c6e Compare October 17, 2022 12:27
@GuillaumeGomez GuillaumeGomez force-pushed the more-inline-asm-register-class-conversion branch from 68e0c6e to f150ab3 Compare October 18, 2022 21:31
Copy link
Contributor

@antoyo antoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@antoyo antoyo merged commit bfc184c into rust-lang:master Oct 26, 2022
@GuillaumeGomez GuillaumeGomez deleted the more-inline-asm-register-class-conversion branch October 26, 2022 16:28
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