On Fri, Mar 22, 2013 at 7:05 PM, Chris Matrakidis <[email protected]>wrote:
> > Do you think that 23 is short for graphics, because we use 24 a lot? The > > thing is, we'll probably never manipulate 24-bit RGB. Instead, ARGB > (four > > 8-bit numbers) is pre-processed in the memory system and converted into > four > > floats, then converted back on the way out. > > Actually I was thinking that with sign extension you cover the cases > of A being 0 or 255 (as well as 1 and 254). > Sure. > > > Hmmm.... do we have a convenient way to flip the sign? > > Well, the LI encoding is now free. However it makes sense to use one > of the unused RR function codes for an FNEG instruction. > > > Or maybe for > > negative numbers, it could be common to sacrifice one bit of precision at > > the bottom end... load a 31-bit immediate, shift left by one, and be done > > with it. > > This is again 2 instructions so I would prefer the FNEG variation. > Good point. One of my students pointed out that FABS can be done by making the sign bit; for instance SHL by 1 followed by LSR by 1. But we can give this one too a special opcode. What other really trivial floating point operations could be basically free by assigning a special opcode and doing some integer op? I just realized, however, that with a zero reg, FNEG is FSUB from R0. :) Well, there might be some trivial energy difference. And one way to implement FABS is to AND with 0x7fffffff. Another way would be to generate FSUB from R0, where we in some non-stupid way combine the predicate value with the sign bit. > > > Best Regards, > > Chris Matrakidis > -- Timothy Normand Miller, PhD Assistant Professor of Computer Science, Binghamton University http://www.cs.binghamton.edu/~millerti/ Open Graphics Project
_______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
