Commit Diff


commit - b7fe485803e290ef3050c689422a35360fbb836b
commit + 10353a3c04e9d549d1772e85c173c3e24ca109f8
blob - 13211d74922c5f7de1a85008c82b8d5d6fd7b254
blob + 4ddf72f33f406fb05bfc8027e431bb793e067523
--- rvvm/rvhandler.c
+++ rvvm/rvhandler.c
@@ -119,10 +119,28 @@ exec_ecall(struct rv_hart *h, struct rv_ram *m, struct
 	(void)m; (void)h; (void)i;
 }
 
-void exec_lui(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { (void)m; h->rfile[i.rd] = i.imm; }
-void exec_auipc(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { (void)m; h->rfile[i.rd] = h->pc + i.imm; }
-void exec_jal(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { (void)m; h->rfile[i.rd] = h->pc + 4; h->next_pc = h->pc + i.imm; }
+void
+exec_lui(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{
+	(void)m;
+	h->rfile[i.rd] = i.imm;
+}
 
+void
+exec_auipc(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{
+	(void)m;
+	h->rfile[i.rd] = h->pc + i.imm;
+}
+
+void
+exec_jal(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{
+	(void)m;
+	h->rfile[i.rd] = h->pc + 4;
+	h->next_pc = h->pc + i.imm;
+}
+
 void exec_jalr(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) {
     (void)m;
     uint64_t target = (h->rfile[i.rs1] + i.imm) & ~1ULL;
@@ -135,12 +153,37 @@ void exec_bne(struct rv_hart *h, struct rv_ram *m, str
     if (h->rfile[i.rs1] != h->rfile[i.rs2]) h->next_pc = h->pc + i.imm;
 }
 
-void exec_xor(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { (void)m; h->rfile[i.rd] = h->rfile[i.rs1] ^ h->rfile[i.rs2]; }
-void exec_or(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { (void)m; h->rfile[i.rd] = h->rfile[i.rs1] | h->rfile[i.rs2]; }
+void
+exec_xor(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{
+	(void)m;
+	h->rfile[i.rd] = h->rfile[i.rs1] ^ h->rfile[i.rs2];
+}
 
-void exec_slli(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { (void)m; h->rfile[i.rd] = h->rfile[i.rs1] << (i.imm & 0x3F); }
-void exec_srli(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { (void)m; h->rfile[i.rd] = h->rfile[i.rs1] >> (i.imm & 0x3F); }
-void exec_srai(struct rv_hart *h, struct rv_ram *m, struct rv_instr i) { 
+void
+exec_or(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{
+	(void)m;
+	h->rfile[i.rd] = h->rfile[i.rs1] | h->rfile[i.rs2];
+}
+
+void
+exec_slli(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{
+	(void)m;
+	h->rfile[i.rd] = h->rfile[i.rs1] << (i.imm & 0x3F);
+}
+
+void
+exec_srli(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{
+	(void)m;
+	h->rfile[i.rd] = h->rfile[i.rs1] >> (i.imm & 0x3F);
+}
+
+void
+exec_srai(struct rv_hart *h, struct rv_ram *m, struct rv_instr i)
+{ 
     (void)m; 
     h->rfile[i.rd] = (int64_t)h->rfile[i.rs1] >> (i.imm & 0x3F); 
 }