X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=ia32rtools.git;a=blobdiff_plain;f=tests%2Fx87.expect.c;h=25223eeef2c7efb70ee6256bd9c9c53243f45248;hp=bec8c96ce9badecbd4778b3d4e0a7b96012d7ebe;hb=16057ce1aaef8f239faf0209ef7af813d949713c;hpb=622eb2eff8349fa0a6675ce3213ab8f8fb1c1798 diff --git a/tests/x87.expect.c b/tests/x87.expect.c index bec8c96..25223ee 100644 --- a/tests/x87.expect.c +++ b/tests/x87.expect.c @@ -1,10 +1,12 @@ int sub_test(int a1, int a2) { - union { u32 d[8]; u8 b[32]; double q[4]; } sf; + union { u32 d[8]; u16 w[16]; u8 b[32]; double q[4]; } sf; u32 eax; u32 edx; double f_st0; double f_st1; + u16 f_sw; + u32 cond_z; f_st0 = (double)(s32)sf.d[0]; // var_20 fild f_st0 /= (double)(s32)a1; // arg_0 @@ -12,6 +14,12 @@ int sub_test(int a1, int a2) f_st1 = f_st0; f_st0 = (double)(s32)sf.d[0]; // var_20 fild f_st1 /= f_st0; f_st0 = f_st1 + f_st0; + f_sw = f_st0 <= *((double *)(u32)&sf.q[1]) ? 0x4100 : 0; // var_18 z_chk_det + eax = 0; + LOWORD(eax) = f_sw; + cond_z = ((u8)((u8)(eax >> 8) & 0x41) == 0); + eax = 0; + LOBYTE(eax) = (cond_z); f_st1 = f_st0; f_st0 = 1.0; f_st0 = *((double *)(u32)&sf.q[1]) / f_st0; // var_18 { double t = f_st0; f_st0 = f_st1; f_st1 = t; } // fxch @@ -20,8 +28,8 @@ int sub_test(int a1, int a2) f_st1 = f_st0; // fld st f_st0 = f_st1 * log2(f_st0); f_st1 = f_st0; // fld st - *((double *)(u32)&sf.q[1]) = f_st0; f_st0 = f_st1; // var_18 fst - *((float *)(u32)&sf.d[0]) = f_st0; // var_20 fst + sf.d[0] = (s32)f_st0; f_st0 = f_st1; // var_20 fist + *((double *)(u32)&sf.q[1]) = f_st0; // var_18 fst eax = (s32)f_st0; // ftol return eax; }