Forum Discussion

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

Floating point custom instruction in nios2

To perform the floating point multiplication in the Floating Point Custom Instruction which is inbuilt, how should I pass the values from the nios code?

Do I have to use a specific format for the numbers or use additional instructions in nios code for the floating point multiplication to be offloaded to the custom instruction hardware ?

1 Reply

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

    The custom instructions use the standard ieee format used by C for 'float' variables.

    If you want to use the custom instructions you need to ensure that you never use 'double' - so all constants need to be explictly marked (eg 1.5f).

    You may need to check carefully that none of the C library functions are unexpectedly called.