translate: misc fixes and additions
[ia32rtools.git] / tests / x87_s.expect.c
index 6b01b42..3a644b9 100644 (file)
@@ -1,8 +1,6 @@
-int sub_test()
+double 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;
 
@@ -17,14 +15,14 @@ int sub_test()
   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 + 1) & 7] = f_st[(f_stp + 1) & 7] * log2f(f_st[f_stp & 7]); f_stp++;  // fyl2x
   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++;
+  sf.d[0] = (s32)f_st[f_stp & 7];  // var_4 fist
   *((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;
+  return f_st[f_stp & 7];
 }