This is an archive of the discontinued LLVM Phabricator instance.

[X86 Codegen] PACKUS can't be used for unsigned saturation
ClosedPublic

Authored by delena on Jan 26 2017, 1:07 PM.

Details

Summary

PACKUSWB converts Signed word to Unsigned byte, (the same about DW) and it can't be used for umin+truncate pattern.
AVX-512 VPMOVUS* instructions fit the pattern since they convert Unsigned to Unsigned.

See https://llvm.org/bugs/show_bug.cgi?id=31773

Diff Detail

Repository
rL LLVM

Event Timeline

delena created this revision.Jan 26 2017, 1:07 PM
zvi edited edge metadata.Jan 29 2017, 4:01 AM

Other than the comment about the deleted test cases, LGTM

../test/CodeGen/X86/avx-trunc.ll
43

I suggest you move these deleted functions to a separate file name pr#.ll with CHECK-NOT's

delena updated this revision to Diff 86214.Jan 29 2017, 4:19 AM

Added a test case with "check-not" to prevent this error in the future.

zvi accepted this revision.Jan 29 2017, 4:38 AM

Thanks, Elena. LGTM

This revision is now accepted and ready to land.Jan 29 2017, 4:38 AM
This revision was automatically updated to reflect the committed changes.