I'm playing around with some C reference code and it came with its own benchmarking routines. Unfortunately, the benchmarking code had a line of inline x86 assembly, and I'm trying to compile it on AArch64 ARMv8 system (a Raspberry Pi 3 if that helps).
From the context I figured out all the x86 assembly does is report clock cycles. I dug around the ARM processor docs and figured out I should probably be polling the CNTPCT_EL0 system register, and wrote the following:
unsigned long long result;
asm volatile ("mrs %0, cntpct_el0" : "=r" (result));
However, I get the following error from the assembler:
Error: selected processor does not support requested special purpose register -- `mrs r0,cntpct_el0'
So far I've tried changing the gcc flags (variations on -mcpu and -march), explicitly setting the destination register to being 64 bit, even updating binutils. What am I missing?