Visible to Intel only — GUID: iga1409260211362
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: iga1409260211362
Ixiasoft
5. Introduction to Nios® II Floating Point Custom Instructions
The Nios II architecture supports single precision floating point instructions with either of two optional components:
- Floating point hardware 22 (FPH2)—This component supports floating point instructions as specified by the IEEE Std 754-2008 but with simplified, non-standard rounding modes. The basic set of floating point custom instructions includes single precision floating point addition, subtraction, multiplication, division, square root, integer to float conversion, float to integer conversion, minimum, maximum, negate, absolute, and comparisons.
- Floating point hardware (FPH1)—This component supports floating point instructions as specified by the IEEE Std 754-1985. The basic set of floating point custom instructions includes single-precision floating point addition, subtraction, and multiplication. Floating point division is available as an extension to the basic instruction set.
Note: For optimum performance and device footprint, Intel recommends using FPH2 rather than FPH1.
These floating point instructions are implemented as custom instructions. The table below lists a detailed description of the conformance to the IEEE standards.
Feature | Floating Point Hardware Implementation with IEEE 754-1985 | Floating Point Hardware 2 Implementation with IEEE 754-2008 | |
---|---|---|---|
Operations | Addition/subtraction | Implemented | Implemented |
Multiplication | Implemented | Implemented | |
Division | Optional | Implemented | |
Square root | Not implemented, this operation is implemented in software. | Implemented | |
Integer to float/float to integer | Not implemented, this operation is implemented in software. | Implemented | |
Minimum/maximum | Not implemented, this operation is implemented in software. | Implemented | |
Negate/absolute | Not implemented, this operation is implemented in software. | Implemented | |
Comparisons | Not implemented, this operation is implemented in software. | Implemented | |
Precision | Single | Implemented | Implemented |
Double | Not implemented. Double precision operations are implemented in software. | Not implemented. Double precision operations are implemented in software. | |
Exception conditions | Invalid operation | Result is Not a Number (NaN) | Result is Not a Number (NaN) |
Division by zero | Result is ±infinity | Result is ±infinity | |
Overflow | Result is ±infinity | Result is ±infinity | |
Inexact | Result is a normal number | Result is a normal number | |
Underflow | Result is ±0 | Result is ±0 | |
Rounding Modes | Round to nearest | Implemented | Implemented (roundTiesToAway mode) |
Round toward zero | Not implemented | Implemented (truncation mode) | |
Round toward +infinity | Not implemented | Not implemented | |
Round toward –infinity | Not implemented | Not implemented | |
NaN | Quiet | Implemented | No distinction is made between signaling and quiet NaNs as input operands. A result that produces a NaN may produce either a signaling or quiet NaN. |
Signaling | Not implemented | ||
Subnormal (denormalized) numbers | Subnormal operands are treated as zero. The FPH2 custom instructions do not generate subnormal numbers. |
|
|
Software exceptions | Not implemented. IEEE 754-1985 exception conditions are detected and handled as described elsewhere in this table. | Not implemented. IEEE 754-2008 exception conditions are detected and handled as described elsewhere in this table.3 | |
Status flags | Not implemented. IEEE 754-1985 exception conditions are detected and handled as described elsewhere in this table. | Not implemented. IEEE 754-2008 exception conditions are detected and handled as described elsewhere in this table.3 |
Note: The FPH2 component also supports faithful rounding, which is not an IEEE 754-defined rounding mode. Faithful rounding rounds results to either the upper or lower nearest single-precision numbers. Therefore, the result produced is one of two possible values and the choice between the two is not defined. The maximum error of faithful rounding is 1 unit in the last place (ulp). Errors may not be evenly distributed.
Section Content
Floating Point Background
IEEE 754 Format
Rounding Schemes
Special Floating Point Cases
2 Second generation
3 This operation is not fully compliant with IEEE 754-2008.