[PATCH][x86 inline-asm] Fix printing of register operands with q modifier

Eric Christopher echristo at gmail.com
Fri Mar 28 15:52:27 PDT 2014


Thanks for the fix.

LGTM.

-eric

On Fri, Mar 28, 2014 at 11:58 AM, Akira Hatanaka <ahatanak at gmail.com> wrote:
> The attached patch changes the behavior of function printAsmMRegister to
> emit 32-bit register names instead of 64-bit register names if the target
> does not have 64-bit general purpose registers.
>
> This is what gcc apparently does and some of the open source libraries seem
> to rely on this behavior.
>
> ToT clang complains when it tries to compile the following code:
>
> $ cat inline-asm-modifier-q.c
> void q_modifier(int *p) {
>   asm ("movq (%q0, %%ebx, 4), %%mm0" : : "r" (p));
> }
>
> $ clang -m32 -c inline-asm-modifier-q.c
> inline-asm-modifier-q.c:2:8: error: register %rax is only available in
> 64-bit
>       mode
>   asm ("movq (%q0, %%ebx, 4), %%mm0" : : "r" (p));
>        ^
> <inline asm>:1:8: note: instantiated into assembly here
>         movq (%rax, %ebx, 4), %mm0
>               ^~~~~
>
> Please review.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list