Forum Discussion
Altera_Forum
Honored Contributor
19 years ago...Settings/Compiler/General and set the optimization level to -O1 instead of the default of -O2. Then when I looked at the generated .s file, I saw the code written by the compiler was correct ...<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18262)</div>
--- Quote End --- I confirm the behaviour of nios2-gcc, when I set (in Debug or Release mode) an optimization option (-O1 or -O2), and I write A + B (with A and B are float type) with the Altera's fpu, there is not "custom" instruction in assembler. If I use no optimization option (-O0), custom instruction is used (in release or debug mode)!!! For my project, I do not use optimization option (-O0), so altera's fpu custom instruction is used (only for +, -, /, * operations). That is OK. But for other float oprations (like >,<, cast into int, ...), I use my own fpu part, 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). So, what is the way for use custom instruction call in place of gtsf2 function call ?