Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-fink committed Feb 26, 2024
1 parent c3d07b1 commit 6838cd3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
12 changes: 10 additions & 2 deletions cranelift/codegen/src/ir/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,11 @@ impl Display for Type {
} else if self.is_ref() {
write!(f, "r{}", self.lane_bits())
} else if self.is_cap_ptr() {
assert_eq!(self.lane_bits(), 128, "Only supporting c64 (128 bit) pointers for now");
assert_eq!(
self.lane_bits(),
128,
"Only supporting c64 (128 bit) pointers for now"
);
write!(f, "c64")
} else {
match *self {
Expand All @@ -477,7 +481,11 @@ impl Debug for Type {
} else if self.is_ref() {
write!(f, "types::R{}", self.lane_bits())
} else if self.is_cap_ptr() {
assert_eq!(self.lane_bits(), 128, "Only supporting c64 (128 bit) pointers for now");
assert_eq!(
self.lane_bits(),
128,
"Only supporting c64 (128 bit) pointers for now"
);
write!(f, "types::C64")
} else {
match *self {
Expand Down
5 changes: 1 addition & 4 deletions cranelift/codegen/src/isa/aarch64/inst/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1654,10 +1654,7 @@ impl MachInstEmit for Inst {
&Inst::ULoad64Alt { .. } => (0b10000010111, 0b01, 64),
&Inst::LoadC64Alt { .. } => (0b11000010111, 0b11, 64),
&Inst::SLoad32Alt { .. } => {
assert!(matches!(
&mem,
&CapAMode::Unscaled { .. }
));
assert!(matches!(&mem, &CapAMode::Unscaled { .. }));
(0, 0, 32)
}
&Inst::FpuLoad32Alt { .. } => todo!(),
Expand Down
6 changes: 5 additions & 1 deletion crates/cranelift/src/func_environ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,11 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m

fn make_heap(&mut self, func: &mut ir::Function, index: MemoryIndex) -> WasmResult<Heap> {
let addr_type = self.pointer_type();
let pointer_type = if self.isa.flags().enable_cheri() { C64 } else { self.pointer_type() };
let pointer_type = if self.isa.flags().enable_cheri() {
C64
} else {
self.pointer_type()
};
let is_shared = self.module.memory_plans[index].memory.shared;

let min_size = self.module.memory_plans[index]
Expand Down
6 changes: 5 additions & 1 deletion crates/runtime/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,11 @@ impl Instance {
unsafe { VMMemoryDefinition::load(self.memory_ptr(index)) }
}

unsafe fn write_defined_memory(&self, mem_ptr: *mut VMMemoryDefinition, mem: VMMemoryDefinition) {
unsafe fn write_defined_memory(
&self,
mem_ptr: *mut VMMemoryDefinition,
mem: VMMemoryDefinition,
) {
cfg_if::cfg_if! {
if #[cfg(all(target_arch = "aarch64", feature = "cheri"))] {
// First we write the whole thing. If we are on cheri, we then need to write the capability
Expand Down
5 changes: 4 additions & 1 deletion crates/runtime/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ impl RuntimeLinearMemory for MmapMemory {
}

fn vmmemory(&mut self) -> VMMemoryDefinition {
VMMemoryDefinition::new(unsafe { self.mmap.as_mut_ptr().add(self.pre_guard_size) }, self.accessible)
VMMemoryDefinition::new(
unsafe { self.mmap.as_mut_ptr().add(self.pre_guard_size) },
self.accessible,
)
}

fn needs_init(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion crates/wasmtime/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl Instance {
store: StorePtr::new(store.traitobj()),
wmemcheck: store.engine().config().wmemcheck,
pkey: store.get_pkey(),
cheri: store.engine().config().cheri
cheri: store.engine().config().cheri,
})?;

// The instance still has lots of setup, for example
Expand Down

0 comments on commit 6838cd3

Please sign in to comment.