aboutsummaryrefslogtreecommitdiff
path: root/sim/pru
diff options
context:
space:
mode:
Diffstat (limited to 'sim/pru')
-rw-r--r--sim/pru/pru.isa12
1 files changed, 8 insertions, 4 deletions
diff --git a/sim/pru/pru.isa b/sim/pru/pru.isa
index fb2d049..e88522b 100644
--- a/sim/pru/pru.isa
+++ b/sim/pru/pru.isa
@@ -40,26 +40,30 @@ INSTRUCTION (sub,
OP2 = (IO ? IMM8 : RS2);
RD = RS1 - OP2;
CARRY = (((uint64_t) RS1 - (uint64_t) OP2) >> RD_WIDTH) & 1;
+ CARRY = !CARRY;
PC++)
INSTRUCTION (suc,
OP2 = (IO ? IMM8 : RS2);
- RD = RS1 - OP2 - CARRY;
- CARRY = (((uint64_t) RS1 - (uint64_t) OP2 - (uint64_t) CARRY)
+ RD = RS1 - OP2 - !CARRY;
+ CARRY = (((uint64_t) RS1 - (uint64_t) OP2 - (uint64_t) !CARRY)
>> RD_WIDTH) & 1;
+ CARRY = !CARRY;
PC++)
INSTRUCTION (rsb,
OP2 = (IO ? IMM8 : RS2);
RD = OP2 - RS1;
CARRY = (((uint64_t) OP2 - (uint64_t) RS1) >> RD_WIDTH) & 1;
+ CARRY = !CARRY;
PC++)
INSTRUCTION (rsc,
OP2 = (IO ? IMM8 : RS2);
- RD = OP2 - RS1 - CARRY;
- CARRY = (((uint64_t) OP2 - (uint64_t) RS1 - (uint64_t) CARRY)
+ RD = OP2 - RS1 - !CARRY;
+ CARRY = (((uint64_t) OP2 - (uint64_t) RS1 - (uint64_t) !CARRY)
>> RD_WIDTH) & 1;
+ CARRY = !CARRY;
PC++)
INSTRUCTION (lsl,