Question

Is there any way to profile the total number of arithmetic operations used in a certain C/C++ program? By arithmetic operations I mean any operation that uses the integer/floating/special arithmetic unit in hardware.

Was it helpful?

Solution

If it is on intel X86-64 architecture, I would suggest to use pin tools: PIN for Ubuntu. There has been a plug-in built, namely, MICA on top of it which can instrument independently. One of the 99 outputs is exactly "Floating-point". Look into "Arithmetic-control flows" and "SSE/MMX" as well since based on the compiler different registers are being used. This makes sure you are monitoring all floating points.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top