File tree 1 file changed +5
-2
lines changed
RISCV_C_Version/C_Version
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 16
16
// Modification History:
17
17
// =====================
18
18
//
19
- // Revision 1 10/8/15
19
+ // Revision 1 3/29/2020
20
20
// Initial revision
21
21
//
22
+ // Revision 2 4/3/2020
23
+ // Fixed BLTU
24
+ //
22
25
//
23
26
//------------------------------------------------------------------------
24
27
//
@@ -88,7 +91,7 @@ int main()
88
91
if (opcode == 0b1100011 && funct3 == 0b001 ) { if (rv5_reg [rs1 ]!= rv5_reg [rs2 ]) rv5_pc = ( (B_immediate_SE ) + rv5_pc ) - 0x4 ; printf (" BNE " ); } else // BNE
89
92
if (opcode == 0b1100011 && funct3 == 0b100 ) { if ((signed long )rv5_reg [rs1 ]< (signed long )rv5_reg [rs2 ]) rv5_pc = ((B_immediate_SE ) + rv5_pc ) - 0x4 ; printf (" BLT " ); } else // BLT
90
93
if (opcode == 0b1100011 && funct3 == 0b101 ) { if ((signed long )rv5_reg [rs1 ]>=(signed long )rv5_reg [rs2 ]) rv5_pc = ((B_immediate_SE ) + rv5_pc ) - 0x4 ; printf (" BGE " ); } else // BGE
91
- if (opcode == 0b1100011 && funct3 == 0b110 ) { if (rv5_reg [rs1 ]>= rv5_reg [rs2 ]) rv5_pc = ( (B_immediate_SE ) + rv5_pc ) - 0x4 ; printf (" BLTU " ); } else // BLTU
94
+ if (opcode == 0b1100011 && funct3 == 0b110 ) { if (rv5_reg [rs1 ]< rv5_reg [rs2 ]) rv5_pc = ( (B_immediate_SE ) + rv5_pc ) - 0x4 ; printf (" BLTU " ); } else // BLTU
92
95
if (opcode == 0b1100011 && funct3 == 0b111 ) { if (rv5_reg [rs1 ]>=rv5_reg [rs2 ]) rv5_pc = ( (B_immediate_SE ) + rv5_pc ) - 0x4 ; printf (" BGTU " ); } else // BGTU
93
96
if (opcode == 0b0000011 && funct3 == 0b000 ) { rv5_reg [rd ] = (rv5_user_memory [(I_immediate_SE )+ rv5_reg [rs1 ]] & 0x80 ) ? 0xFFFFFF00 | rv5_user_memory [(I_immediate_SE )+ rv5_reg [rs1 ]] : (rv5_user_memory [(I_immediate_SE )+ rv5_reg [rs1 ]] & 0xFF ); printf (" LB " ); } else // LB
94
97
if (opcode == 0b0000011 && funct3 == 0b001 ) { rv5_reg [rd ] = (rv5_user_memory [(I_immediate_SE )+ rv5_reg [rs1 ]] & 0x8000 ) ? 0xFFFF0000 | rv5_user_memory [(I_immediate_SE )+ rv5_reg [rs1 ]] : (rv5_user_memory [(I_immediate_SE )+ rv5_reg [rs1 ]] & 0xFFFF ); printf (" LH " ); } else // LH
You can’t perform that action at this time.
0 commit comments