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

Function sw

crates/virtual-machine/tests/vm_pipeline.rs:56–61  ·  view source on GitHub ↗

sw rs2, imm(rs1) -> opcode=0x23, funct3=2

(rs1: u32, rs2: u32, imm: i32)

Source from the content-addressed store, hash-verified

54
55// sw rs2, imm(rs1) -> opcode=0x23, funct3=2
56fn sw(rs1: u32, rs2: u32, imm: i32) -> u32 {
57 let imm12 = (imm as u32) & 0xFFF;
58 let imm_11_5 = imm12 >> 5;
59 let imm_4_0 = imm12 & 0x1f;
60 (imm_11_5 << 25) | (rs2 << 20) | (rs1 << 15) | (2 << 12) | (imm_4_0 << 7) | 0x23
61}
62
63// lw rd, imm(rs1) -> opcode=0x03, funct3=2
64fn lw(rd: u32, rs1: u32, imm: i32) -> u32 {

Callers 2

pipeline_load_use_stallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected