From 5420b739253c73875a532f40216b601618ec04e8 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Mon, 8 Jul 2024 12:38:46 +0200 Subject: [PATCH] bi: Lower pack_32_4x8_split and pack_32_2x16_split in algebraic Required for OpenCL. Signed-off-by: Mary Guillemard Reviewed by: Eric R. Smith Part-of: --- src/panfrost/compiler/bifrost_nir_algebraic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/panfrost/compiler/bifrost_nir_algebraic.py b/src/panfrost/compiler/bifrost_nir_algebraic.py index 6102ea768d9..366a7ca34c2 100644 --- a/src/panfrost/compiler/bifrost_nir_algebraic.py +++ b/src/panfrost/compiler/bifrost_nir_algebraic.py @@ -27,6 +27,7 @@ import math a = 'a' b = 'b' c = 'c' +d = 'd' # In general, bcsel is cheaper than bitwise arithmetic on Mali. On # Bifrost, we can implement bcsel as either CSEL or MUX to schedule to either @@ -43,6 +44,10 @@ opt_bool_bitwise = [ ] algebraic_late = [ + (('pack_32_4x8_split', a, b, c, d), + ('pack_32_2x16_split', ('ior', ('u2u16', a), ('ishl', ('u2u16', b), 8)), + ('ior', ('u2u16', c), ('ishl', ('u2u16', d), 8)))), + # Canonical form. The scheduler will convert back if it makes sense. (('fmul', a, 2.0), ('fadd', a, a)),