This is an archive of the discontinued LLVM Phabricator instance.

[X86] Bugfix on check function of _mm_mmask_i64gather_epi32 and _mm_mmask_i64gather_ps for rL349334
ClosedPublic

Authored by FreddyYe on Apr 30 2020, 1:51 AM.

Details

Summary

_mm_mmask_i64gather_epi32 and _mm_mmask_i64gather_ps operates the lower 64 bits and zeroes the higher 64 bits of the return value . Old version steps 64 bits in the do_intrin_ loop, which will overlap higher 64 bits of the last iteration. This is a wrong usage of the intrin. Especially when compiler malloc dst128_f and mask128 's address adjacent, this test will run fail, happenning in LLVM HEAD. So I modified the loop step into 128 bits, and add a new check function to check these two intrins (failed to find similar check function other tests).

Diff Detail

Event Timeline

FreddyYe created this revision.Apr 30 2020, 1:51 AM
craig.topper added inline comments.May 2 2020, 12:00 AM
SingleSource/UnitTests/Vector/AVX512VL/i64gather_32.c
54

I wonder if it would be better to change to a 64-bit store _mm_storel_epi64 instead?

FreddyYe marked an inline comment as done.May 5 2020, 11:44 PM
FreddyYe added inline comments.
SingleSource/UnitTests/Vector/AVX512VL/i64gather_32.c
54

I'm confused on this, too. A 64-bit store is disable to verify the higher 64 bits of the return value (even if they are zero). I think it depends on the original design purpose of this test suite.

craig.topper accepted this revision.May 6 2020, 12:09 AM

LGTM

SingleSource/UnitTests/Vector/AVX512VL/i64gather_32.c
54

Ok, then what you've done here seems fine.

This revision is now accepted and ready to land.May 6 2020, 12:09 AM