On Tue, 26 Apr 2016, Richard Biener wrote:
By the way, it would be cool to be able to write:
(lt:c @0 @1)
which would expand to both
(lt @0 @1)
(gt @1 @0)
(as per swap_tree_comparison or swapped_tcc_comparison)
Yeah, I know... I was hesitant to overload :c with "slightly" different
semantics though.
I can give it a shot though - it would avoid quite some repetition I guess.
Being able to write (lt:c @0 @1) is easy, see attached (didn't check
if it works),
but being able to write
(for cmp (lt gt)
(cmp:c @0 @1)
is harder (see FIXME), you'd have to create a new for at the nesting
level of the
old with the operator list adjusted. Not impossible, of course.
Includes some verification I added locally at some point (which also exposed we
use :c on non-commutative tree codes, thus the new :C ...).
Ah, I was hoping it would be as simple as adding op=commuted_op(op) at the
place where the regular commutation gets lowered. If it is significantly
more complicated, I guess it isn't that urgent...
--
Marc Glisse