do {
progress = false;
- NIR_PASS(progress, nir, midgard_nir_lower_algebraic);
NIR_PASS(progress, nir, nir_lower_var_copies);
NIR_PASS(progress, nir, nir_lower_vars_to_ssa);
.lower_fpow = true,
.lower_find_lsb = true,
+ /* TODO: We have native ops to help here, which we'll want to look into
+ * eventually */
+ .lower_fsign = true,
+
.vertex_id_zero_based = true,
.lower_extract_byte = true,
.lower_extract_word = true,
a = 'a'
b = 'b'
-algebraic = [
- # XXX: We have hw ops for this, just unknown atm..
- #(('fsign@32', a), ('i2f32@32', ('isign', ('f2i32@32', ('fmul', a, 0x43800000)))))
- #(('fsign', a), ('fcsel', ('fge', a, 0), 1.0, ('fcsel', ('flt', a, 0.0), -1.0, 0.0)))
- (('fsign', a), ('bcsel', ('fge', a, 0), 1.0, -1.0)),
-]
-
algebraic_late = [
# ineg must be lowered late, but only for integers; floats will try to
# have modifiers attached... hence why this has to be here rather than
import nir_algebraic # pylint: disable=import-error
print('#include "midgard_nir.h"')
- print(nir_algebraic.AlgebraicPass("midgard_nir_lower_algebraic",
- algebraic).render())
print(nir_algebraic.AlgebraicPass("midgard_nir_lower_algebraic_late",
algebraic_late).render())