Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

2.12.2.3.1. Nios II Specific Changes

  • Use __buildin_custom_* instead of -mcustom-* or #pragma to reliably generate Nios II Floating Point Custom Instructions (FPCI), independent of compiler optimization level and command line flags.
  • To use -mcustom-* or #pragma for Nios II Floating Point Custom Instructions (FPCI):
    • The -ffinite-math-only flag must be used to generate fmins and fmax FPCI
    • The optimization (non -O0 flag) must be used to generate fsqrts FPCI
  • Users implementing transcendental functions in hardware must use the -funsafe-math-optimizations flag to generate the FPCI for the transcendental functions fsins(), fcoss(), ftans(), fatans(), fexps(), flogs() and corresponding double-precision functions.
  • The Pragma format has changed from eg. #pragma custom_fadds 253 to #pragma GCC target("custom-fadds=253") and function attributes provide an alternative format __attribute__((target("custom-fadds=253"))).
  • Use the -mel/-meb flags instead of -EL/-EB for endian settings. Software Build Tool for Eclipse (SBTE) users must regenerate the BSP for this setting to take effect.
  • The -mreverse-bitfields flag and reverse_bitfields pragma are no longer supported.
  • The -fstack-check flag must be used instead of -mstack-check to enable stack checking.