uint numinfos = 1;
do {
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" a[0], "=b" a[1], "=c" a[2], "=d" a[3] : "a" 2;
+ "cpuid" : "=a" (a[0]), "=b" (a[1]), "=c" (a[2]), "=d" (a[3]) : "a" (2);
} else asm pure nothrow @nogc {
mov EAX, 2;
cpuid;
for (;;) {
uint a, b, number_of_sets;
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" a, "=b" b, "=c" number_of_sets : "a" 4, "c" cachenum : "edx";
+ "cpuid" : "=a" (a), "=b" (b), "=c" (number_of_sets) : "a" (4), "c" (cachenum) : "edx";
} else asm pure nothrow @nogc {
mov EAX, 4;
mov ECX, cachenum;
{
uint dummy, c5, c6, d6;
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" dummy, "=c" c5 : "a" 0x8000_0005 : "ebx", "edx";
+ "cpuid" : "=a" (dummy), "=c" (c5) : "a" (0x8000_0005) : "ebx", "edx";
} else asm pure nothrow @nogc {
mov EAX, 0x8000_0005; // L1 cache
cpuid;
ubyte numcores = 1;
if (max_extended_cpuid >= 0x8000_0008) {
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" dummy, "=c" numcores : "a" 0x8000_0008 : "ebx", "edx";
+ "cpuid" : "=a" (dummy), "=c" (numcores) : "a" (0x8000_0008) : "ebx", "edx";
} else asm pure nothrow @nogc {
mov EAX, 0x8000_0008;
cpuid;
}
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" dummy, "=c" c6, "=d" d6 : "a" 0x8000_0006 : "ebx";
+ "cpuid" : "=a" (dummy), "=c" (c6), "=d" (d6) : "a" (0x8000_0006) : "ebx";
} else asm pure nothrow @nogc {
mov EAX, 0x8000_0006; // L2/L3 cache
cpuid;
uint a, b, c, d;
do {
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" a, "=b" b, "=c" c, "=d" d : "a" 0x0B, "c" level;
+ "cpuid" : "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (0x0B), "c" (level);
} else asm pure nothrow @nogc {
mov EAX, 0x0B;
mov ECX, level;
uint* venptr = cast(uint*)cf.vendorID.ptr;
version (GNU)
{
- asm pure nothrow @nogc { "cpuid" : "=a" max_cpuid, "=b" venptr[0], "=d" venptr[1], "=c" venptr[2] : "a" 0; }
- asm pure nothrow @nogc { "cpuid" : "=a" max_extended_cpuid : "a" 0x8000_0000 : "ebx", "ecx", "edx"; }
+ asm pure nothrow @nogc {
+ "cpuid" : "=a" (max_cpuid), "=b" (venptr[0]), "=d" (venptr[1]), "=c" (venptr[2]) : "a" (0);
+ "cpuid" : "=a" (max_extended_cpuid) : "a" (0x8000_0000) : "ebx", "ecx", "edx";
+ }
}
else
{
cf.probablyAMD = cf.vendorID == "AuthenticAMD";
uint apic = 0; // brand index, apic id
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" a, "=b" apic, "=c" cf.miscfeatures, "=d" cf.features : "a" 1;
+ "cpuid" : "=a" (a), "=b" (apic), "=c" (cf.miscfeatures), "=d" (cf.features) : "a" (1);
} else {
asm pure nothrow @nogc {
mov EAX, 1; // model, stepping
if (max_cpuid >= 7)
{
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" a, "=b" cf.extfeatures, "=c" c : "a" 7, "c" 0 : "edx";
+ "cpuid" : "=a" (a), "=b" (cf.extfeatures), "=c" (c) : "a" (7), "c" (0) : "edx";
} else {
uint ext;
asm pure nothrow @nogc {
if (cf.miscfeatures & OSXSAVE_BIT)
{
version (GNU) asm pure nothrow @nogc {
- "xgetbv" : "=a" a, "=d" d : "c" 0;
+ "xgetbv" : "=a" (a), "=d" (d) : "c" (0);
} else asm pure nothrow @nogc {
mov ECX, 0;
xgetbv;
cf.amdmiscfeatures = 0;
if (max_extended_cpuid >= 0x8000_0001) {
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" a, "=c" cf.amdmiscfeatures, "=d" cf.amdfeatures : "a" 0x8000_0001 : "ebx";
+ "cpuid" : "=a" (a), "=c" (cf.amdmiscfeatures), "=d" (cf.amdfeatures) : "a" (0x8000_0001) : "ebx";
} else {
asm pure nothrow @nogc {
mov EAX, 0x8000_0001;
if (hyperThreadingBit) {
// determine max number of cores for AMD
version (GNU) asm pure nothrow @nogc {
- "cpuid" : "=a" a, "=c" c : "a" 0x8000_0008 : "ebx", "edx";
+ "cpuid" : "=a" (a), "=c" (c) : "a" (0x8000_0008) : "ebx", "edx";
} else asm pure nothrow @nogc {
mov EAX, 0x8000_0008;
cpuid;
uint* pnb = cast(uint*)cf.processorNameBuffer.ptr;
version (GNU)
{
- asm pure nothrow @nogc { "cpuid" : "=a" pnb[0], "=b" pnb[1], "=c" pnb[ 2], "=d" pnb[ 3] : "a" 0x8000_0002; }
- asm pure nothrow @nogc { "cpuid" : "=a" pnb[4], "=b" pnb[5], "=c" pnb[ 6], "=d" pnb[ 7] : "a" 0x8000_0003; }
- asm pure nothrow @nogc { "cpuid" : "=a" pnb[8], "=b" pnb[9], "=c" pnb[10], "=d" pnb[11] : "a" 0x8000_0004; }
+ asm pure nothrow @nogc {
+ "cpuid" : "=a" (pnb[0]), "=b" (pnb[1]), "=c" (pnb[ 2]), "=d" (pnb[ 3]) : "a" (0x8000_0002);
+ "cpuid" : "=a" (pnb[4]), "=b" (pnb[5]), "=c" (pnb[ 6]), "=d" (pnb[ 7]) : "a" (0x8000_0003);
+ "cpuid" : "=a" (pnb[8]), "=b" (pnb[9]), "=c" (pnb[10]), "=d" (pnb[11]) : "a" (0x8000_0004);
+ }
}
else version (D_InlineAsm_X86)
{
uint result = void;
asm pure nothrow @nogc
{
- "vmrs %0, FPSCR; and %0, %0, #0x1F;" : "=r" result;
+ "vmrs %0, FPSCR; and %0, %0, #0x1F;" : "=r" (result);
}
return result;
}
uint result = void;
asm pure nothrow @nogc
{
- "frflags %0" : "=r" result;
+ "frflags %0" : "=r" (result);
}
return result;
}
uint newValues = 0x0;
asm pure nothrow @nogc
{
- "fsflags %0" : : "r" newValues;
+ "fsflags %0" : : "r" (newValues);
}
}
}
ControlState cont;
asm pure nothrow @nogc
{
- "fstcw %0" : "=m" cont;
+ "fstcw %0" : "=m" (cont);
}
return cont;
}
ControlState cont;
asm pure nothrow @nogc
{
- "mrs %0, FPCR;" : "=r" cont;
+ "mrs %0, FPCR;" : "=r" (cont);
}
return cont;
}
{
asm pure nothrow @nogc
{
- "vmrs %0, FPSCR" : "=r" cont;
+ "vmrs %0, FPSCR" : "=r" (cont);
}
}
return cont;
ControlState cont;
asm pure nothrow @nogc
{
- "frcsr %0" : "=r" cont;
+ "frcsr %0" : "=r" (cont);
}
return cont;
}
{
asm pure nothrow @nogc
{
- "fclex; fldcw %0" : : "m" newState;
+ "fclex; fldcw %0" : : "m" (newState);
}
// Also update MXCSR, SSE's control register.
uint mxcsr;
asm pure nothrow @nogc
{
- "stmxcsr %0" : "=m" mxcsr;
+ "stmxcsr %0" : "=m" (mxcsr);
}
/* In the FPU control register, rounding mode is in bits 10 and
asm pure nothrow @nogc
{
- "ldmxcsr %0" : : "m" mxcsr;
+ "ldmxcsr %0" : : "m" (mxcsr);
}
}
}