https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103973

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Perhaps add a new starship<mode>3 optab for it and pattern recognize it in
gimple_isel?  Though that would most likely handle just the 0, -1, 1, 2 case
that <=> emits and not say other constants that one could get e.g. with the
(much less likely):
#include <compare>
int cmp4way(double a, double b)
{
    auto c = a <=> b;
    if (c == std::partial_ordering::equivalent) return 42;
    if (c == std::partial_ordering::less) return 137;
    if (c == std::partial_ordering::unordered) return -35;
    return 139;
}

Reply via email to