This will simplify control logic (since every branch has a logical inverse)
#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:
--- /dev/null
+if(sreg_t(cmp_trunc(RA)) >= sreg_t(cmp_trunc(RB)))
+ npc = BRANCH_TARGET;
--- /dev/null
+if(cmp_trunc(RA) >= cmp_trunc(RB))
+ npc = BRANCH_TARGET;
+++ /dev/null
-if(sreg_t(cmp_trunc(RA)) <= sreg_t(cmp_trunc(RB)))
- npc = BRANCH_TARGET;
+++ /dev/null
-if(cmp_trunc(RA) <= cmp_trunc(RB))
- npc = BRANCH_TARGET;