From 9e8e701d570d467e1f7ac058249c77cea6b7e183 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Mon, 6 Jul 1998 08:29:31 +0000 Subject: intdoc.in: Add entry for DATE_AND_TIME. 1998-07-05 Dave Love * intdoc.in: Add entry for DATE_AND_TIME. * intrin.def: Add implementation for DATE_AND_TIME. Make second and third args of SYSTEM_CLOCK optional. * com.c (ffecom_expr_intrinsic_): New case for DATE_AND_TIME. * com-rt.def (FFECOM_gfrtSYSTEM_CLOCK): Call G77_system_clock_0, not system_clock_. (FFECOM_gfrtDATE_AND_TIME): New DEFGFRT. From-SVN: r20938 --- gcc/f/ChangeLog | 13 +++++++++++++ gcc/f/com-rt.def | 3 ++- gcc/f/com.c | 1 + gcc/f/intdoc.in | 21 +++++++++++++++++++++ gcc/f/intdoc.texi | 50 +++++++++++++++++++++++++++++++++++++++++++------- gcc/f/intrin.def | 5 +++-- 6 files changed, 83 insertions(+), 10 deletions(-) diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog index 9f8068f..25d3640 100644 --- a/gcc/f/ChangeLog +++ b/gcc/f/ChangeLog @@ -1,3 +1,16 @@ +1998-07-05 Dave Love + + * intdoc.in: Add entry for DATE_AND_TIME. + + * intrin.def: Add implementation for DATE_AND_TIME. Make second + and third args of SYSTEM_CLOCK optional. + + * com.c (ffecom_expr_intrinsic_): New case for DATE_AND_TIME. + + * com-rt.def (FFECOM_gfrtSYSTEM_CLOCK): Call G77_system_clock_0, + not system_clock_. + (FFECOM_gfrtDATE_AND_TIME): New DEFGFRT. + Wed Jul 1 11:19:13 1998 Craig Burley Fix 980701-1.f (which was producing "unaligned trap" diff --git a/gcc/f/com-rt.def b/gcc/f/com-rt.def index 111085f..6ceaf17 100644 --- a/gcc/f/com-rt.def +++ b/gcc/f/com-rt.def @@ -143,6 +143,7 @@ DEFGFRT (FFECOM_gfrtDASIN, "d_asin", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE) DEFGFRT (FFECOM_gfrtDATAN, "d_atan", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE) DEFGFRT (FFECOM_gfrtDATAN2, "d_atn2", FFECOM_rttypeDOUBLE_, "&d", FALSE, FALSE) DEFGFRT (FFECOM_gfrtDATE, "G77_date_0", FFECOM_rttypeVOID_, "&a", FALSE, FALSE) +DEFGFRT (FFECOM_gfrtDATE_AND_TIME, "G77_date_and_time_0", FFECOM_rttypeVOID_, "&a&a&a&i", FALSE, FALSE) DEFGFRT (FFECOM_gfrtL_BESJ0, "j0", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE) DEFGFRT (FFECOM_gfrtL_BESJ1, "j1", FFECOM_rttypeDOUBLE_, "d", FALSE, FALSE) DEFGFRT (FFECOM_gfrtL_BESJN, "jn", FFECOM_rttypeDOUBLE_, "id", FALSE, FALSE) @@ -234,7 +235,7 @@ DEFGFRT (FFECOM_gfrtSRAND, "G77_srand_0", FFECOM_rttypeVOID_, "&i", FALSE, FALSE DEFGFRT (FFECOM_gfrtSTAT, "G77_stat_0", FFECOM_rttypeINTEGER_, "&a&i", FALSE, FALSE) DEFGFRT (FFECOM_gfrtSYMLNK, "G77_symlnk_0", FFECOM_rttypeINTEGER_, "&a&a", FALSE, FALSE) DEFGFRT (FFECOM_gfrtSYSTEM, "G77_system_0", FFECOM_rttypeINTEGER_, "&a", FALSE, FALSE) -DEFGFRT (FFECOM_gfrtSYSTEM_CLOCK, "system_clock_", FFECOM_rttypeVOID_, "&i&i&i", FALSE, FALSE) +DEFGFRT (FFECOM_gfrtSYSTEM_CLOCK, "G77_system_clock_0", FFECOM_rttypeVOID_, "&i&i&i", FALSE, FALSE) DEFGFRT (FFECOM_gfrtTAN, "r_tan", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE) DEFGFRT (FFECOM_gfrtTANH, "r_tanh", FFECOM_rttypeREAL_F2C_, "&f", FALSE, FALSE) DEFGFRT (FFECOM_gfrtTIME, "G77_time_0", FFECOM_rttypeLONGINT_, 0, FALSE, FALSE) diff --git a/gcc/f/com.c b/gcc/f/com.c index e6e4f6e..d2ff346 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -5204,6 +5204,7 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree, case FFEINTRIN_impCHDIR_func: case FFEINTRIN_impCHMOD_func: case FFEINTRIN_impDATE: + case FFEINTRIN_impDATE_AND_TIME: case FFEINTRIN_impDBESJ0: case FFEINTRIN_impDBESJ1: case FFEINTRIN_impDBESJN: diff --git a/gcc/f/intdoc.in b/gcc/f/intdoc.in index 1ef6a94..b661d6e 100644 --- a/gcc/f/intdoc.in +++ b/gcc/f/intdoc.in @@ -2468,3 +2468,24 @@ scheduled alarm was due to be delivered, or zero if there was no previously scheduled alarm. @xref{Signal Intrinsic (subroutine)}. ") + +DEFDOC (DATE_AND_TIME, "Get the current date and time.", "\ +Returns: +@table @var +@item @1@ +The date in the form @var{ccyymmdd}: century, year, month and day; +@item @2@ +The time in the form @samp{@var{hhmmss.ss}}: hours, minutes, seconds +and milliseconds; +@item @3@ +The difference between local time and UTC (GMT) in the form @var{Shhmm}: +sign, hours and minutes, e.g.@ @samp{-0500} (winter in New York); +@item @4@ +The year, month of the year, day of the month, time difference in +minutes from UTC, hour of the day, minutes of the hour and milliseconds +of the second in successive values of the array. +@end table + +On systems where a millisecond timer isn't available, the millisecond +value is returned as zero. +") diff --git a/gcc/f/intdoc.texi b/gcc/f/intdoc.texi index 74153db..cad98a7 100644 --- a/gcc/f/intdoc.texi +++ b/gcc/f/intdoc.texi @@ -184,7 +184,7 @@ * Date Intrinsic:: Get current date as dd-Mon-yy. @end ifset @ifset familyF90 -* Date_and_Time Intrinsic:: (Reserved for future use.) +* Date_and_Time Intrinsic:: Get the current date and time. @end ifset @ifset familyF2U * DbesJ0 Intrinsic:: Bessel function (archaic). @@ -2977,10 +2977,46 @@ for the current (or any) date. @cindex Date_and_Time intrinsic @cindex intrinsics, Date_and_Time -This intrinsic is not yet implemented. -The name is, however, reserved as an intrinsic. -Use @samp{EXTERNAL Date_and_Time} to use this name for an -external procedure. +@noindent +@example +CALL Date_and_Time(@var{Date}, @var{Ftime}, @var{Zone}, @var{Values}) +@end example + +@noindent +@var{Date}: @code{CHARACTER}; scalar; INTENT(OUT). + +@noindent +@var{Ftime}: @code{CHARACTER}; OPTIONAL; scalar; INTENT(OUT). + +@noindent +@var{Zone}: @code{CHARACTER}; OPTIONAL; scalar; INTENT(OUT). + +@noindent +@var{Values}: @code{INTEGER(KIND=1)}; OPTIONAL; DIMENSION(8); INTENT(OUT). + +@noindent +Intrinsic groups: @code{f90}. + +@noindent +Description: + +Returns +@table @var +@item Date +The date in the form @var{ccyymmdd}: century, year, month and day; +@item Ftime +The time in the form @samp{@var{hhmmss.ss}}: hours, minutes, seconds +and milliseconds; +@item Zone +The difference between local time and UTC (GMT) in the form @var{Shhmm}: +sign, hours and minutes, e.g.@ @samp{-0500} (winter in New York); +@item Values +The year, month of the year, day of the month, time difference in +minutes from UTC, hour of the day, minutes of the hour and milliseconds +of the second in successive values of the array. +@end table +On systems where a millisecond timer isn't available, the millisecond +value is returned as zero. @end ifset @ifset familyF2U @@ -10006,10 +10042,10 @@ CALL System_Clock(@var{Count}, @var{Rate}, @var{Max}) @var{Count}: @code{INTEGER(KIND=1)}; scalar; INTENT(OUT). @noindent -@var{Rate}: @code{INTEGER(KIND=1)}; scalar; INTENT(OUT). +@var{Rate}: @code{INTEGER(KIND=1)}; OPTIONAL; scalar; INTENT(OUT). @noindent -@var{Max}: @code{INTEGER(KIND=1)}; scalar; INTENT(OUT). +@var{Max}: @code{INTEGER(KIND=1)}; OPTIONAL; scalar; INTENT(OUT). @noindent Intrinsic groups: @code{f90}. diff --git a/gcc/f/intrin.def b/gcc/f/intrin.def index 29766543..0c00dcc 100644 --- a/gcc/f/intrin.def +++ b/gcc/f/intrin.def @@ -1377,7 +1377,7 @@ DEFSPEC (DATE_AND_TIME, "DATE_AND_TIME", FALSE, FFEINTRIN_familyF90, - FFEINTRIN_impNONE + FFEINTRIN_impDATE_AND_TIME ) DEFSPEC (DBESJ0, "DBESJ0", @@ -3233,6 +3233,7 @@ DEFIMP (CPU_TIME, "CPU_TIME", SECOND,,, "--:-:Seconds=R*w") DEFIMP (CTIME_func, "CTIME_func", CTIME,,, "A1*:-:STime=I*") DEFIMP (CTIME_subr, "CTIME_subr", CTIME,,, "--:-:Result=A1w,STime=I*") DEFIMP (DATE, "DATE", DATE,,, "--:-:Date=A1w") +DEFIMP (DATE_AND_TIME, "DATE_AND_TIME", DATE_AND_TIME,,, "--:-:Date=A1w,Time=?A1w,Zone=?A1w,Values=?I1(8)w") DEFIMP (DBESJ0, "DBESJ0", L_BESJ0,,, "R2:-:X=R2") DEFIMP (DBESJ1, "DBESJ1", L_BESJ1,,, "R2:-:X=R2") DEFIMP (DBESJN, "DBESJN", L_BESJN,,, "R2:-:N=I*,X=R2") @@ -3336,7 +3337,7 @@ DEFIMP (SYMLNK_func, "SYMLNK_func", SYMLNK,,, "I1:-:Path1=A1,Path2=A1") DEFIMP (SYMLNK_subr, "SYMLNK_subr", SYMLNK,,, "--:-:Path1=A1,Path2=A1,Status=?I1w") DEFIMP (SYSTEM_func, "SYSTEM_func", SYSTEM,SYSTEM,SYSTEM,"I1:-:Command=A1") DEFIMP (SYSTEM_subr, "SYSTEM_subr", SYSTEM,,, "--:-:Command=A1,Status=?I1w") -DEFIMP (SYSTEM_CLOCK, "SYSTEM_CLOCK", SYSTEM_CLOCK,,, "--:-:Count=I1w,Rate=I1w,Max=I1w") +DEFIMP (SYSTEM_CLOCK, "SYSTEM_CLOCK", SYSTEM_CLOCK,,, "--:-:Count=I1w,Rate=?I1w,Max=?I1w") DEFIMP (TIME8, "TIME8", TIME,,, "I2:-:") DEFIMP (TIME_unix, "TIME_unix", TIME,,, "I1:-:") DEFIMP (TIME_vxt, "TIME_vxt", VXTTIME,,, "--:-:Time=A1[8]w") -- cgit v1.1