Floating-Point Calculation Functions - Epson S5U1C17001C Manual

Cmos 16-bit single chip microcomputer, c compiler package for s1c17 family
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

7 liBrary

7.2.2 floating-point Calculation functions

function list
Table 7.2.2.1 below lists the floating-point calculation functions.
Classification
function name
Double-precision
__adddf3
floating-point
__subdf3
calculation
__muldf3
__divdf3
__negdf2
Single-precision
__addsf3
floating-point
__subsf3
calculation
__mulsf3
__divsf3
__negsf2
Type conversion
__fixunsdfsi
__fixdfsi
__floatsidf
__fixunssfsi
__fixsfsi
__floatsisf
__truncdfsf2
__extendsfdf2 float → double
Double-precision
__fcmpd
floating-point
__eqdf2
comparison
__nedf2
__gtdf2
__gedf2
__ltdf2
__ledf2
Single-precision
__fcmps
floating-point
__eqsf2
comparison
__nesf2
__gtsf2
__gesf2
__ltsf2
__lesf2
• 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, as
shown below. Other flags are not changed.
Comparison result
7-4
Table 7.2.2.1 Floating-point calculation functions
Addition
Subtraction
Multiplication
Division
Sign inversion
Addition
Subtraction
Multiplication
Division
Sign inversion
double → unsigned long
double → long
long → double
float → unsigned long
float → long
long → float
double → float
Comparison of double type
Comparison of double type (a = b) PSR change ← a - b, x ← 0 | 1 *
Comparison of double type (a ≠ b) PSR change ← a - b, x ← 1 | 0 *
Comparison of double type (a > b) PSR change ← a - b, x ← 1 | 0 *
Comparison of double type (a ≥ b) PSR change ← a - b, x ← 0 | -1 *
Comparison of double type (a < b) PSR change ← a - b, x ← -1 | 0 *
Comparison of double type (a ≤ b) PSR change ← a - b, x ← 0 | 1 *
Comparison of float type
Comparison of float type (a = b) PSR change ← a - b, x ← 0 | 1 *
Comparison of float type (a ≠ b)
Comparison of float type (a > b) PSR change ← a - b, x ← 1 | 0 *
Comparison of float type (a ≥ b)
Comparison of float type (a < b) PSR change ← a - b, x ← -1 | 0 *
Comparison of float type (a ≤ b)
C
op1 > op2
0
op1 = op2
0
op1 < op2
1
EPSOn
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
PSR change ← a - b
PSR change ← a - b
PSR change ← a - b, x ← 1 | 0 *
PSR change ← a - b, x ← 0 | -1 *
PSR change ← a - b, x ← 0 | 1 *
* x = the value at left if true, x = the value at right if false
V
Z
n
0
0
0
0
1
0
0
0
1
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
S5U1C17001C ManUal

Advertisement

Table of Contents
loading

Table of Contents