IPR-NIOS Altera, IPR-NIOS Datasheet - Page 29

no-image

IPR-NIOS

Manufacturer Part Number
IPR-NIOS
Description
IP NIOS II MEGACORE RENEW
Manufacturer
Altera
Type
MegaCorer
Datasheet

Specifications of IPR-NIOS

License
Renewal License
Lead Free Status / RoHS Status
Not applicable / Not applicable
Chapter 2: Processor Architecture
Arithmetic Logic Unit
December 2010 Altera Corporation
1
All the floating-point custom instructions are single-precision operations.
Double-precision floating-point operations are implemented in software.
When the floating-point custom instructions are not present, the Nios II compiler
treats floating-point constants as double-precision values. However, with the
floating-point custom instructions, the Nios II compiler treats floating-point constants
as single-precision numbers by default. This allows all floating-point expressions to
be evaluated in hardware, at a possible cost in precision.
If you do not wish floating-point constants to be cast down to single precision values,
append L to each constant value, to instruct the compiler to treat the constant as a
double-precision floating-point value. In this case, if an expression contains a
floating-point constant, each term in the expression is cast to double precision. As a
result, the expression is computed with software-implemented double-precision
arithmetic, at a possible cost in computation speed.
Table 2–3
computation is implemented.
Table 2–3. Floating-Point Constant Examples
With the GCC 4 compiler toolchain, precompiled libraries are compiled with
double-precision floating-point constants. The behavior of precompiled floating-point
library functions such as sin() and cos() is unaffected by the presence of the
floating-point custom instructions.
b = a × 4.67
b = a × 4.67f
b = a × 4.67L
b = a × 4.67
b = a × 4.67f
b = a × 4.67L
Example Code
shows code examples using floating-point constants, indicating how each
Custom Instructions
Floating-Point
Present?
Yes
Yes
Yes
No
No
No
Precision
Double
Double
Double
Single
Single
Single
Nios II Processor Reference Handbook
Implementation
Hardware
Hardware
Software
Software
Software
Software
2–7

Related parts for IPR-NIOS