remove unsigned_add_overflow_condition (#6199)

This commit is contained in:
T0b1-iOS
2023-04-13 16:30:44 +02:00
committed by GitHub
parent 91e36f3449
commit 3956a6aa0f
9 changed files with 1 additions and 48 deletions

View File

@@ -1,7 +1,6 @@
//! ARM 64-bit Instruction Set Architecture. //! ARM 64-bit Instruction Set Architecture.
use crate::dominator_tree::DominatorTree; use crate::dominator_tree::DominatorTree;
use crate::ir::condcodes::IntCC;
use crate::ir::{Function, Type}; use crate::ir::{Function, Type};
use crate::isa::aarch64::settings as aarch64_settings; use crate::isa::aarch64::settings as aarch64_settings;
#[cfg(feature = "unwind")] #[cfg(feature = "unwind")]
@@ -134,12 +133,6 @@ impl TargetIsa for AArch64Backend {
16 16
} }
fn unsigned_add_overflow_condition(&self) -> IntCC {
// Unsigned `>=`; this corresponds to the carry flag set on aarch64, which happens on
// overflow of an add.
IntCC::UnsignedGreaterThanOrEqual
}
#[cfg(feature = "unwind")] #[cfg(feature = "unwind")]
fn emit_unwind_info( fn emit_unwind_info(
&self, &self,

View File

@@ -286,9 +286,6 @@ pub trait TargetIsa: fmt::Display + Send + Sync {
Err(RegisterMappingError::UnsupportedArchitecture) Err(RegisterMappingError::UnsupportedArchitecture)
} }
/// IntCC condition for Unsigned Addition Overflow (Carry).
fn unsigned_add_overflow_condition(&self) -> ir::condcodes::IntCC;
/// Creates unwind information for the function. /// Creates unwind information for the function.
/// ///
/// Returns `None` if there is no unwind information for the function. /// Returns `None` if there is no unwind information for the function.

View File

@@ -2,7 +2,6 @@
use crate::dominator_tree::DominatorTree; use crate::dominator_tree::DominatorTree;
use crate::ir; use crate::ir;
use crate::ir::condcodes::IntCC;
use crate::ir::Function; use crate::ir::Function;
use crate::isa::riscv64::settings as riscv_settings; use crate::isa::riscv64::settings as riscv_settings;
@@ -130,10 +129,6 @@ impl TargetIsa for Riscv64Backend {
self.isa_flags.iter().collect() self.isa_flags.iter().collect()
} }
fn unsigned_add_overflow_condition(&self) -> IntCC {
IntCC::UnsignedGreaterThanOrEqual
}
#[cfg(feature = "unwind")] #[cfg(feature = "unwind")]
fn emit_unwind_info( fn emit_unwind_info(
&self, &self,

View File

@@ -1,7 +1,6 @@
//! IBM Z 64-bit Instruction Set Architecture. //! IBM Z 64-bit Instruction Set Architecture.
use crate::dominator_tree::DominatorTree; use crate::dominator_tree::DominatorTree;
use crate::ir::condcodes::IntCC;
use crate::ir::{Function, Type}; use crate::ir::{Function, Type};
use crate::isa::s390x::settings as s390x_settings; use crate::isa::s390x::settings as s390x_settings;
#[cfg(feature = "unwind")] #[cfg(feature = "unwind")]
@@ -131,15 +130,6 @@ impl TargetIsa for S390xBackend {
16 16
} }
fn unsigned_add_overflow_condition(&self) -> IntCC {
// The ADD LOGICAL family of instructions set the condition code
// differently from normal comparisons, in a way that cannot be
// represented by any of the standard IntCC values. So we use a
// dummy value here, which gets remapped to the correct condition
// code mask during lowering.
IntCC::UnsignedGreaterThan
}
#[cfg(feature = "unwind")] #[cfg(feature = "unwind")]
fn emit_unwind_info( fn emit_unwind_info(
&self, &self,

View File

@@ -4,7 +4,7 @@ pub use self::inst::{args, CallInfo, EmitInfo, EmitState, Inst};
use super::{OwnedTargetIsa, TargetIsa}; use super::{OwnedTargetIsa, TargetIsa};
use crate::dominator_tree::DominatorTree; use crate::dominator_tree::DominatorTree;
use crate::ir::{condcodes::IntCC, Function, Type}; use crate::ir::{Function, Type};
#[cfg(feature = "unwind")] #[cfg(feature = "unwind")]
use crate::isa::unwind::systemv; use crate::isa::unwind::systemv;
use crate::isa::x64::{inst::regs::create_reg_env_systemv, settings as x64_settings}; use crate::isa::x64::{inst::regs::create_reg_env_systemv, settings as x64_settings};
@@ -124,12 +124,6 @@ impl TargetIsa for X64Backend {
&self.triple &self.triple
} }
fn unsigned_add_overflow_condition(&self) -> IntCC {
// Unsigned `<`; this corresponds to the carry flag set on x86, which
// indicates an add has overflowed.
IntCC::UnsignedLessThan
}
#[cfg(feature = "unwind")] #[cfg(feature = "unwind")]
fn emit_unwind_info( fn emit_unwind_info(
&self, &self,

View File

@@ -604,10 +604,6 @@ impl<'a> FuncEnvironment for FuncEnv<'a> {
.translate_atomic_notify(pos, index, heap, addr, count) .translate_atomic_notify(pos, index, heap, addr, count)
} }
fn unsigned_add_overflow_condition(&self) -> ir::condcodes::IntCC {
self.inner.unsigned_add_overflow_condition()
}
fn heaps( fn heaps(
&self, &self,
) -> &cranelift_codegen::entity::PrimaryMap<cranelift_wasm::Heap, cranelift_wasm::HeapData> ) -> &cranelift_codegen::entity::PrimaryMap<cranelift_wasm::Heap, cranelift_wasm::HeapData>

View File

@@ -655,10 +655,6 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
) -> WasmResult<ir::Value> { ) -> WasmResult<ir::Value> {
Ok(pos.ins().iconst(I32, 0)) Ok(pos.ins().iconst(I32, 0))
} }
fn unsigned_add_overflow_condition(&self) -> ir::condcodes::IntCC {
unimplemented!()
}
} }
impl TargetEnvironment for DummyEnvironment { impl TargetEnvironment for DummyEnvironment {

View File

@@ -522,10 +522,6 @@ pub trait FuncEnvironment: TargetEnvironment {
Ok(()) Ok(())
} }
/// Returns the target ISA's condition to check for unsigned addition
/// overflowing.
fn unsigned_add_overflow_condition(&self) -> ir::condcodes::IntCC;
/// Whether or not to force relaxed simd instructions to have deterministic /// Whether or not to force relaxed simd instructions to have deterministic
/// lowerings meaning they will produce the same results across all hosts, /// lowerings meaning they will produce the same results across all hosts,
/// regardless of the cost to performance. /// regardless of the cost to performance.

View File

@@ -2150,10 +2150,6 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m
Ok(()) Ok(())
} }
fn unsigned_add_overflow_condition(&self) -> ir::condcodes::IntCC {
self.isa.unsigned_add_overflow_condition()
}
fn relaxed_simd_deterministic(&self) -> bool { fn relaxed_simd_deterministic(&self) -> bool {
self.tunables.relaxed_simd_deterministic self.tunables.relaxed_simd_deterministic
} }