https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116896
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think it wouldn't be that hard to change optimize_spaceship to also handle integer comparisons, just change that !SCALAR_FLOAT_TYPE_P (TREE_TYPE (arg1)) to that || INTEGRAL_TYPE_P (TREE_TYPE (arg1)) and add the optab to targets where it is a win. The important question is what is the optimal sequence...