pan/mdg: Treat inot as a modifier
[mesa.git] / src / panfrost / midgard / midgard_nir_algebraic.py
index d7eceeba869794e05a022f332b8ab9c82161a5bb..8dc72bcf561b2e7d4b98dde4066ec05bcd079571 100644 (file)
@@ -113,6 +113,11 @@ constant_switch = [
         (('ult32', '#a', 'b'), ('inot', ('uge32', a, b)))
 ]
 
+# ..since the above switching happens after algebraic stuff is done
+cancel_inot = [
+        (('inot', ('inot', a)), a)
+]
+
 # Midgard scales fsin/fcos arguments by pi.
 # Pass must be run only once, after the main loop
 
@@ -140,6 +145,9 @@ def run():
     print(nir_algebraic.AlgebraicPass("midgard_nir_scale_trig",
                                       scale_trig).render())
 
+    print(nir_algebraic.AlgebraicPass("midgard_nir_cancel_inot",
+                                      cancel_inot).render())
+
 
 if __name__ == '__main__':
     main()