M
Morten Aune Lyrstad
Hi there! I'm in the process of writing a virtual machine for my script
language, and I'm trying to determine the best way of handling operations on
different types of data. My language supports floats, ints, and unsigned
ints for numerical data. I have implemented the basic "assembly-ish" version
of the language, but I can't seem to make up my mind on how to do numerical
operations, like comparisons and mathematical functions. Should I have
separate opcodes for each datatype (like iadd, uadd, fadd for ints, uints
and floats) or should I have a single operation for all types and let C++
handle the type conversions? This vm will be used in my games, so it needs
to be fast.
Any thoughts? And perhaps any other general recommendations when it comes to
writing a vm?
Help will be very appreciated.
Yours,
Morten Aune Lyrstad
language, and I'm trying to determine the best way of handling operations on
different types of data. My language supports floats, ints, and unsigned
ints for numerical data. I have implemented the basic "assembly-ish" version
of the language, but I can't seem to make up my mind on how to do numerical
operations, like comparisons and mathematical functions. Should I have
separate opcodes for each datatype (like iadd, uadd, fadd for ints, uints
and floats) or should I have a single operation for all types and let C++
handle the type conversions? This vm will be used in my games, so it needs
to be fast.
Any thoughts? And perhaps any other general recommendations when it comes to
writing a vm?
Help will be very appreciated.
Yours,
Morten Aune Lyrstad