On 6/17/21 4:48 AM, Matteo Bruni wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Sorry for the delay, I totally missed this patch series... /me updates his email filtering rules
We should probably get rid of HLSL_IR_BINOP_SUB at some point: HLSL_IR_BINOP_ADD + HLSL_IR_UNOP_NEG does the same thing at least as well and it's one less case to handle in a number of places. Also on the output side, there is no corresponding SM4+ instruction and IIRC the native compiler doesn't generate SUB instructions for SM1 either.
I actually had an SM4-specific lowering pass for that already, but I figured as long as there's a SUB instruction for SM1 there's no reason not to use it...
Turns out you're right, though, it uses add + negative modifier. Guess that's one more instruction we could remove at parse time.