Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1012 from MartinNowak/fix12800
Browse files Browse the repository at this point in the history
fix Issue 12800 - Fibers are broken on Win64
  • Loading branch information
complexmath committed Nov 10, 2014
2 parents b947366 + fc887f3 commit d306681
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -3507,7 +3507,9 @@ private
push R13;
push R14;
push R15;
// Five registers = 40 bytes; stack is now aligned to 16 bytes
push RDI;
push RSI;
// 7 registers = 56 bytes; stack is now aligned to 16 bytes
sub RSP, 160;
movdqa [RSP + 144], XMM6;
movdqa [RSP + 128], XMM7;
Expand Down Expand Up @@ -3546,6 +3548,8 @@ private
movdqa XMM7, [RSP + 128];
movdqa XMM6, [RSP + 144];
add RSP, 160;
pop RSI;
pop RDI;
pop R15;
pop R14;
pop R13;
Expand Down Expand Up @@ -4494,6 +4498,8 @@ private:
push( 0x00000000_00000000 ); // R13
push( 0x00000000_00000000 ); // R14
push( 0x00000000_00000000 ); // R15
push( 0x00000000_00000000 ); // RDI
push( 0x00000000_00000000 ); // RSI
push( 0x00000000_00000000 ); // XMM6 (high)
push( 0x00000000_00000000 ); // XMM6 (low)
push( 0x00000000_00000000 ); // XMM7 (high)
Expand Down Expand Up @@ -5064,7 +5070,7 @@ version( AsmX86_64_Windows )
void testNonvolatileRegister(alias REG)()
{
auto zeroRegister = new Fiber(() {
mixin("asm pure nothrow @nogc { xor "~REG~", "~REG~"; }");
mixin("asm pure nothrow @nogc { naked; xor "~REG~", "~REG~"; ret; }");
});
long after;

Expand All @@ -5078,7 +5084,7 @@ version( AsmX86_64_Windows )
void testNonvolatileRegisterSSE(alias REG)()
{
auto zeroRegister = new Fiber(() {
mixin("asm pure nothrow @nogc { xorpd "~REG~", "~REG~"; }");
mixin("asm pure nothrow @nogc { naked; xorpd "~REG~", "~REG~"; ret; }");
});
long[2] before = [0xFFFFFFFF_FFFFFFFF, 0xFFFFFFFF_FFFFFFFF], after;

Expand Down

0 comments on commit d306681

Please sign in to comment.