DavidPH / GDCC

Game Data Compiler Collection
Other
39 stars 7 forks source link

Fixed-point promotion #46

Open DavidPH opened 5 years ago

DavidPH commented 5 years ago

Operations mixing fixed-point and integer types convert their operands to the promoted type before the operation. For addition and subtraction, this is fine, but multiplication and division with fract types is almost impossible. Therefore, conversion should happen after the operation for multiplication and division. This will make fract types much more useful as well as optimize accum-integer operations.