Saturday, 10 August 2013

VM - reducing number of instructions for different types?

VM - reducing number of instructions for different types?

I am developing an experimental VM, and right now I have a separate
instruction for all datatype operations for each and every type, just to
be safe. E.g. I have an ADD instruction for 8, 16, 32 and 64 bit signed
and unsigned integers, as well as for float, double and long double.
That's 11 instructions for one operation. Now it is true that some
operations support only certain types, but even so, I end up with a lot of
instructions and very little head room.
So I am wondering if some instructions can operate regardless of the
underneath type, so I can cut the number and make room for more
instructions that I'll be in desperate need of in the future, since I
don't want to exceed a byte for the instruction.

No comments:

Post a Comment