This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix vector equality comparison for v2i64 pre-Power8
ClosedPublic

Authored by nemanjai on Dec 13 2021, 2:22 PM.

Details

Summary

The current code makes the assumption that equality comparison can be performed with a word comparison instruction. While this is true if the entire 64-bit results are used, it does not generally work. It is possible that the low order words and high order words produce different results and a user of only one will get the wrong result.

This patch adds an and of the result words so that each word has the result of the comparison of the entire doubleword that contains it.

Diff Detail

Event Timeline

nemanjai created this revision.Dec 13 2021, 2:22 PM
nemanjai requested review of this revision.Dec 13 2021, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2021, 2:22 PM
bmahjour accepted this revision.Dec 14 2021, 1:23 PM

Shall we also add a test for -mcpu=pwr8 to make sure vcmpequd is used?

LGTM otherwise.

This revision is now accepted and ready to land.Dec 14 2021, 1:23 PM

Shall we also add a test for -mcpu=pwr8 to make sure vcmpequd is used?

LGTM otherwise.

That's a good idea. I'll add it on the commit. Thank you.

This revision was landed with ongoing or failed builds.Dec 21 2021, 12:29 PM
This revision was automatically updated to reflect the committed changes.