diff --git a/cranelift/codegen/src/ir/immediates.rs b/cranelift/codegen/src/ir/immediates.rs
index 6eb30974edc1..f53b2180de37 100644
--- a/cranelift/codegen/src/ir/immediates.rs
+++ b/cranelift/codegen/src/ir/immediates.rs
@@ -706,7 +706,23 @@ macro_rules! ieee_float {
pub fn round_ties_even(self) -> Self {
// TODO: when libm v0.2.16 is published line below can be used instead
// Self::with_float(Libm::<$float_ty>::roundeven(self.$as_float()))
- Self::with_float(self.$as_float().round_ties_even())
+ return Self::with_float(self.$as_float().roundeven());
+
+ trait Roundeven {
+ fn roundeven(self) -> Self;
+ }
+
+ impl Roundeven for f32 {
+ fn roundeven(self) -> Self {
+ libm::roundevenf(self)
+ }
+ }
+
+ impl Roundeven for f64 {
+ fn roundeven(self) -> Self {
+ libm::roundeven(self)
+ }
+ }
}
)?
}
diff --git a/cranelift/codegen/src/isa/mod.rs b/cranelift/codegen/src/isa/mod.rs
index 2bc2033983ef..25efc93dbf08 100644
--- a/cranelift/codegen/src/isa/mod.rs
+++ b/cranelift/codegen/src/isa/mod.rs
@@ -50,7 +50,7 @@ use crate::CodegenResult;
use crate::ir::{self, Function, Type};
#[cfg(feature = "unwind")]
use crate::isa::unwind::{UnwindInfoKind, systemv::RegisterMappingError};
-use crate::machinst::{CompiledCode, CompiledCodeStencil, TextSectionBuilder};
+use crate::machinst::{CompiledCodeStencil, TextSectionBuilder};
use crate::settings;
use crate::settings::Configurable;
use crate::settings::SetResult;
@@ -329,7 +329,7 @@ pub trait TargetIsa: fmt::Display + Send + Sync {
#[cfg(feature = "unwind")]
fn emit_unwind_info(
&self,
- result: &CompiledCode,
+ result: &crate::machinst::CompiledCode,
kind: UnwindInfoKind,
) -> CodegenResult