> You COULD get the direction out of the sign bit of the shift amount, > but compilers aren't used to this,
Most compilers don't care. For constant shifts it's a trivial encoding change. For variable shifts it's a fairly easy to cope with (efficiency depends how easy it is to generate the negated value). Logical vs. arithmetic shifts probably are useful. I'm not sure how easy it is to implement in hardware, but if we're using the cpu to do VGA format conversion it might be useful to have some sort of bitfield extraction/insertion or bit shuffling instruction, similar to ppc rlwnim. > Since any register can be specified as either operand, there's almost > no benefit in having a way to subtract with the operand order > reverse... just reverse them in the code. (Except for one case > involving an immediate.) We do need separate ADD and SUB opcodes. > Also, making one an even number and the other odd helps, because we > can route the low bit of the opcode into the addsub to set its > direction. Swapping the operands allows you to implement const - reg in a single instruction. In particular 0 - reg to negate a value. reg - const you have anyway because the immediate value is signed. Paul _______________________________________________ Open-graphics mailing list [email protected] http://lists.duskglow.com/mailman/listinfo/open-graphics List service provided by Duskglow Consulting, LLC (www.duskglow.com)
