Commit graph

5 commits

Author SHA1 Message Date
Bill Currie
e1ecda9221 [gamecode] Add unsigned divide and remainder instructions
I had forgotten that unsigned division was different from signed
division (rather silly of me). However, with some testing and analysis,
unsigned true modulo is not needed as it's not possible to have
negative inputs and thus it's the same as remainder.
2022-02-06 12:20:17 +09:00
Bill Currie
8050c7bd77 [gamecode] Rearrange several instructions
ANY/ALL/NONE have been temporarily removed until I implement the HOPS
(horizontal operations) sub-instructions, which will all both 32-bit and
64-bit operands and several other operations (eg, horizontal add).

All the fancy addressing modes for the conditional branch instructions
have been permanently removed: I decided the gain was too little for the
cost (24 instructions vs 6). JUMP and CALL retain their addressing
modes, though.

Other instructions have been shuffled around a little to fill most of
the holes in the upper block of 256 instructions: just a single small
7-instruction hole.

Rearrangements in the actual engine are mostly just to keep the code
organized. The only real changes were the various IF statements and
dealing with the resulting changes in their addressing.
2022-01-16 14:22:04 +09:00
Bill Currie
1a2ac24d8d [gamecode] Make num_globals() calculate actual globals
It calculating only the size of the array (which was often 4 or 8
globals per element) proved to be a pain when I forgot to alter the size
for the new scale tests. Fixing the size calculation even found a bug in
the shiftop tests.
2022-01-14 19:45:51 +09:00
Bill Currie
f7181a09b4 [gamecode] Add tests for shiftops
They're in test-unsigned because 2/3 of them are unsigned.
2022-01-12 10:24:59 +09:00
Bill Currie
6229ae8ecc [gamecode] Add tests for unsigned comparisons
And fix the implementation: I had used the wrong macro.
2022-01-11 13:00:54 +09:00