This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics to Clang .
ClosedPublic

Authored by m_zuckerman on Oct 26 2016, 7:31 AM.

Details

Summary

Vector-reduction arithmetic accepts vectors as inputs and produces scalars as outputs.
This class of vector operation forms the basis of many scientific computations.
In vector-reduction arithmetic, the evaluation off is independent of the order of the input elements of V.

Diff Detail

Event Timeline

m_zuckerman retitled this revision from to [X86][AVX512][Clang][Intrinsics][reduce] Adding missing reduce (max|min) intrinsics to Clang . .
m_zuckerman updated this object.
craig.topper added inline comments.Oct 26 2016, 9:28 PM
lib/Headers/avx512fintrin.h
344

Do we really need these new set1 macros? The epi ones should be fine shouldn't they?

9942

long long

9947

long long

9957

long long

9962

long long

9979

intialize is misspelled, but even then I don't think this sentence reads right.

9985

Use uppercase 0xFFF.... to match the constants below.

9996

Can we just call the set1 macro outside and pass the result in for Neutral instead of needing T4.

10015

Use uppercase for consistency.

10018

long long

10024

long long

10088

Do these 512-bit shuffles get narrowed to 256-bit and 128-bit ops for the later stages due to the high bit undefs or do we end up doing 512-bit operations all the way through?

m_zuckerman marked 8 inline comments as done.
m_zuckerman added inline comments.Oct 27 2016, 12:51 PM
lib/Headers/avx512fintrin.h
10088

It will stay all the way 512. This intrinsics only defined on avx512F, and because of that, we can only use the 512bit intrinsics version of the max and min intrinsics.

craig.topper accepted this revision.Oct 28 2016, 9:39 PM
craig.topper edited edge metadata.

LGTM with that 1 comment.

lib/Headers/avx512fintrin.h
10046

extra space after the 4th -1

This revision is now accepted and ready to land.Oct 28 2016, 9:39 PM
This revision was automatically updated to reflect the committed changes.