[LLVMdev] inline asm question

Eli Friedman eli.friedman at gmail.com
Sun Aug 2 18:23:29 PDT 2009


2009/8/2 Richard Pennington <rich at pennware.com>:
> The following fails on x86_64 because of the output constraint '0'.
> My question is, is this legal. LLVM complains about the size difference
> (32 vs 64), but it is the same register (ax).
> Works on x86.
>
> %42 = call i64 asm sideeffect "syscall\0A\09",
> "={ax},0,{di},~{dirflag},~{fpsr},~{flags}"(i64 231, i64 %41) nounwind
>          ; <i64> [#uses=2]
>
> -Rich

Can you give a complete testcase?  Running the following through
"llvm-as | llc -march=x86-64" works just fine:
define void @a() {
call i64 asm sideeffect "syscall\0A\09",
"={ax},0,{di},~{dirflag},~{fpsr},~{flags}"(i64 231, i64 123) nounwind
ret void
}

-Eli




More information about the llvm-dev mailing list