Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
a8572b62
Commit
a8572b62
authored
Dec 19, 2009
by
Janne Blomqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase clock resolution for system_clock_8.
From-SVN: r155359
parent
2a5e9d16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
libgfortran/ChangeLog
+7
-0
libgfortran/intrinsics/system_clock.c
+5
-6
No files found.
libgfortran/ChangeLog
View file @
a8572b62
2009-12-19 Janne Blomqvist <jb@gcc.gnu.org>
* intrinsics/system_clock.c: Fix library name in comment, move TCK
definition into functions.
(system_clock_4): Remove unused struct timezone.
(system_clock_8): Remove unused struct timezone, increase TCK.
2009-12-08 Tobias Burnus <burnus@net-b.de>
PR fortran/41711
...
...
libgfortran/intrinsics/system_clock.c
View file @
a8572b62
/* Implementation of the SYSTEM_CLOCK intrinsic.
Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU Fortran
95
runtime library (libgfortran).
This file is part of the GNU Fortran runtime library (libgfortran).
Libgfortran is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
...
...
@@ -28,7 +28,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
# include <sys/time.h>
# define TCK 1000
#elif defined(HAVE_TIME_H)
# include <time.h>
# define TCK 1
...
...
@@ -57,13 +56,13 @@ system_clock_4(GFC_INTEGER_4 *count, GFC_INTEGER_4 *count_rate,
GFC_INTEGER_4
mx
;
#if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
#define TCK 1000
struct
timeval
tp1
;
struct
timezone
tzp
;
if
(
sizeof
(
tp1
.
tv_sec
)
<
sizeof
(
GFC_INTEGER_4
))
internal_error
(
NULL
,
"tv_sec too small"
);
if
(
gettimeofday
(
&
tp1
,
&
tzp
)
==
0
)
if
(
gettimeofday
(
&
tp1
,
NULL
)
==
0
)
{
GFC_UINTEGER_4
ucnt
=
(
GFC_UINTEGER_4
)
tp1
.
tv_sec
*
TCK
;
ucnt
+=
(
tp1
.
tv_usec
+
500000
/
TCK
)
/
(
1000000
/
TCK
);
...
...
@@ -118,13 +117,13 @@ system_clock_8 (GFC_INTEGER_8 *count, GFC_INTEGER_8 *count_rate,
GFC_INTEGER_8
mx
;
#if defined(HAVE_SYS_TIME_H) && defined(HAVE_GETTIMEOFDAY)
#define TCK 1000000
struct
timeval
tp1
;
struct
timezone
tzp
;
if
(
sizeof
(
tp1
.
tv_sec
)
<
sizeof
(
GFC_INTEGER_4
))
internal_error
(
NULL
,
"tv_sec too small"
);
if
(
gettimeofday
(
&
tp1
,
&
tzp
)
==
0
)
if
(
gettimeofday
(
&
tp1
,
NULL
)
==
0
)
{
if
(
sizeof
(
tp1
.
tv_sec
)
<
sizeof
(
GFC_INTEGER_8
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment