Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion cranelift/codegen/src/ir/immediates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
)?
}
Expand Down
4 changes: 2 additions & 2 deletions cranelift/codegen/src/isa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Option<crate::isa::unwind::UnwindInfo>>;

Expand Down
9 changes: 6 additions & 3 deletions cranelift/codegen/src/isa/x64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::isa::unwind::systemv;
use crate::isa::x64::settings as x64_settings;
use crate::isa::{Builder as IsaBuilder, FunctionAlignment, IsaFlagsHashKey};
use crate::machinst::{
CompiledCode, CompiledCodeStencil, MachInst, MachTextSectionBuilder, Reg, SigSet,
TextSectionBuilder, VCode, compile,
CompiledCodeStencil, MachInst, MachTextSectionBuilder, Reg, SigSet, TextSectionBuilder, VCode,
compile,
};
use crate::result::{CodegenError, CodegenResult};
use crate::settings::{self as shared_settings, Flags};
Expand Down Expand Up @@ -127,7 +127,7 @@ impl TargetIsa for X64Backend {
#[cfg(feature = "unwind")]
fn emit_unwind_info(
&self,
result: &CompiledCode,
result: &crate::machinst::CompiledCode,
kind: crate::isa::unwind::UnwindInfoKind,
) -> CodegenResult<Option<crate::isa::unwind::UnwindInfo>> {
emit_unwind_info(&result.buffer, kind)
Expand Down Expand Up @@ -216,7 +216,10 @@ pub fn emit_unwind_info(
buffer: &MachBufferFinalized<Final>,
kind: crate::isa::unwind::UnwindInfoKind,
) -> CodegenResult<Option<crate::isa::unwind::UnwindInfo>> {
#[cfg(feature = "unwind")]
use crate::isa::unwind::{UnwindInfo, UnwindInfoKind};
#[cfg(not(feature = "unwind"))]
let _ = buffer;
Ok(match kind {
#[cfg(feature = "unwind")]
UnwindInfoKind::SystemV => {
Expand Down
Loading