Reverted some changes in the Tango patch, splitting asm block is simply not supported by llvm.

This commit is contained in:
Tomas Lindquist Olsen
2008-08-24 16:51:17 +02:00
parent fa6f277bdd
commit b41a80cefc
2 changed files with 54 additions and 32 deletions

View File

@@ -177,6 +177,9 @@ AsmStatement::toIR(IRState * irs)
Logger::println("AsmStatement::toIR(): %s", loc.toChars());
LOG_SCOPE;
// sanity check
assert(irs->func()->decl->inlineAsm);
// get asm block
IRAsmBlock* asmblock = irs->asmBlock;
assert(asmblock);

View File

@@ -88,33 +88,54 @@ Index: lib/common/tango/core/Thread.d
===================================================================
--- lib/common/tango/core/Thread.d (revision 3899)
+++ lib/common/tango/core/Thread.d (working copy)
@@ -255,6 +255,10 @@
@@ -244,8 +244,30 @@
}
body
{
- version( D_InlineAsm_X86 )
+ version( LLVMDC)
{
__builtin_unwind_init();
}
+ else version( LLVMDC )
+ {
+ pragma(msg, "don't know how to push registers on the stack for this architecture with LLVMDC");
+ version(X86)
+ {
+ uint eax,ecx,edx,ebx,ebp,esi,edi;
+ asm
+ {
+ //pushad ;
+ mov eax[EBP], EAX ;
+ mov ecx[EBP], ECX ;
+ mov edx[EBP], EDX ;
+ mov ebx[EBP], EBX ;
+ mov ebp[EBP], EBP ;
+ mov esi[EBP], ESI ;
+ mov edi[EBP], EDI ;
+ }
+ }
+ else
+ {
+ static assert( false, "Architecture not supported." );
+ }
+ }
else
{
static assert( false, "Architecture not supported." );
@@ -308,6 +312,10 @@
{
// registers will be popped automatically
}
+ else version( LLVMDC )
+ else version( D_InlineAsm_X86 )
+ {
+ // TODO
asm
{
pushad;
@@ -297,6 +319,10 @@
}
}
+ version( LLVMDC)
+ {
+ // nothing to pop
+ }
else
version( D_InlineAsm_X86 )
{
static assert( false, "Architecture not supported." );
asm
Index: lib/gc/basic/gcx.d
===================================================================
--- lib/gc/basic/gcx.d (revision 3899)
+++ lib/gc/basic/gcx.d (working copy)
@@ -2178,6 +2178,21 @@
@@ -2178,6 +2178,29 @@
__builtin_unwind_init();
sp = & sp;
}
@@ -122,37 +143,35 @@ Index: lib/gc/basic/gcx.d
+ {
+ version(X86)
+ {
+ uint eax,ecx,edx,ebx,ebp,esi,edi;
+ asm
+ {
+ pushad ;
+ pushad ;
+ mov eax[EBP], EAX ;
+ mov ecx[EBP], ECX ;
+ mov edx[EBP], EDX ;
+ mov ebx[EBP], EBX ;
+ mov ebp[EBP], EBP ;
+ mov esi[EBP], ESI ;
+ mov edi[EBP], EDI ;
+ mov sp[EBP],ESP ;
+ }
+ }
+ else
+ {
+ pragma(msg, "don't know how to push registers on the stack for this architecture with llvmdc");
+ static assert( false, "Architecture not supported." );
+ }
+ }
else
{
asm
@@ -2191,6 +2206,20 @@
@@ -2191,6 +2214,10 @@
{
// nothing to do
}
+ else version(LLVMDC)
+ {
+ version(X86)
+ {
+ asm
+ {
+ popad ;
+ }
+ }
+ else
+ {
+ // TODO
+ }
+ // nothing to do
+ }
else
{