Skip to content

Commit edcec8a

Browse files
committed
include/perf_timer.h: fix rdtscp register clobber list
rdtscp also writes to the ECX register. Fix clobber list so that register allocation is done correctly by the compiler. Change-Id: Ie3c6a5ab8fbeae46605642fc7971b0e1504dd7c2 Signed-off-by: jty2 <46021128+jty2@users.noreply.github.com>
1 parent 9bc87d7 commit edcec8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

benchmarks/lockhammer/include/perf_timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ rdtscp(void)
107107

108108
asm volatile("rdtscp" :
109109
"=a" (tsc.lo_32),
110-
"=d" (tsc.hi_32));
110+
"=d" (tsc.hi_32) :: "ecx");
111111

112112
return tsc.tsc_64;
113113
}

0 commit comments

Comments
 (0)