Mercurial > hg > Game > Cerium
annotate TaskManager/Fifo/rdtsc.h @ 1345:95de5f81924d draft
exclusion of asm from Cell
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 16 Jan 2012 16:56:14 +0900 |
parents | 2fa31362ead0 |
children | 411401d1cb71 |
rev | line source |
---|---|
1301
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #ifndef RDTSC_H_ |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #define RDTSC_H_ |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 /* |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 * rdtsc is Read Time Stamp Counter |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 */ |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 inline unsigned long long rdtsc() { |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 unsigned long long ret; |
1345
95de5f81924d
exclusion of asm from Cell
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1301
diff
changeset
|
10 #ifdef __CERIUM_FIFO__ |
1301
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 __asm__ volatile ("rdtsc" : "=A" (ret)); |
1345
95de5f81924d
exclusion of asm from Cell
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
1301
diff
changeset
|
12 #endif // __CERIUM_FIFO__ |
1301
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 return ret; |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 } |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 |
2fa31362ead0
add header to be used Read Time Stamp Counter
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 #endif /* RDTSC_H_ */ |