Forum Discussion
Altera_Forum
Honored Contributor
16 years agoSubtracting 2 pointers is more likely to lead to a divide than a multiply!
Adding an integral value to a pointer is likely to generate a multiply. If the compiler doesn't generate a multiply, it can only generate a shift instead, and fast shifts require the 'mul' instruction. Certainly a sequence of shifts and adds (which would likely be faster than a multiply on a system with hardware shift but not multiply) is likely to always be slower on a Nios2. Try -fno-hw-mul