Always inline splat and extract

Otherwise the compiler would not inline them and produce instead a
pointless call.
This commit is contained in:
Luca Barbato 2019-05-08 14:30:53 +00:00 committed by gnzlbg
parent dd72b93489
commit 04801d1a48

View file

@ -15,8 +15,8 @@ macro_rules! simd_ty {
pub(crate) const fn new($($elem_name: $elem_ty),*) -> Self {
$id($($elem_name),*)
}
#[inline]
// FIXME: Workaround rust@60637
#[inline(always)]
pub(crate) const fn splat(value: $ety) -> Self {
$id($({
#[allow(non_camel_case_types, dead_code)]
@ -25,7 +25,8 @@ macro_rules! simd_ty {
}),*)
}
#[inline]
// FIXME: Workaround rust@60637
#[inline(always)]
pub(crate) fn extract(self, index: usize) -> $ety {
unsafe {
crate::core_arch::simd_llvm::simd_extract(self, index as u32)
@ -53,7 +54,8 @@ macro_rules! simd_m_ty {
$id($(Self::bool_to_internal($elem_name)),*)
}
#[inline]
// FIXME: Workaround rust@60637
#[inline(always)]
pub(crate) const fn splat(value: bool) -> Self {
$id($({
#[allow(non_camel_case_types, dead_code)]
@ -62,7 +64,8 @@ macro_rules! simd_m_ty {
}),*)
}
#[inline]
// FIXME: Workaround rust@60637
#[inline(always)]
pub(crate) fn extract(self, index: usize) -> bool {
let r: $ety = unsafe {
crate::core_arch::simd_llvm::simd_extract(self, index as u32)