Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit ac3dcbc

Browse files
committed
Minor code cleanup
1 parent 99e1ef5 commit ac3dcbc

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

emu-rv32i.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,8 @@ uint32_t divu32(uint32_t a, uint32_t b)
917917
{
918918
if (b == 0) {
919919
return -1;
920-
} else {
921-
return a / b;
922920
}
921+
return a / b;
923922
}
924923

925924
int32_t rem32(int32_t a, int32_t b)
@@ -928,18 +927,16 @@ int32_t rem32(int32_t a, int32_t b)
928927
return a;
929928
} else if (a == ((int32_t) 1 << (XLEN - 1)) && b == -1) {
930929
return 0;
931-
} else {
932-
return a % b;
933930
}
931+
return a % b;
934932
}
935933

936934
uint32_t remu32(uint32_t a, uint32_t b)
937935
{
938936
if (b == 0) {
939937
return a;
940-
} else {
941-
return a % b;
942938
}
939+
return a % b;
943940
}
944941

945942
static uint32_t mulh32(int32_t a, int32_t b)
@@ -1599,10 +1596,10 @@ void execute_instruction()
15991596
return;
16001597
}
16011598
/*
1602-
compliance test specific: if bit 0 of gp (x3) is 0, it is a
1603-
syscall, otherwise it is the program end, with the exit code
1604-
in the bits 31:1
1605-
*/
1599+
* compliance test specific: if bit 0 of gp (x3) is 0, it is a
1600+
* syscall, otherwise it is the program end, with the exit code
1601+
* in the bits 31:1
1602+
*/
16061603
if (begin_signature) {
16071604
if (reg[3] & 1) {
16081605
debug_out("program end, result: %04x\n", reg[3] >> 1);

0 commit comments

Comments
 (0)