add Q14x2 type to SkVM
This is a 32-bit pair of Q14 (signed 1.14 fixed point) values.
Q14 * Q14 is (x*y + 0x2000)>>14 but we'll do it as
((x*y + 0x4000)>>15)<<1 to allow use of vpmulhrsw.
Somewhat awkwardly this approximate math does not preserve x*1.0 == x,
e.g. 0x0001 * 0x4000 = 0x0002, not 0x0001. I'm unsure if we'll care.
x*0.0 == 0.0 does always hold, and 1.0*1.0 == 1.0.
Most other operations are normal 16-bit operations.
- implmement in interpreter
- unit test
- constant propgation and strength reduction
- implement in JIT
- effect/blitter hooks enough to demo
- thorough effect/blitter support
Reviewed-by: Mike Reed <email@example.com>
Commit-Queue: Mike Klein <firstname.lastname@example.org>
3 files changed