http://llvm.org/bugs/show_bug.cgi?id=15765
Bug ID: 15765
Summary: inline assembly and =g constraint on output argument
Product: new-bugs
Version: 3.2
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
In emscripten, we support having JS as "inline assembly" (it makes perfect
sense in context).
With a very simple program:
double get() {
double ret = 0;
__asm __volatile__("12/3.3":"=r"(ret));
return ret;
}
int main() {
return (int)get();
}
And compiling it:
/usr/local/bin/clang -target i386-pc-linux-gnu -emit-llvm -S -o m-r.ll
test.c
the inline asm compiles to:
%0 = call double asm sideeffect "12/3.3",
"=r,~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0
However, changing it to a =g constraint instead of =r results in this:
call void asm sideeffect "12/3.3",
"=*imr,~{dirflag},~{fpsr},~{flags}"(double* %ret) nounwind, !srcloc !0
This shows that it isn't picking up the value into ret.
Is =g permissible here or must I use =r?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs