Updated cool quotes
[gromacs.git] / cmake / TestARMv7CycleCounters.cpp
blob81b925188833bdb484e588e57a98383f32636047
1 int main()
3 #if defined(__ARM_ARCH_7A__) && defined(__GNUC__)
4 unsigned int cycles_lo, cycles_hi;
5 asm volatile("mrrc p15, 1, %0, %1, c14" : "=r" (cycles_lo), "=r" (cycles_hi));
7 // Return 0 (success) if low or high 32 bits contained anything non-trivial
8 return !(cycles_lo > 0 || cycles_hi > 0);
9 #else
10 #error This architecture/compiler does not support ARMv7 32-bit cycle counters
11 #endif