On 27/03/13 01:45, Chris Matrakidis wrote:
I also wonder about how we load a 32-bit constant.
This is what the LL instruction is for (described in the end of the
latest ISA document). It loads a 31 bit constant to R1. Then either
the constant can be moved to another register (if positive) or
subtracted from 0 (R0) if negative. The only problem is with loading
80000000h (or float -0). FSUB cannot be used because it gives +0,
which is why a FNEG (or FCHS) instruction is required after all. Which
as you say can be implemented with a generic bit toggle instruction.
31 bit constants are not useful for a GPU, where the most common use
would be masking or adding with a 32 bit RGBA value. Nor would it be
any use for doing crypto work where you want to do logic ops on all
32 bits.
I suggest sticking with 16 bit immediates which handles most loop
or pointer increments, most PC-relative jumps, most struct offsets,
etc. For 32 bit, load from memory.
--
Hugh Fisher
CECS, ANU
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)