summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_algebraic.py
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-03-25 11:13:40 -0700
committerJason Ekstrand <[email protected]>2016-04-13 15:44:00 -0700
commit745b3d295e0c432b95d43f979c74f9e91baaf6de (patch)
tree00f4c8721eb876bde18f860ebf64c493c59b40a6 /src/compiler/nir/nir_opt_algebraic.py
parentd880c6f9f59dac7cfe33713fff1c09c63ab7fb4f (diff)
nir: Add more modulus opcodes
These are all needed for SPIR-V Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_algebraic.py')
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index ec8929a6d9f..2749b06aa69 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -287,6 +287,7 @@ optimizations = [
# Misc. lowering
(('fmod', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod'),
+ (('frem', a, b), ('fsub', a, ('fmul', b, ('ftrunc', ('fdiv', a, b)))), 'options->lower_fmod'),
(('uadd_carry', a, b), ('b2i', ('ult', ('iadd', a, b), a)), 'options->lower_uadd_carry'),
(('usub_borrow', a, b), ('b2i', ('ult', a, b)), 'options->lower_usub_borrow'),