Generate intrinsic aliases directly

Using the full module structure generated by the intrinsics macro
interacts oddly with inlining on some optimization levels, causing
a duplicate identical function body to be generated.  This doesn't
affect performance, but it wastes space, so just declare the alias
directly which seems to cause the symbol to be aliased as it should
be.
This commit is contained in:
Derek Hageman 2022-02-20 10:26:58 -07:00
parent f67b650bb3
commit b8ef969d92

View file

@ -13,9 +13,10 @@ macro_rules! intrinsics_aliases {
$($rest:ident)*
) => {
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))]
intrinsics! {
extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
$name($($argname),*)
mod $alias {
#[no_mangle]
pub extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
super::$name($($argname),*)
}
}
@ -31,9 +32,10 @@ macro_rules! intrinsics_aliases {
$($rest:ident)*
) => {
#[cfg(all(target_arch = "arm", not(feature = "disable-intrinsics")))]
intrinsics! {
mod $alias {
#[no_mangle]
unsafe extern $abi fn $alias( $($argname: $ty),* ) -> $ret {
$name($($argname),*)
super::$name($($argname),*)
}
}