Altera_Forum
Honored Contributor
15 years agolong long division does not make use of the HW divider
My NIOSII has configured hw divider. When I look into the OBJDUMP of divide operation of 2 integers (32 bits), I see that the operation is proprly done by a single "div" instruction.
However - when the dividend of the operation is long long - for example int tmp1, tmp2, tmp3; tmp3 = ((long long) tmp2)/tmp1 ; Then the generated code is very long, using what seems as a built-in procedure __divdi3 , which has long code. What seems strange is that the built-in procedure don't use the resource of hw dividers at all : the instruction div does not appear in the code. I want to avoid the long code, in order to reduce instruction memory resource, and speed the application. Are you familiar with this issue? Thanks, Dani