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

Commit

Permalink
use naked asm blocks to clear registers
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Nov 10, 2014
1 parent b947366 commit b37f86a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -5064,7 +5064,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 +5078,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 b37f86a

Please sign in to comment.