Altera_Forum
Honored Contributor
19 years agoHow to use fpu custom instruction ?
I work on a NIOSII with a fpu provided by Altera (taking into account +, -, *, and / operations on float). So when I write C code : A + B (where A and B are float type), assembler code use custom instruction (instead of 'addsf2' function call).
When I look to the Compiler (nios2-elf-g++ - version 3.4.1 installed with NIOSII IDE v6.0) option flag, the option '-mcustom-fpu-cfg=60-2' is set. Now, I use a complement fpu instructions (for float comparisons and cast to integer type) thanks to custom instructions (I use at the same time the Altera's fpu). So when I write C code : A > B (where A and B are float type), assembler code DO NOT use custom instruction (but use math library function "gtsf2" call). I just want to have the custom instruction call in place of 'gtsf2' function call (Important, I want to avoid the instruction 'call __gtsf2'). what is the way for use custom instruction call in place of gtsf2 function call ?