News for hackers. Stuff that matters.
Re:Assembly Hall of Shame by michalsustr on Friday August 07, 2026 @03:44PM (#49215363)
Very cool! Also, huh interesting. I’ve used rdtsc to measure cycle diffs but had no idea its execution takes that long. Is that common across architectures?
Re:Assembly Hall of Shame by inigyou on Friday August 07, 2026 @03:52PM (#49215446)
AFAIK it acts as some kind of execution barrier, to give meaningful timing.
Re:Assembly Hall of Shame by rrampage on Friday August 07, 2026 @03:56PM (#49215485)
Re:Assembly Hall of Shame by pbsd on Friday August 07, 2026 @05:09PM (#49216260)
The cycle count for RDTSC is ~25 cycles on Skylake-era microarchitectures. The 49 number shown in the OP seems off.
Re:Assembly Hall of Shame by phire on Saturday August 08, 2026 @03:46AM (#49219720)
It's actually benchmarking 1000 repetitions of the RDTSC instruction running in parallel.

My guess... On Skylake, multiple in-flight RDTSC instructions slow each other down for some reason?

Possibly because it's attempting to provide a strict monotonic guarantee, that no two RSTSC instructions will return the same timestamp. Intel's manual only claims monotonic, which theoretically allows for two RSTSC instructions to return the same timestamp.