Nios II Custom Instruction User Guide

ID 683242
Date 4/27/2020
Public
Document Table of Contents

6.6.3.1. -mcustom-<operation>

The -mcustom-<operation> command-line option instructs GCC to call custom instructions instead of emulating the specified operation. The syntax of the -mcustom-<operation> is as follows:

-mcustom-<operation>=N

N custom instruction value, an unsigned decimal. For a complete list of the operations and their N values, refer to the table in "Floating Point Hardware 2 Operations".

By default, the compiler implements all floating point operations in software. You can also specify software emulation for an individual instruction with the -mno-custom-<operation> command-line option.
Note: The command line can specify multiple -mcustom- switches. If there is a conflict, the last switch on the command line takes effect.

The following command-line options should be passed to GCC to instruct it to use all operations provided by the FPH2 that can be inferred by GCC. For more information, refer to "FPH2 and Nios II GCC".

For users of the Nios II SBT, these command-line arguments are automatically added to the invocation of GCC by the generated makefiles. For more information, refer to "Building the FPH2 Example Software".
-mcustom-fabss=224 
-mcustom-fnegs=225 
-mcustom-fcmpnes=226 
-mcustom-fcmpeqs=227 
-mcustom-fcmpges=228 
-mcustom-fcmpgts=229 
-mcustom-fcmples=230 
-mcustom-fcmplts=231 
-mcustom-fmins=232
-mcustom-fmaxs=233
-mcustom-round=248
-mcustom-fixsi=249 
-mcustom-floatis=250 
-mcustom-fmuls=252 
-mcustom-fadds=253 
-mcustom-fsubs=254 
-mcustom-fdivs=255
Note: There is no command-line option for the round operation.