Counting Individual Floating point operations

Counting Individual Floating point operations


I would like to count the instructionsof individual ALU and floating pointoperations (ADD, MULT, COMP, DIV, ...).

Platform: Linux Mandrake 10.2/ 2.6.11-6mdksmp/i686 Intel D 3.2GHz/VTune 9.0

For base optimization (-O2), i found that my application triggers the followingCPU events:

"x87 Instructions Retired" and"Packed Single-precision Floating-point Streaming SIMD Extension Instructions Retired".

I use vtl command line,

vtl activity -c sampling -o "-ec en='x87 Instructions Retired' -app $SCRIPT -moi $APPL run

I checked Vtune users guide and found some intersting events. example:



Event Code: 0x13

Mask: 0x00

Category: Floating Point Events;

Definition: Divide operations executed.

Description: This event counts the number of divide operations executed. This includes integer divides, floating point divides and square-root operations executed.


Can i use this event on my CPU. IF yes, how can i do it. Any work around!!??

A friends advised to look at PIN, what do you think?


1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.