intel/eu: Rework opcode description tables to allow efficient look-up by either HW...
[mesa.git] / src / intel / compiler / brw_nir_trig_workarounds.py
index 3d08b9a41ea13697e849f19ba4112f41e8034783..dddadc71da2a709cb5624f867191a1b3e46d36f4 100644 (file)
 # amplitude slightly.  Apparently this also minimizes the error function,
 # reducing the maximum error from 0.00006 to about 0.00003.
 
+from __future__ import print_function
+
 import argparse
 import sys
 
 TRIG_WORKAROUNDS = [
-    (('fsin', 'x'), ('fmul', ('fsin', 'x'), 0.99997)),
-    (('fcos', 'x'), ('fmul', ('fcos', 'x'), 0.99997)),
+    (('fsin', 'x(is_not_const)'), ('fmul', ('fsin', 'x'), 0.99997)),
+    (('fcos', 'x(is_not_const)'), ('fmul', ('fcos', 'x'), 0.99997)),
 ]
 
 
@@ -51,9 +53,9 @@ def main():
 def run():
     import nir_algebraic  # pylint: disable=import-error
 
-    print '#include "brw_nir.h"'
-    print nir_algebraic.AlgebraicPass("brw_nir_apply_trig_workarounds",
-                                      TRIG_WORKAROUNDS).render()
+    print('#include "brw_nir.h"')
+    print(nir_algebraic.AlgebraicPass("brw_nir_apply_trig_workarounds",
+                                      TRIG_WORKAROUNDS).render())
 
 
 if __name__ == '__main__':