--- /dev/null
+/*\r
+ * Written by J.T. Conklin, Apr 10, 1995\r
+ * Public domain.\r
+ */\r
+\r
+#include <sys/EfiCdefs.h>\r
+/* __FBSDID("$FreeBSD: src/lib/libc/ia64/gen/flt_rounds.c,v 1.1 2004/07/19 08:17:24 das Exp $"); */\r
+\r
+#include <float.h>\r
+\r
+static const int map[] = {\r
+ 1, /* round to nearest */\r
+ 3, /* round to zero */\r
+ 2, /* round to negative infinity */\r
+ 0 /* round to positive infinity */\r
+};\r
+\r
+int\r
+__flt_rounds(void)\r
+{\r
+ int x;\r
+\r
+ __asm("mov %0=ar.fpsr" : "=r" (x));\r
+ return (map[(x >> 10) & 0x03]);\r
+}\r