diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-09 08:19:58 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-09 08:19:58 +0000 |
commit | 94252f4bcc0a3f487b804ce535cb77b8bef4db83 (patch) | |
tree | 7ca86535c5a6b99d4cc432ba5cfddabc5ee4ea16 /libgo/runtime/runtime.c | |
parent | cd6368115dbd75d9187877097c48a0d8d4c04fd4 (diff) | |
download | gcc-94252f4bcc0a3f487b804ce535cb77b8bef4db83.zip gcc-94252f4bcc0a3f487b804ce535cb77b8bef4db83.tar.gz gcc-94252f4bcc0a3f487b804ce535cb77b8bef4db83.tar.bz2 |
libgo: Update to weekly.2012-02-07.
From-SVN: r184034
Diffstat (limited to 'libgo/runtime/runtime.c')
-rw-r--r-- | libgo/runtime/runtime.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c index 922fa20..7c8c436 100644 --- a/libgo/runtime/runtime.c +++ b/libgo/runtime/runtime.c @@ -184,6 +184,19 @@ runtime_fastrand1(void) return x; } +int64 +runtime_cputicks(void) +{ +#if defined(__386__) || defined(__x86_64__) + uint32 low, high; + asm("rdtsc" : "=a" (low), "=d" (high)); + return (int64)(((uint64)high << 32) | (uint64)low); +#else + // FIXME: implement for other processors. + return 0; +#endif +} + struct funcline_go_return { String retfile; |