*/
bool lower_hadd64;
+ /**
+ * Set if nir_op_add_sat and nir_op_usub_sat should be lowered to simple
+ * arithmetic.
+ *
+ * If this flag is set, the lowering will be applied to all bit-sizes of
+ * these instructions.
+ *
+ * \sa ::lower_usub_sat64
+ */
bool lower_add_sat;
+ /**
+ * Set if only 64-bit nir_op_usub_sat should be lowered to simple
+ * arithmetic.
+ *
+ * \sa ::lower_add_sat
+ */
+ bool lower_usub_sat64;
+
/**
* Should IO be re-vectorized? Some scalar ISAs still operate on vec4's
* for IO purposes and would prefer loads/stores be vectorized.
(('uadd_sat', a, b), ('bcsel', ('ult', ('iadd', a, b), a), -1, ('iadd', a, b)), 'options->lower_add_sat'),
(('usub_sat', a, b), ('bcsel', ('ult', a, b), 0, ('isub', a, b)), 'options->lower_add_sat'),
+ (('usub_sat@64', a, b), ('bcsel', ('ult', a, b), 0, ('isub', a, b)), 'options->lower_usub_sat64 || (options->lower_int64_options & nir_lower_iadd64) != 0'),
# Alternative lowering that doesn't rely on bfi.
(('bitfield_insert', 'base', 'insert', 'offset', 'bits'),