Visible to Intel only — GUID: lro1432134864408
Ixiasoft
1. Nios II Custom Instruction Overview
2. Custom Instruction Hardware Interface
3. Custom Instruction Software Interface
4. Design Example: Cyclic Redundancy Check
5. Introduction to Nios® II Floating Point Custom Instructions
6. Nios II Floating Point Hardware 2 Component
7. Nios® II Floating Point Hardware (FPH1) Component
8. Document Revision History for Nios II Custom Instruction User Guide
4.1.1. Setting up the Environment for the CRC Example Design
4.1.2. Opening the Component Editor
4.1.3. Specifying the Custom Instruction Component Type
4.1.4. Displaying the Custom Instruction Block Symbol
4.1.5. Adding the CRC Custom Instruction HDL Files
4.1.6. Configuring the Custom Instruction Parameter Type
4.1.7. Setting Up the CRC Custom Instruction Interfaces
4.1.8. Configuring the Custom Instruction Signal Type
4.1.9. Saving and Adding the CRC Custom Instruction
4.1.10. Generating and Compiling the CRC Example System
6.1. Overview of the Floating Point Hardware 2 Component
6.2. Floating Point Hardware 2 IEEE 754 Compliance
6.3. IEEE 754 Exception Conditions with FPH2
6.4. Floating Point Hardware 2 Operations
6.5. Building the FPH2 Example Hardware
6.6. Building the FPH2 Example Software
6.7. FPH2 Implementation of GCC Options
6.8. Nios II FPH2 and the Newlib Library
6.9. C Macros for round(), fmins(), and fmaxs()
Visible to Intel only — GUID: lro1432134864408
Ixiasoft
6.4. Floating Point Hardware 2 Operations
The table below provides a detailed summary of the FPH2 operations. The values “a” and “b” are assumed to be single-precision floating point values. The following list provides detailed information about each column:
- Operation 8—Provides the name of the floating point operation. The names match the names of the corresponding GCC floating point command-line options except for “round”, which has no GCC support.
- N—Provides the 8-bit fixed custom instruction N value for the operation. FPH2 component uses fixed N values that occupy the top 32 Nios II custom instruction N values (224 to 255). The FPH1 also use fixed N values (252 to 255) and the FPH2 assign the same operations to those N values to maintain compatibility.
- Cycle 9—Specifies the number of cycles it takes to execute the instruction. A combinatorial custom instruction takes 1 cycle. A multi-cycle custom instruction always requires at least 2 cycles. An N-cycle custom instruction has N-2 register stages inside the custom instruction because the Nios II registers the result from the custom instruction and also allows another cycle for g wire delays in the source operand bypass multiplexers. The Cycle column does not include the extra cycles (maximum of 2) required because the Nios II/f processor stalls the instruction following the multi-cycle custom instruction if that instruction uses the result within 2 cycles. These extra cycles are required because multi-cycle instructions are late-result instructions.
- Result—Describes the computation performed by the operation.
- Subnormal—Describes how the operation treats subnormal inputs and subnormal outputs.
- Rounding 10—Describes how the FPH2 component rounds the result. The possible choices are Nearest, Truncation, Faithful, and none.
- GCC Inference—Shows the C code from which GCC infers the custom instruction operation.
Operation | N | Cycles | Result | Subnormal | Rounding | GCC Inference |
---|---|---|---|---|---|---|
fdivs | 255 | 16 | a/b | flush-to-0 | Nearest | a/b |
fsubs | 254 | 5 | a-b | flush-to-0 | Faithful | a-b |
fadds | 253 | 5 | a+b | flush-to-0 | Faithful | a+b |
fmuls | 252 | 4 | a*b | flush-to-0 | Faithful | a*b |
fsqrts | 251 | 8 | sqrt(a) | flush-to-0 | Faithful | sqrtf() |
floatis | 250 | 4 | int_to_float(a) | Does not apply | Does not apply | Casting |
fixsi | 249 | 2 | float_to_int(a) | flush-to-0 | Truncation | Casting |
round | 248 | 2 | float_to_int(a) | flush-to-0 | Nearest | lroundf()11 |
reserved | 234 to 247 | Undefined | undefined | |||
fmins | 233 | 1 | (a<b) ? a : b | supported | None | fminf()11 |
fmaxs | 232 | 1 | (a<b) ? b : a | supported | None | fmaxf()11 |
fcmplts | 231 | 1 | (a<b) ? 1 : 0 | supported | None | a<b |
fcmples | 230 | 1 | (a≤b) ? 1 : 0 | supported | None | a<=b |
fcmpgts | 229 | 1 | (a>b) ? 1 : 0 | supported | None | a>b |
fcmpges | 228 | 1 | (a≥b) ? 1 : 0 | supported | None | a>=b |
fcmpeqs | 227 | 1 | (a=b) ? 1 : 0 | supported | None | a==b |
fcmpnes | 226 | 1 | (a≠b) ? 1 : 0 | supported | None | a!=b |
fnegs | 225 | 1 | -a | supported | None | -a |
fabss | 224 | 1 | |a| | supported | None | fabsf() |
Related Information
8 For more information, refer to "-mcustom-<operation>".
9 For more information, refer to the Nios II Processor Reference Guide.
10 For more information, refer to "Rounding Schemes". A rounding of “none” means that the result does not need to be rounded.
11 Nios II GCC cannot reliably replace calls to these newlib floating point functions with the equivalent custom instruction. For information about using these functions, refer to "C Macros for round(), fmins(), and fmaxs()".