MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / wasm_load

Method wasm_load

winch/codegen/src/isa/aarch64/masm.rs:442–480  ·  view source on GitHub ↗
(&mut self, src: Self::Address, dst: WritableReg, kind: LoadKind)

Source from the content-addressed store, hash-verified

440 }
441
442 fn wasm_load(&mut self, src: Self::Address, dst: WritableReg, kind: LoadKind) -> Result<()> {
443 let size = kind.derive_operand_size();
444 self.with_aligned_sp(|masm| match &kind {
445 LoadKind::Operand(_) => {
446 if size == OperandSize::S128 {
447 bail!(CodeGenError::UnimplementedWasmLoadKind)
448 } else {
449 src.to_addressing_mode(masm, size, |masm, mem| {
450 Ok(masm.asm.uload(mem, dst, size, UNTRUSTED_FLAGS))
451 })
452 }
453 }
454 LoadKind::Splat(_) => bail!(CodeGenError::UnimplementedWasmLoadKind),
455 LoadKind::ScalarExtend(extend_kind) => {
456 if extend_kind.signed() {
457 src.to_addressing_mode(masm, size, |masm, mem| {
458 masm.asm.sload(mem, dst, size, UNTRUSTED_FLAGS);
459 Ok(())
460 })
461 } else {
462 src.to_addressing_mode(masm, size, |masm, mem| {
463 // unlike x64, unused bits are set to zero so we don't need to extend
464 masm.asm.uload(mem, dst, size, UNTRUSTED_FLAGS);
465 Ok(())
466 })
467 }
468 }
469 LoadKind::VectorExtend(_vector_extend_kind) => {
470 bail!(CodeGenError::UnimplementedWasmLoadKind)
471 }
472 LoadKind::VectorLane(_selector) => {
473 bail!(CodeGenError::unimplemented_masm_instruction())
474 }
475 LoadKind::Atomic(_, _) => bail!(CodeGenError::unimplemented_masm_instruction()),
476 LoadKind::VectorZero(_size) => {
477 bail!(CodeGenError::UnimplementedWasmLoadKind)
478 }
479 })
480 }
481
482 fn compute_addr(
483 &mut self,

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
derive_operand_sizeMethod · 0.80
with_aligned_spMethod · 0.80
to_addressing_modeMethod · 0.80
uloadMethod · 0.80
sloadMethod · 0.80
signedMethod · 0.45

Tested by

no test coverage detected