+, -, *, /, sin etc.
Write a program that approximates the
minimal
time to perform
an addition
an addition-multiplication pair
a division
elementary functions (test sin and exp for example)
What times did you get? Gflops? Are the values reasonable? Comments?
If you are studying the assembly output, it may be good to know that on the math-computers:
fmuld
is a double precision multiplication using the
x87-unit. It can produce a product ever clock cycle.
mulsd
is a vector operation forming the product of two numbers every
clock cycle
mulpd
is a vector operation with two pairs, it can form two
products every clock cycle.
vmulpd is a vector operation with four pairs, it can form four
products every clock cycle.
The same is true for the corresponding add-instructions.
So, it makes a difference if you have use vectorization or not.
For more information about the performance
of arithmetic operations, see http://www.agner.org/optimize/instruction_tables.pdf. Look in the handouts to find out the properties of the math-computers.