[xcc, sim] replaced ble/bleu with bge/bgeu
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>
Tue, 14 Sep 2010 01:00:08 +0000 (18:00 -0700)
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>
Tue, 14 Sep 2010 01:00:08 +0000 (18:00 -0700)
This will simplify control logic (since every branch has a logical inverse)

riscv/execute.h
riscv/insns/bge.h [new file with mode: 0644]
riscv/insns/bgeu.h [new file with mode: 0644]
riscv/insns/ble.h [deleted file]
riscv/insns/bleu.h [deleted file]

index 2a168ea866959271f34a632b98eef40cab2eb2c2..349fa9e69ca0a9ece1bf8ed0358e2fab7ede1a76 100644 (file)
@@ -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 (file)
index 0000000..66db6b2
--- /dev/null
@@ -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 (file)
index 0000000..52d6661
--- /dev/null
@@ -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 (file)
index c8547bd..0000000
+++ /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 (file)
index 8827d68..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-if(cmp_trunc(RA) <= cmp_trunc(RB))
-  npc = BRANCH_TARGET;