MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / fmt

Method fmt

crates/virtual-machine/src/cpu/decoder.rs:437–693  ·  view source on GitHub ↗
(&self, f: &mut std::fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

435 )
436 }
437 Self::Auipc { rd, imm } => {
438 write!(
439 f,
440 "{:<10} {}, {:#x}",
441 "auipc",
442 reg_name(*rd),
443 (*imm as u64) >> 12
444 )
445 }
446 Self::Jal { rd, imm } => {
447 write!(f, "{:<10} {}, {}", "jal", reg_name(*rd), imm)
448 }
449 Self::Jalr { rd, rs1, imm } => {
450 write!(
451 f,
452 "{:<10} {}, {}({})",
453 "jalr",
454 reg_name(*rd),
455 imm,
456 reg_name(*rs1)
457 )
458 }
459 Self::Branch { rs1, rs2, imm, .. } => {
460 write!(
461 f,
462 "{:<10} {}, {}, {}",
463 self.mnemonic(),
464 reg_name(*rs1),
465 reg_name(*rs2),
466 imm
467 )
468 }
469 Self::Load { rd, rs1, imm, .. } => {
470 write!(
471 f,
472 "{:<10} {}, {}({})",
473 self.mnemonic(),
474 reg_name(*rd),
475 imm,
476 reg_name(*rs1)
477 )
478 }
479 Self::Store { rs1, rs2, imm, .. } => {
480 write!(
481 f,
482 "{:<10} {}, {}({})",
483 self.mnemonic(),
484 reg_name(*rs2),
485 imm,
486 reg_name(*rs1)
487 )
488 }
489 Self::AluImm {
490 rd,
491 rs1,
492 imm,
493 funct3,
494 ..

Callers

nothing calls this directly

Calls 1

mnemonicMethod · 0.45

Tested by

no test coverage detected