This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Use (V)PHMINPOSUW for vXi8 SMAX/SMIN/UMAX/UMIN horizontal reductions (PR32841)
ClosedPublic

Authored by RKSimon on Dec 15 2017, 8:34 AM.

Details

Summary

Extension to D39729 which performed this for vXi16, with the same bit flipping to handle SMAX/SMIN/UMAX cases, vXi8 UMIN horizontal reductions can be performed.

This makes use of the fact that by performing a pair-wise i8 SHUFFLE_UMIN before PHMINPOSUW, we both get the UMIN of each pair but also zero-extend the upper bits ready for v8i16.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Dec 15 2017, 8:34 AM
craig.topper added inline comments.Dec 16 2017, 10:50 PM
lib/Target/X86/X86ISelLowering.cpp
30494 ↗(On Diff #127138)

Shouldn't this just be getSizeInBits()? It's already scalar.

RKSimon updated this revision to Diff 127314.Dec 18 2017, 2:48 AM

Use getSizeInBits instead of getScalarSizeInBits for a known scalar

This revision is now accepted and ready to land.Dec 18 2017, 1:27 PM
This revision was automatically updated to reflect the committed changes.