Page 1 of 1

PAPI for testing instructions

PostPosted: Sun Apr 03, 2011 6:50 pm
by melodious
Hello everyone,

I have a question about using PAPI. I am wondering can PAPI measure the number of a specific instructions to be executed?
For example, a matrix multiplication assembly code (generated by the gcc flag -S) may contain both vectorized instruction (mulps) and scalar instruction (mulss), can PAPI measure the number of execution of such instructions?

Thanks in advance.

Re: PAPI for testing instructions

PostPosted: Mon Apr 04, 2011 11:14 am
by vweaver1
melodious wrote:I have a question about using PAPI. I am wondering can PAPI measure the number of a specific instructions to be executed?
For example, a matrix multiplication assembly code (generated by the gcc flag -S) may contain both vectorized instruction (mulps) and scalar instruction (mulss), can PAPI measure the number of execution of such instructions?


It might be possible to measure this using PAPI. It depends on what processor you are running on. You'll have to check the native events available on your processor to see if it supports measuring events of this type.

A better option though might be to use a binary-instrumentation tool such at Pin to gather this data.