Related Information
Nios II Custom Instruction User Guide
2.3.3.1. Nios II Floating Point Hardware 2 Component
Table 3.
Floating Point Custom Instruction 2 Operation Summary
In this table, a and b are assumed to be single-precision floating-point values.
Operation
(3)
N
(4)
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 x b
Flush to 0
Faithful
a * b
fsqrts
251
8
a
Faithful
sqrtf()
(
5
)
floatis
250
4
int_to_float(a)
Not applicable
Not applicable
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()
(
5
)
Reserved
234 to 247
Undefined
Undefined
fmins
233
1
(a < b) ? a : b
Supported
None
fminf()
(
5
)
fmaxs
232
1
(a < b) ? b : a
Supported
None
fmaxf()
(
5
)
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()
(3)
These names match the names of the corresponding GCC command-line options except for
round, which GCC does not support.
(4)
Specifies the 8 bit fixed custom instruction for the operation.
(5)
Nios II GCC version 4.7.3 is not able to reliably replace calls to newlib floating-point functions
with the equivalent custom instruction even though it has Flush to 0
-mcustom-
<operation>
command-line options and pragma support for these operations. Instead, the custom
instruction must be invoked directly using the GCC
__builtin_custom_*
facility. The
Floating Point Custom Instruction 2 component includes a C header file that provides the
required
#define
macros to invoke the custom instruction directly.
2. Processor Architecture
NII-PRG | 2018.04.18
Nios II Processor Reference Guide
20