made some fixes to support gcc3 on sparc
authorAndrew Waterman <waterman@r53.millennium.berkeley.edu>
Wed, 28 Oct 2009 06:27:50 +0000 (23:27 -0700)
committerAndrew Waterman <waterman@r53.millennium.berkeley.edu>
Wed, 28 Oct 2009 06:27:50 +0000 (23:27 -0700)
user/apps/parlib/fptest.c [new file with mode: 0644]

diff --git a/user/apps/parlib/fptest.c b/user/apps/parlib/fptest.c
new file mode 100644 (file)
index 0000000..3bb5c04
--- /dev/null
@@ -0,0 +1,23 @@
+#include <arch/softfloat.c>
+
+int main()
+{
+       softfloat_t sf;
+       softfloat_init(&sf);
+
+       volatile double x = 1.0, y = 2.0, z = 3.0;
+
+       volatile long long xx = *(long long*)&x;
+       volatile long long yy = *(long long*)&y;
+       volatile long long zz = *(long long*)&z;
+
+       for(int i = 0; i < 100000; i++)
+       {
+               xx = float64_div(&sf,yy,zz);
+//             x = y/z;
+       }
+
+       printf("%.2f\n",x);
+
+       return 0;
+}