This is an archive of the discontinued LLVM Phabricator instance.

[AVX512][inline-asm] Fix AVX512 inline assembly instruction resolution when the size qualifier of a memory operand is not specified explicitly.
AbandonedPublic

Authored by coby on Nov 13 2016, 5:54 AM.

Details

Summary

This commit handles cases where the size qualifier of an indirect memory reference operand in Intel syntax is missing (e.g. "vaddps xmm1, xmm2, [a]").

GCC will deduce the size qualifier for AVX512 vector and broadcast memory operands based on the possible matches:
"vaddps xmm1, xmm2, [a]" matches only “XMMWORD PTR” qualifier.
"vaddps xmm1, xmm2, [a]{1to4}" matches only “DWORD PTR” qualifier.

This is different from the current behavior of LLVM, which deduces the size qualifier based on the size of the memory operand.
For "vaddps xmm1, xmm2, [a]"
"char a;" will imply "BYTE PTR" qualifier
"short a;" will imply "WORD PTR" qualifier.

This commit aligns LLVM to GCC’s behavior.

This is the clang part of the review.
The llvm part of the review: https://reviews.llvm.org/D26586

Differential Revision: https://reviews.llvm.org/D26587

Diff Detail

Repository
rL LLVM

Event Timeline

coby updated this revision to Diff 77741.Nov 13 2016, 5:54 AM
coby retitled this revision from to [X86][AVX512][InlineASM][MS][clang] (I|G)CC Memory adjustments compatibility.
coby updated this object.
coby added reviewers: m_zuckerman, rnk, myatsina.
coby set the repository for this revision to rL LLVM.
coby added a subscriber: cfe-commits.
coby updated this revision to Diff 78681.Nov 20 2016, 5:00 PM
coby updated this object.Nov 21 2016, 6:52 AM
coby retitled this revision from [X86][AVX512][InlineASM][MS][clang] (I|G)CC Memory adjustments compatibility to [AVX512][inline-asm] Fix AVX512 inline assembly instruction resolution when the size qualifier of a memory operand is not specified explicitly..Nov 22 2016, 12:53 AM
coby updated this object.
coby updated this object.
myatsina accepted this revision.Nov 23 2016, 1:31 AM
myatsina edited edge metadata.

LGTM

Please emphasize in you commit message that this the test case for the llvm commit (and even better if you add the commit number of the llvm commit),

This revision is now accepted and ready to land.Nov 23 2016, 1:31 AM
coby abandoned this revision.Jul 23 2017, 6:26 AM

superseded by rL302179