From: Andrew Waterman Date: Tue, 14 Sep 2010 01:00:08 +0000 (-0700) Subject: [xcc, sim] replaced ble/bleu with bge/bgeu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1583b7a9e256107094946fccb0d22541c9902225;p=riscv-isa-sim.git [xcc, sim] replaced ble/bleu with bge/bgeu This will simplify control logic (since every branch has a logical inverse) --- diff --git a/riscv/execute.h b/riscv/execute.h index 2a168ea..349fa9e 100644 --- a/riscv/execute.h +++ b/riscv/execute.h @@ -438,24 +438,24 @@ switch((insn.bits >> 0x19) & 0x7f) #include "insns/bne.h" break; } - case 0x2: + case 0x4: { #include "insns/blt.h" break; } - case 0x3: + case 0x5: { - #include "insns/bltu.h" + #include "insns/bge.h" break; } - case 0x4: + case 0x6: { - #include "insns/ble.h" + #include "insns/bltu.h" break; } - case 0x5: + case 0x7: { - #include "insns/bleu.h" + #include "insns/bgeu.h" break; } default: diff --git a/riscv/insns/bge.h b/riscv/insns/bge.h new file mode 100644 index 0000000..66db6b2 --- /dev/null +++ b/riscv/insns/bge.h @@ -0,0 +1,2 @@ +if(sreg_t(cmp_trunc(RA)) >= sreg_t(cmp_trunc(RB))) + npc = BRANCH_TARGET; diff --git a/riscv/insns/bgeu.h b/riscv/insns/bgeu.h new file mode 100644 index 0000000..52d6661 --- /dev/null +++ b/riscv/insns/bgeu.h @@ -0,0 +1,2 @@ +if(cmp_trunc(RA) >= cmp_trunc(RB)) + npc = BRANCH_TARGET; diff --git a/riscv/insns/ble.h b/riscv/insns/ble.h deleted file mode 100644 index c8547bd..0000000 --- a/riscv/insns/ble.h +++ /dev/null @@ -1,2 +0,0 @@ -if(sreg_t(cmp_trunc(RA)) <= sreg_t(cmp_trunc(RB))) - npc = BRANCH_TARGET; diff --git a/riscv/insns/bleu.h b/riscv/insns/bleu.h deleted file mode 100644 index 8827d68..0000000 --- a/riscv/insns/bleu.h +++ /dev/null @@ -1,2 +0,0 @@ -if(cmp_trunc(RA) <= cmp_trunc(RB)) - npc = BRANCH_TARGET;