File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
MicroBenchmarks/libs/benchmark-1.3.0 Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ LLVM notes
2
+ ----------
3
+ This directory contains the Google Benchmark source code. Currently, the checked out
4
+ Benchmark library version is v1.3.0.
5
+
6
+ This directory is under a different license than LLVM.
7
+
8
+ Changes:
9
+ * https://github.com/google/benchmark/commit/ff2c255af5bb2fc2e5cd3b3685f0c6283117ce73
10
+ is applied on top of v1.3.0 to add s390x Support.
11
+ * https://github.com/google/benchmark/commit/aad6a5fa767529d3353bd3beb89e126c7b0868ca
12
+ is applied on top of v1.3.0 to add NetBSD Support.
13
+ * https://github.com/google/benchmark/commit/4abdfbb802d1b514703223f5f852ce4a507d32d2
14
+ is applied on top of v1.3.0 to add RISC-V timer support.
Original file line number Diff line number Diff line change @@ -164,6 +164,21 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
164
164
uint64_t tsc;
165
165
asm (" stck %0" : " =Q" (tsc) : : " cc" );
166
166
return tsc;
167
+ #elif defined(__riscv) // RISC-V
168
+ // Use RDCYCLE (and RDCYCLEH on riscv32)
169
+ #if __riscv_xlen == 32
170
+ uint64_t cycles_low, cycles_hi0, cycles_hi1;
171
+ asm (" rdcycleh %0" : " =r" (cycles_hi0));
172
+ asm (" rdcycle %0" : " =r" (cycles_lo));
173
+ asm (" rdcycleh %0" : " =r" (cycles_hi1));
174
+ // This matches the PowerPC overflow detection, above
175
+ cycles_lo &= -static_cast <int64_t >(cycles_hi0 == cycles_hi1);
176
+ return (cycles_hi1 << 32 ) | cycles_lo;
177
+ #else
178
+ uint64_t cycles;
179
+ asm (" rdcycle %0" : " =r" (cycles));
180
+ return cycles;
181
+ #endif
167
182
#else
168
183
// The soft failover to a generic implementation is automatic only for ARM.
169
184
// For other platforms the developer is expected to make an attempt to create
You can’t perform that action at this time.
0 commit comments