I wanted to reuse this from v3d.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/** enables rules to lower idiv by power-of-two: */
bool lower_idiv;
+ /** enables rules to lower isign to imin+imax */
+ bool lower_isign;
+
/* Does the native fdot instruction replicate its result for four
* components? If so, then opt_algebraic_late will turn all fdotN
* instructions into fdot_replicatedN instructions.
('extract_i8', 'v', 3))),
127.0))),
'options->lower_unpack_snorm_4x8'),
+
+ (('isign', a), ('imin', ('imax', a, -1), 1), 'options->lower_isign'),
]
invert = OrderedDict([('feq', 'fne'), ('fne', 'feq'), ('fge', 'flt'), ('flt', 'fge')])
.lower_fmod64 = true,
.lower_fdiv = true,
.lower_idiv = true,
+ .lower_isign = true,
.vertex_id_zero_based = true,
.lower_extract_byte = true,
algebraic = [
(('b2i32', a), ('iand@32', "a@32", 1)),
- (('isign', a), ('imin', ('imax', a, -1), 1)),
(('fge', a, b), ('flt', b, a)),
# XXX: We have hw ops for this, just unknown atm..