Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
93 Views

How to get integer add and sub count from intel Vtune

I am using intel VTune to profile my program.

The CPU I am using is IVY Bridge.

All the hardware instruction event can be found here:

https://software.intel.com/en-us/node/589933

FP_COMP_OPS_EXE.X87

Number of FP Computational Uops Executed this cycle. The number of FADD, FSUB, FCOM, FMULs, integer MULsand IMULs, FDIVs, FPREMs, FSQRTS, integer DIVs, and IDIVs. This event does not distinguish an FADD used in the middle of a transcendental flow from a s

FP_COMP_OPS_EXE.X87 seems to include Integer Multiplication and Integer Division; however, there is no Integer ADD and Integer SUB there. I can not found those two kinds of instruction either.

Can anyone tell me what is the event that counts integer addition and integer subtraction instructions?

0 Kudos
5 Replies
Highlighted
Employee
93 Views

Hi Yun:

It appears there are no separate counters.  The definition says it includes FADD and FSUB.  Does the code you want to measure include any multiple or divide operations?  If not, then you can assume this event is counting your FADD and FSUB operations.

The other option would be to add your own counter.  For example, if your loop-of-interest executes two floating point adds and a FP subtract, then after the loop concludes, simply multiple the loop count times 2 to get the FP add count and the loop count is the FP sub count.

What exactly are you trying to accomplish?

0 Kudos
Highlighted
Beginner
93 Views

MrAnderson (Intel) wrote:

Hi Yun:

It appears there are no separate counters.  The definition says it includes FADD and FSUB.  Does the code you want to measure include any multiple or divide operations?  If not, then you can assume this event is counting your FADD and FSUB operations.

The other option would be to add your own counter.  For example, if your loop-of-interest executes two floating point adds and a FP subtract, then after the loop concludes, simply multiple the loop count times 2 to get the FP add count and the loop count is the FP sub count.

What exactly are you trying to accomplish?

 

 

Thanks so much for your reply Mr Anderson,

My goal is to count the total number of floating point instructions and integer instructions. I know FP_COMP_OPS_EXE.X87 count FADD, FSUB, but do those two events includes Integer Additions and Integer Subtraction? If not, is it possible for me to get total number of integration additions and subtractions from Intel VTune?

 

Thanks so much,

Yun

 

 

 

 

0 Kudos
Highlighted
Employee
93 Views

Sorry, Yun, I probably read your question too quickly.

No, I don't see events to count integer adds and subtracts.  You have to realize that the purpose of most events it not simply to count things but more to highlight inefficient code execution.  That is, they typically count things that make the processor slow down.  Thus, you can see events for when the DIV instruction is used, caches missed and floating point assists.  Not all processor actions have associated events.

0 Kudos
Highlighted
Beginner
93 Views

MrAnderson (Intel) wrote:

Sorry, Yun, I probably read your question too quickly.

No, I don't see events to count integer adds and subtracts.  You have to realize that the purpose of most events it not simply to count things but more to highlight inefficient code execution.  That is, they typically count things that make the processor slow down.  Thus, you can see events for when the DIV instruction is used, caches missed and floating point assists.  Not all processor actions have associated events.

 

Thanks ,Anderson,

I just feel that it might be a little bit strange to have no event for integer additions and subtractions. They have the total number of instructions, I am just wondering how would VTune get the total number of instructions if they do not have integer additions and subtractions.

 

Thanks for your reply.

Yun

 

0 Kudos
Highlighted
Employee
93 Views

What you have to understand is that VTune Amplifier does not define the events that are available.  VTune Amplifier leverages those events that are defined in the processor architecture.  Also, VTune Amplifier is not about counting every instruction.  It is about identifying those portions of your application that take the most time and then identifying why.  Counting integer adds and subtracts is not relevant to those goals.

I'm sorry but I think the best solution is to count them yourself as I described above.

0 Kudos