Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

"div" instructions

Hi all,

/f configuration has hardware dvide instrucion.

I checked this option, but it seems that compiler does not use "div" instruction. (I cannot find div instruction in *.opjbump file.)

How can I do? Need some compiler option to use div instruction?

9 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I was wondering the same thing. I think that the compiler recongnizes "/" as the hardware divide but don't quote me on that.

    I really wish the object dump still had the associated C code that went with the instructions, because I find the new one to be a zoo

    of info that I either don't care about or can't figure out what it's telling me.

    I turned off the instruction emulation so I'm hoping that "/" called the hardware divide (just got done characterizing my timing).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It's a known bug. Already fixed in the upcoming release. Here was the workaround given...

    Put the -mhw-div option into the IDE compiler flags, and lo and behold a div instruction appears.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Don't count on what I did utilizing the hardware divider (just removed it and did my timing tests and they did not change).

    My question is the same koma's, how do you call it??? (from C code).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you! Compiler use div instrtuction!

    BTW, where can I find compiler option list? I'd like to know -m*** (machine depended option).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Here's what I do:

    nios2-elf-gcc --help -v >& out

    Then I edit the file "out" and search for "Target specific". You'll see the -m options there.

    Kerry
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually, that was KerrY.

    A little confusing, but there's KerrI and KerrY.