小编Cur*_*ous的帖子

在ARM中是否有与rdtsc等效的指令?

对于我的项目,我必须使用内联汇编指令(如rdtsc)来计算某些C/C++指令的执行时间.

以下代码似乎适用于英特尔,但不适用于ARM处理器:

{unsigned a, d;asm volatile("rdtsc" : "=a" (a), "=d" (d)); t0 = ((unsigned long)a) | (((unsigned long)d) << 32);}
//The C++ statement to measure its execution time
{unsigned a, d;asm volatile("rdtsc" : "=a" (a), "=d" (d)); t1 = ((unsigned long)a) | (((unsigned long)d) << 32);}
time = t1-t0;
Run Code Online (Sandbox Code Playgroud)

我的问题是:

如何在ARM处理器上编写类似于上面内联汇编代码(计算指令的执行经过时间)?

c c++ assembly arm inline-assembly

10
推荐指数
2
解决办法
4717
查看次数

标签 统计

arm ×1

assembly ×1

c ×1

c++ ×1

inline-assembly ×1