translate: bswap, allsh* and some tweaks
[ia32rtools.git] / tests / x87_s.expect.c
CommitLineData
fe18df39 1int sub_test()
2{
3 union { u32 d[1]; u8 b[4]; double q[1]; } sf;
4 u32 eax;
5 u32 edx;
6 float f_st[8];
7 int f_stp = 0;
8
9 sf.d[0] = 4; // var_4
10 f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild
11 f_st[--f_stp & 7] = *((float *)(u32)&sf.d[0]); // var_4 fld
12 f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild
13 f_st[--f_stp & 7] = 1.0;
14 f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild
15 f_st[--f_stp & 7] = 0.0;
16 f_st[--f_stp & 7] = 0.693147180559945;
17 f_st[--f_stp & 7] = (float)(s32)sf.d[0]; // var_4 fild
18 f_stp++;
19 f_st[(f_stp + 5) & 7] /= f_st[f_stp & 7]; f_stp++;
20 f_st[(f_stp + 1) & 7] = f_st[(f_stp + 1) & 7] * log2f(f_st[f_stp & 7]); f_stp++;
21 f_st[(f_stp + 2) & 7] -= f_st[f_stp & 7]; f_stp++;
22 f_stp++;
23 { 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
24 f_st[f_stp & 7] = -f_st[f_stp & 7];
25 f_st[(f_stp + 1) & 7] = atanf(f_st[(f_stp + 1) & 7] / f_st[f_stp & 7]); f_stp++;
26 *((float *)(u32)&sf.d[0]) = f_st[f_stp & 7]; f_stp++; // var_4 fst
27 eax = (s32)f_st[f_stp & 7]; f_stp++; // ftol
28 return eax;
29}
30