diff gen/asmstmt.cpp @ 954:e048e36bc155

Added support for using a temporary to implement emulated ABI return from inline asm, could be easier to use, but I think this will do. It's so extremely target dependent in any case that doing a completely generic approach seems hard.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sat, 14 Feb 2009 15:25:48 +0100
parents 03d7c4aac654
children 7e669954db7d
line wrap: on
line diff
--- a/gen/asmstmt.cpp	Fri Feb 13 22:20:30 2009 +0100
+++ b/gen/asmstmt.cpp	Sat Feb 14 15:25:48 2009 +0100
@@ -629,7 +629,7 @@
         }
         remap_inargs(a->code, inn+a->out.size(), asmIdx);
         if (!code.empty())
-            code += " ; ";
+            code += "\n\t";
         code += a->code;
     }
     asmblock->s.clear();
@@ -671,8 +671,13 @@
     args.insert(args.end(), outargs.begin(), outargs.end());
     args.insert(args.end(), inargs.begin(), inargs.end());
     llvm::CallInst* call = p->ir->CreateCall(ia, args.begin(), args.end(), "");
+
+    // capture abi return value
     if (useabiret)
     {
+        if (p->asmBlock->retemu)
+        p->asmBlock->asmBlock->abiret = DtoLoad(p->asmBlock->asmBlock->abiret);
+        else
         p->asmBlock->asmBlock->abiret = call;
     }