Forum Discussion
Altera_Forum
Honored Contributor
16 years ago --- Quote Start --- --- Quote Start --- by default, the nios ii compiler treats floating-point constants as double-precision numbers. To use the floating-point custom instructions for operations with floating-point constants, append an “f” to the constant. --- Quote End --- In your program, your variables and your constants are all double, so even if you add the floating point custom instruction (as in your case 2 and B), it should not be use it and all the calculus should be in double precision. --- Quote End --- Now the rules are following: 1. If custom fp instruction is added to Nios hardware, then compiler treats default constants as single precision, regardless disabling pragma directives. 2. If no custom fp instruction is present to Nios hardware, then compiler treats default constants as double precision. 3. In any case we can explicitely use suffixes 'F' or 'L to specify the constant precision. that will ensure that code generation is correct regardless nios implementation. Thanks to everyone.