Monday, July 19, 2010

R300 Presubtract

The last week I've been trying to get presubtract operations working for the r300 compiler. Presubtract operations are basically "free" instructions that modify source values before the are sent to the ALU. The four presubtract operations for r300 cards are (1 - src0), (src1 + src0), (src1 - src0), and (1 - 2 * src0). At this point the compiler only uses (1 - src0), but now that I have one working adding the others shouldn't be too hard. I had to make some major changes to the compiler to get this working, so I am going to let it sit in its own branch (presub branch at and test it out for a while before I merge it into the the master branch.


  1. What's the difference between the middle two operations, i.e. the ones you described as (src1 + src0) and (src1 + src0)?

  2. Oops, that second one should be (src1 - src0).