Skip to content

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Mar 30, 2022

Sorry for the noise, I didn't pay attention to the order of the archs. It's now predictable so this shouldn't happen again.

This PR adds the "general" intrinsics (not bound to any arch).

Last part of #151.

"llvm.objectsize.v8i16.p0i8" => "__builtin_object_size",
"llvm.stackrestore" => "__builtin_stack_restore",
"llvm.stacksave" => "__builtin_stack_save",
"llvm.trap" => "__builtin_trap",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think any of these are used by stdarch or any other part of the standard library.

Copy link
Contributor

Choose a reason for hiding this comment

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

llvm.trap is in the rustc code.

Copy link
Member

Choose a reason for hiding this comment

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

It is only used inside cg_llvm as implementation for the abort builder function. cg_gcc directly calls the abort builtin function there.

Copy link
Contributor

Choose a reason for hiding this comment

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

llvm.debugtrap is needed by the breakpoint intrinsic.

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't the implementation of said intrinsic directly call the right gcc builtin?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, you're right.

@GuillaumeGomez
Copy link
Member Author

It seems like these functions shouldn't be added then. Is it fine to still have the sorting predictable?

@antoyo
Copy link
Contributor

antoyo commented Mar 31, 2022

It seems like these functions shouldn't be added then. Is it fine to still have the sorting predictable?

Indeed. We can add them later if needed.

Yes, please, go ahead for the sorting.

@GuillaumeGomez GuillaumeGomez changed the title Add intrinsics not bound to a specific arch Sort archs and make the generate predictable Mar 31, 2022
@GuillaumeGomez
Copy link
Member Author

Done!

@antoyo antoyo merged commit 341b9f2 into rust-lang:master Mar 31, 2022
@GuillaumeGomez GuillaumeGomez deleted the general-intrinsics branch March 31, 2022 14:36
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.

3 participants