3 ms·
"SIMD Within A Register" I think the implication is that you can pack multiple items into an ordinary register and effectively get SIMD even if you aren't usin
by singron 2y ago
"SIMD Within A Register"
I think the implication is that you can pack multiple items into an ordinary register and effectively get SIMD even if you aren't using explicit SIMD instructions. E.g. if you pack a 31 and 32 bit number into a 64 bit register (you need 1 spare for a carry bit), you can do 2 adds with a single 64-bit add.
Games have used these tricks for graphics to pack RGB(A) values into 32 bit integers. E.g. this code from scummvm interpolates 2 16-bit RGB pixels (6 total components) packed into a 32-bit value. https://github.com/scummvm/scummvm/blob/master/graphics/scaler/intern.h https://github.com/scummvm/scummvm/blob/master/graphics/scal...