Mercurial > projects > dstress
view run/a/asm_pfrcpit1_01_B.d @ 1044:03c97933de98
inline ASM review
author | thomask |
---|---|
date | Thu, 08 Jun 2006 18:26:22 +0000 |
parents | f34b7d4a2db7 |
children | 61d7e32e70a8 |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ module dstress.run.a.asm_pfrcpit1_01_B; version(D_InlineAsm_X86){ version = runTest; }else version(D_InlineAsm_X86_64){ version = runTest; } version(runTest){ import addon.cpuinfo; int main(){ haveMMX!()(); have3DNow!()(); const float[2] A = [2.0f, -0.5f]; float[2] c; asm{ movq MM1, A; pfrcp MM0, MM1; pfrcpit1 MM0, MM1; movq c, MM0; emms; } c[0] -= 1.007812f; if(c[0] < 0.0f){ c[0] = -c[0]; } if(c[0] > float.epsilon * (1 << 11)){ assert(0); } c[1] += 1.007812f; if(c[0] < 0.0f){ c[0] = -c[0]; } if(c[0] > float.epsilon * (1 << 11)){ assert(0); } return 0; } }else{ pragma(msg, "DSTRESS{XPASS}: no inline ASM support"); static assert(0); }