[x86] add special-case lowering for usubsat for pre-SSE4
authorSanjay Patel <spatel@rotateright.com>
Tue, 19 Oct 2021 21:12:02 +0000 (17:12 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 19 Oct 2021 21:13:16 +0000 (17:13 -0400)
commit92a0389b0425a9535a99a0ce13ba0eeda2bce7ad
treeca3847c21dc0d9c2e10066692ae8da7d6127aab6
parent17386cb4dc89afad62623b9bc08516b99b9c6df7
[x86] add special-case lowering for usubsat for pre-SSE4

usubsat X, SMIN --> (X ^ SMIN) & (X s>> BW-1)

This would be a regression with D112085 where we combine to
usubsat more aggressively, so avoid that by matching the
special-case where we are subtracting SMIN (signmask):
https://alive2.llvm.org/ce/z/4_3gBD

Differential Revision: https://reviews.llvm.org/D112095
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/psubus.ll