This is an archive of the discontinued LLVM Phabricator instance.

[X86][AVX512] lowering kunpack intrinsic - clang part
ClosedPublic

Authored by jina.nahias on Nov 7 2017, 1:29 AM.

Diff Detail

Event Timeline

jina.nahias created this revision.Nov 7 2017, 1:29 AM
jina.nahias edited the summary of this revision. (Show Details)Nov 7 2017, 1:31 AM
RKSimon added inline comments.Nov 7 2017, 5:10 AM
lib/Headers/avx512bwintrin.h
1857

Is this right? The Intel docs says it should be:

k[31:0] := a[31:0]
k[63:32] := b[31:0]
k[MAX:64] := 0

Also, is the cast on __A necessary?

Same for the others.

jina.nahias added inline comments.
lib/Headers/avx512bwintrin.h
1857

you are right, i fixed it.

craig.topper added inline comments.Nov 7 2017, 9:07 PM
test/CodeGen/avx512f-builtins.c
6231

Does this really produce kunpackb in the backend? The type promotion here makes me skeptic

6235

Please add some line breaks to this.

jina.nahias added inline comments.Nov 12 2017, 11:45 PM
test/CodeGen/avx512f-builtins.c
6231

yes,
the code we get:
vpcmpneqd %zmm1, %zmm0, %k0
vpcmpneqd %zmm3, %zmm2, %k1
kunpckbw %k1, %k0, %k1
vpcmpneqd %zmm5, %zmm4, %k0 {%k1}
kmovd %k0, %eax

  1. kill: %AX<def> %AX<kill> %EAX<kill>

vzeroupper

lsaba accepted this revision.Dec 5 2017, 5:17 AM
This revision is now accepted and ready to land.Dec 5 2017, 5:17 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.