X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fx87_s.expect.c;fp=tests%2Fx87_s.expect.c;h=6b01b42e7f1814a635aa0ba49d4374780b226b9e;hb=fe18df39aa9dc0a3afc5a7474a27698672eceeca;hp=0000000000000000000000000000000000000000;hpb=497a6d6b4c2992fc9cbd2591985d108bc8859f72;p=ia32rtools.git diff --git a/tests/x87_s.expect.c b/tests/x87_s.expect.c new file mode 100644 index 0000000..6b01b42 --- /dev/null +++ b/tests/x87_s.expect.c @@ -0,0 +1,30 @@ +int sub_test() +{ + union { u32 d[1]; u8 b[4]; double q[1]; } sf; + u32 eax; + u32 edx; + float f_st[8]; + int f_stp = 0; + + sf.d[0] = 4; // var_4 + f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild + f_st[--f_stp & 7] = *((float *)(u32)&sf.d[0]); // var_4 fld + f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild + f_st[--f_stp & 7] = 1.0; + f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild + f_st[--f_stp & 7] = 0.0; + f_st[--f_stp & 7] = 0.693147180559945; + f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild + f_stp++; + f_st[(f_stp + 5) & 7] /= f_st[f_stp & 7]; f_stp++; + f_st[(f_stp + 1) & 7] = f_st[(f_stp + 1) & 7] * log2f(f_st[f_stp & 7]); f_stp++; + f_st[(f_stp + 2) & 7] -= f_st[f_stp & 7]; f_stp++; + f_stp++; + { float t = f_st[f_stp & 7]; f_st[f_stp & 7] = f_st[(f_stp + 6) & 7]; f_st[(f_stp + 6) & 7] = t; } // fxch + f_st[f_stp & 7] = -f_st[f_stp & 7]; + f_st[(f_stp + 1) & 7] = atanf(f_st[(f_stp + 1) & 7] / f_st[f_stp & 7]); f_stp++; + *((float *)(u32)&sf.d[0]) = f_st[f_stp & 7]; f_stp++; // var_4 fst + eax = (s32)f_st[f_stp & 7]; f_stp++; // ftol + return eax; +} +