Forum Discussion

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

inlined __mulsi3 ?

Hello,

Anyone nows how I can get an inlined call to __mulsi3 in my project?

I want to use a custom multiplier, and I can get it into the executable (overriding the library version). the problem is that I have still the overhead of calling __mulsi3.

Stefaan

3 Replies

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

    Hi svhb,

    can u tell us more? Have u built a custom istruction?or what?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Are the multiplier options provided with Nios II insufficient somehow?

    If so, I'd like to hear about your needs.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    I have a custom instruction that is roughly doing the same thing as the library mulsi, just adding and shifting. It is not a single cycle mutliplier, but it takes much less cycles as the software version. It is posted already al long time ago in the "Post your own IP" section.

    I just want to know if it is possible to have a "custom ..." assembler statement in the code instead of the call to __mulsi3. I tried with inline __mulsi3 but then it is using the library version. If I not inline it, it is using my custom __mulsi3 implementation.

    Like it is now the __mulsi3 does just the custom instruction and a return. But this is an overhead for doing nothing.

    I think recompiling libraries and so is a bit over the top of the experience I have at the moment. But I want to try if someone gives me some good starting points.

    Can you tell me how much cycles the Logic element version of the multiplier takes in a Cyclone? And maybe also how big it is (otherwise I can compile it if I have some time).

    Stefaan.