aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-09-13 18:00:08 -0700
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-09-13 18:00:08 -0700
commit1583b7a9e256107094946fccb0d22541c9902225 (patch)
tree898d2c9b066583e9591246b60bae96f5a4fd6347
parent19b59dd9a00e6cd68e4f81a116d400289e513402 (diff)
downloadspike-1583b7a9e256107094946fccb0d22541c9902225.zip
spike-1583b7a9e256107094946fccb0d22541c9902225.tar.gz
spike-1583b7a9e256107094946fccb0d22541c9902225.tar.bz2
[xcc, sim] replaced ble/bleu with bge/bgeu
This will simplify control logic (since every branch has a logical inverse)
-rw-r--r--riscv/execute.h14
-rw-r--r--riscv/insns/bge.h2
-rw-r--r--riscv/insns/bgeu.h2
-rw-r--r--riscv/insns/ble.h2
-rw-r--r--riscv/insns/bleu.h2
5 files changed, 11 insertions, 11 deletions
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;