> 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.

You probably missed the discussion on floating point constants last week.

> 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.

However, loading from memory is slow, and using 16 bits constants you
need three instructions to load a 32 bit constant (load, shift and
or), where with 31 bit constants you can load any constant in one or
two instructions.


Best Regards,

Chris Matrakidis

PS. I was wrong earlier: you can make 80000000h in two instructions
with the current instruction set: load 40000000h and add it to itself
or load 7fffffffh and invert it.
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to