Mesa (master): nir/algebraic: Optimize low 32 bit extraction
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Mar 4 23:56:31 UTC 2019
Module: Mesa
Branch: master
Commit: 47ec9bdc604cb91af5acdb8522972ede7872cf71
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=47ec9bdc604cb91af5acdb8522972ede7872cf71
Author: Sagar Ghuge <sagar.ghuge at intel.com>
Date: Mon Feb 25 11:43:53 2019 -0800
nir/algebraic: Optimize low 32 bit extraction
Optimize a situation where we only need lower 32 bits from 64 bit
result.
Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
Suggested-by: Matt Turner <mattst88 at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/compiler/nir/nir_opt_algebraic.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 53cfa94ae93..e8191b72271 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -70,6 +70,8 @@ optimizations = [
(('imul', a, '#b at 32(is_pos_power_of_two)'), ('ishl', a, ('find_lsb', b))),
(('imul', a, '#b at 32(is_neg_power_of_two)'), ('ineg', ('ishl', a, ('find_lsb', ('iabs', b))))),
+ (('unpack_64_2x32_split_x', ('imul_2x32_64(is_used_once)', a, b)), ('imul', a, b)),
+ (('unpack_64_2x32_split_x', ('umul_2x32_64(is_used_once)', a, b)), ('imul', a, b)),
(('imul_2x32_64', a, b), ('pack_64_2x32_split', ('imul', a, b), ('imul_high', a, b)), 'options->lower_mul_2x32_64'),
(('umul_2x32_64', a, b), ('pack_64_2x32_split', ('imul', a, b), ('umul_high', a, b)), 'options->lower_mul_2x32_64'),
(('udiv', a, 1), a),
More information about the mesa-commit
mailing list