This is an archive of the discontinued LLVM Phabricator instance.

[x86][inline-asm][clang]Amend size directive deduction mechanism of unsized memory operands
AbandonedPublic

Authored by coby on Apr 28 2017, 12:19 AM.

Details

Summary

This is an extension of the work being carried by the following change:
https://reviews.llvm.org/D26586
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 based on the possible matches:
"vaddps xmm1, xmm2, [a]" matches only “XMMWORD PTR” qualifier.
"vaddps xmm1, xmm2, [a]{1to4}" matches only “DWORD PTR” qualifier.
"mov rax, [a]" matches only "QWORD PTR"

Currently, size directive will be deduced based on the size of the memory operand (apart from those cases which were handled by D26586).
For example:
"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 can be found here:
https://reviews.llvm.org/D32636

Diff Detail

Repository
rL LLVM

Event Timeline

coby created this revision.Apr 28 2017, 12:19 AM
coby abandoned this revision.Jun 26 2017, 6:26 AM

superseded by rL302179