DLTcollab / sse2neon

A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

May need to set test suite ARMv7 qemu environment into privilege mode to use `mrc`

Cuda-Chen opened this issue · comments

Currently I am porting _rdtsc x86 intrinsic onto ARMv7.
On ARMv7 platform, usually we can access PMCCNTR to get cycle count. In order to access this register, the program has to run in PL1 or high mode, or running in user mode when PMUSERENR.EN == 1. However, the PMUSERENR is set to zero in the test suite qemu environment and I can't change the value because the test suite qemu environment is running in user mode.

As such, I come up with the following two solutions, and I would like to know which solution is acceptable to this project:

  1. Set test suite qemu environment to privilege mode.
  2. Fallback to call syscall such as gettimeofday() if we can't set the value of PMUSERENR (in Linux kernel, this kind of syscall is able to access PMCCNTR).

Let's discuss on #530