[PATCH] libfortran/29121 -- Add real(10) and real(16) cpu_time routines
Steve Kargl
sgk@troutmask.apl.washington.edu
Fri Sep 29 20:46:00 GMT 2006
The patch is self explanatory. Tested on amd64-*-freebsd.
2006-09-29 Steven G. Kargl <kargl@gcc.gnu.org>
* intrinsics/cpu_time.c: Add cpu_time_10 and cpu_time_16 routines.
Ok for trunk and 4.1?
--
Steve
-------------- next part --------------
Index: cpu_time.c
===================================================================
--- cpu_time.c (revision 117308)
+++ cpu_time.c (working copy)
@@ -171,6 +171,30 @@ void cpu_time_8 (GFC_REAL_8 *time)
*time = sec + usec * (GFC_REAL_8)1.e-6;
}
+#ifdef HAVE_GFC_REAL_10
+extern void cpu_time_10 (GFC_REAL_10 *);
+export_proto(cpu_time_10);
+
+void cpu_time_10 (GFC_REAL_10 *time)
+{
+ long sec, usec;
+ __cpu_time_1 (&sec, &usec);
+ *time = sec + usec * (GFC_REAL_10)1.e-6;
+}
+#endif
+
+#ifdef HAVE_GFC_REAL_16
+extern void cpu_time_16 (GFC_REAL_16 *);
+export_proto(cpu_time_16);
+
+void cpu_time_16 (GFC_REAL_16 *time)
+{
+ long sec, usec;
+ __cpu_time_1 (&sec, &usec);
+ *time = sec + usec * (GFC_REAL_16)1.e-6;
+}
+#endif
+
extern void second_sub (GFC_REAL_4 *);
export_proto(second_sub);
More information about the Gcc-patches
mailing list