inline asm question

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

Eli Friedman wrote:

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
}

Sorry Eli, I copied from a version that I got to pass.
The original was
call i64 asm sideeffect "syscall\0A\09",
"={ax},0,{di},~{dirflag},~{fpsr},~{flags}"(i32 231, i64 123) nounwind
ret void}

The return value(in ax) is i64. The first input arg (in ax) is i32.

Not sure how to deal with that,

-Rich

We've decided that this is invalid; if the front-end wants to deal
with such constructs, it's supposed to deal with them itself. See
http://llvm.org/bugs/show_bug.cgi?id=3373.

-Eli

Eli Friedman wrote: