[clang] [llvm] [LLVM] Add `__builtin_readsteadycounter` intrinsic and builtin for realtime clocks (PR #81331)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 05:06:52 PST 2024


jhuber6 wrote:

> Are we assuming any particular relationship to __builtin_readcyclecounter in terms of scales etc?
> 
> __builtin_readsteadycounter could be used to access x86 MPERF clock counters, but to access the corresponding APERF clock we'd then need a __builtin_readvariablecounter equivalent (__builtin_readcyclecounter gives the separate RDTSC clock value)

Not currently at least. The idea is just to expose the counter that has a fixed tick rate, compared to the cycle counter which is variable.

https://github.com/llvm/llvm-project/pull/81331


More information about the cfe-commits mailing list