cranelift: Implement scalar FMA on x86 (#4460)

x86 does not have dedicated instructions for scalar FMA, lower
to a libcall which seems to be what llvm does.
This commit is contained in:
Afonso Bordado
2022-08-03 18:29:10 +01:00
committed by GitHub
parent ff6082c0af
commit 709716bb8e
13 changed files with 167 additions and 50 deletions

View File

@@ -4,6 +4,7 @@ use alloc::boxed::Box;
use alloc::vec::Vec;
use smallvec::SmallVec;
use std::cell::Cell;
use target_lexicon::Triple;
pub use super::MachLabel;
pub use crate::ir::{
@@ -899,6 +900,7 @@ where
[(C::I, bool); N]: smallvec::Array,
{
pub lower_ctx: &'a mut C,
pub triple: &'a Triple,
pub flags: &'a F,
pub isa_flags: &'a I,
}
@@ -910,6 +912,7 @@ where
/// lowering.
pub(crate) fn lower_common<C, F, I, IF, const N: usize>(
lower_ctx: &mut C,
triple: &Triple,
flags: &F,
isa_flags: &I,
outputs: &[InsnOutput],
@@ -925,6 +928,7 @@ where
// internal heap allocations.
let mut isle_ctx = IsleContext {
lower_ctx,
triple,
flags,
isa_flags,
};