This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Strange arithmetic performance on G76 with/without explicit mad()

Hi!

I've recently encountered a peculiar behaviour regarding explicit mad() in a fragment shader. We compile shaders using DXC.

The line in question is 

when changing the code to  

all shaders that use the code become slower.

When running SPIR-V through malioc:

1. I see that 

becomes 

2. There are now two new decorations for related registers:

I was under the impression that manually using mad() could be more beneficial since it would be a direct hint to the compiler/driver about our intentions. But, it looks like even the DXC compiler avoids explicit FMAs. Performance loss and ALU cost increase is observed in shader variants with either explicit half precision types or RelaxedOps.

0