https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126647
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We can add into genmatch support to handle :c on cond and vec_cond which would
only work when the first operand is an actual tcc_comparison (not simply @0).
(cond:c (cmp @0 @1) @true @false)
would expand to
(cond (cmp @0 @1) @true @false)
(cond (inverted_cmp @0 @1) @false @true)
not that similar to (cmp:c ...) handling it gets a bit tricky what you
assign to 'cmp' when it's a for ID (the inverted code) and which operand
the captures capture.
Now, consider
(cond:c (cmp:c @0 @1) @true @false)
Of course the tricky bit is that comparison inversion depends on FP flags,
so we'd need to lower/code-generate the
(for cmp (tcc_comparison)
icmp (inverted_tcc_comparison)
...
(if (invert_tree_comparison (cmp, HONOR_NANS (@01)) == icmp)
trick, aka record the original non-inverted code and add a runtime guard.