What do you know about it? which is the fastest? FMul or Mul, Fdiv or Div?
Posted on 2003-10-06 22:20:57 by realvampire
As a first observation, you should not compare FMUL to MUL because FMUL is always a signed multiplication while MUL in an unsigned multiplication. You would want to compare it to IMUL which is also a signed multiplication when used with a single operand. The same comment applies to the FDIV comparison.

Secondly, if you need the precision and/or range available with the FPU, the relative speed becomes immaterial. You would have no choice but to use the FP instructions.

Otherwise, if the range and precision of integer maths is acceptable, the CPU instructions will always be faster.

Remember that using the FPU with integers requires additional steps to transform it from the integer data format into the floating point data format before that data can be loaded into the FPU registers to perform the math operation. And the result then has to be converted back to the integer data format before transfering it back to memory.

Posted on 2003-10-07 10:05:23 by Raymond