Floating-Point Calculation Functions - Epson S5U1C17001C Manual

Cmos 16-bit single chip microcontroller (c compiler package for s1c17 family) (ver. 3.1)
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

5 Library
5.3.2

Floating-point Calculation Functions

 Function list
Table 5.3.2.1 below lists the floating-point calculation functions.
Classification
Double-precision
floating-point
calculation
Single-precision
floating-point
calculation
Type conversion
Double-precision
floating-point
comparison
Single-precision
floating-point
comparison
If the operation resulted in an overflow or underflow, infinity or negative infinity (see next section) is returned.
The comparison function changes the C, V, Z or N flag of the PSR depending on the result of op1 - op2 (a-b), as shown
below. Other flags are not changed.
5-6
Table 5.3.2.1 Floating-point calculation functions
Function name
__adddf3
Addition
__subdf3
Subtraction
__muldf3
Multiplication
__divdf3
Division
__negdf2
Sign inversion
__addsf3
Addition
__subsf3
Subtraction
__mulsf3
Multiplication
__divsf3
Division
__negsf2
Sign inversion
__fixunsdfsi
double → unsigned int
__fixdfsi
double → int
__floatsidf
int → double
__fixunssfsi
float → unsigned int
__fixsfsi
float → int
__floatsisf
int → float
__truncdfsf2
double → float
__extendsfdf2
float → double
__fcmpd
Comparison of
__eqdf2
Comparison of
__nedf2
Comparison of
__gtdf2
Comparison of
__gedf2
Comparison of
__ltdf2
Comparison of
__ledf2
Comparison of
__fcmps
Comparison of float type
__eqsf2
Comparison of float type (a
__nesf2
Comparison of float type (a≠b)
__gtsf2
Comparison of float type (a>b)
__gesf2
Comparison of float type (a ε b)
__ltsf2
Comparison of float type (a<b)
__lesf2
Comparison of float type (a ≤ b)
Comparison result
op1 > op2
op1 = op2
op1 < op2
Seiko Epson Corporation
Functionality
x ← a + b
x ← a - b
x ← a * b
x ← a / b
x ← -a
x ← a + b
x ← a - b
x ← a * b
x ← a / b
x ← -a
x ← a
x ← a
x ← a
x ← a
x ← a
x ← a
x ← a
x ← a
double
type
PSR change← a - b
=
double
type (a
b)
PSR change ← a - b, x ← 0 | 1
double
PSR change ← a - b, x ← 1 | 0
type (a≠b)
double
PSR change ← a - b, x ← 1 | 0
type (a>b)
double
type (a ε b)
PSR change ← a - b, x ← 0 | -1
double
type (a<b)
PSR change ← a - b, x ← -1 | 0
double
type (a ≤ b)
PSR change ← a - b, x ← 0 | 1
PSR change ← a - b
=
b)
PSR change ← a - b, x ← 0 | 1
PSR change ← a - b, x ← 1 | 0
PSR change ← a - b, x ← 1 | 0
PSR change ← a - b, x ← 0 | -1
PSR change ← a - b, x ← -1 | 0
PSR change ← a - b, x ← 0 | 1
* x = the value at left if true, x = the value at right if false
C
V
Z
0
0
0
0
0
1
1
0
0
*
*
*
*
*
*
*
*
*
*
*
*
N
0
0
1
S5U1C17001C Manual
(Rev. 1.0)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the S5U1C17001C and is the answer not in the manual?

Questions and answers

Table of Contents