S5U1C17001C ManUal
EPSOn
7-5
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
7 liBrary
7
Library
floating-point format
The
xgcc
C compiler supports the
float
type (32-bit single-precision) and the
double
type (64-bit double-
precision) floating-point numbers conforming to IEEE standards.
The following shows the internal format of floating-point numbers.
format of double-precision floating-point number
The real number of the
double
type consists of 64 bits, as shown below.
63 62
52 51
0
S
Exponent part
Fixed-point part
Bit 63:
Sign bit (1 bit)
Bits 62–52: Exponent part (11 bits)
Bits 51–0: Fixed-point part (52 bits)
The result of a floating-point calculation is stored in the 64-bit area beginning with the address loaded in
the
%r0
register.
The following shows the relationship of the effective range, floating-point representation, and internal data
of the
double
type.
+0:
0.0e+0
0x00000000 00000000
-0:
-0.0e+0
0x80000000 00000000
Maximum normalized number:
1.308
0x7fefffff ffffffff
Minimum normalized number:
2.22507e-308
0x00100000 00000000
Maximum unnormalized number:
2.22507e-308
0x000fffff ffffffff
Minimum unnormalized number:
4.94065e-324
0x00000000 00000001
Infinity:
0x7ff00000 00000000
Negative infinity:
0xfff00000 00000000
Values
0x7ff00000 00000001
to
0x7fffffff ffffffff
and
0xfff00000 00000001
to
0xffffffff ffffffff
are not recognized as numeric values.
format of single-precision floating-point number
The real number of the
float
type consists of 32 bits, as shown below.
31 30
23 22
0
S
Exponent part
Fixed-point part
Bit 31:
Sign bit (1 bit)
Bits 30–23: Exponent part (8 bits)
Bits 22–0: Fixed-point part (23 bits)
This type of value occupies two registers. For example, the result of a floating-point calculation is stored in
the
%r1
and
%r0
registers.
%r1
register: Sign bit, exponent part, and 7 high-order bits of fixed-point part (22:16)
%r0
register: 16 low-order bits of fixed-point part (15:0)
The following shows the relationship of the effective range, floating-point representation, and internal data
of the
float
type.
+0:
0.0e+0f
0x00000000
-0:
-0.0e+0f
0x80000000
Maximum normalized number:
3.38f
0x7f7fffff
Minimum normalized number:
1.17549e-38f
0x00800000
Maximum unnormalized number:
1.17549e-38f
0x007fffff
Minimum unnormalized number:
1.40129e-45f
0x00000001
Infinity:
0x7f800000
Negative infinity:
0xff800000
Values
0x7f800001
to
0x7fffffff
and
0xff800001
to
0xffffffff
are not recognized as
numeric values.
note
The floating-point numbers in the
xgcc
C compiler differ from the IEEE-based FPU in precision and
functionality, including the manner in which infinity is handled.
Summary of Contents for S5U1C17001C
Page 6: ......
Page 17: ...1 General S5U1C17001C Manual 1 General ...
Page 18: ......
Page 21: ...1 2 Install S5U1C17001C Manual 2 Installation ...
Page 22: ......
Page 29: ...3 SoftDev S5U1C17001C Manual 3 Software Development Procedures ...
Page 30: ......
Page 103: ...4 SrcFiles S5U1C17001C Manual 4 Source files ...
Page 104: ......
Page 121: ...5 IDE S5U1C17001C Manual 5 gnU17 iDE ...
Page 122: ......
Page 365: ...6 Compiler S5U1C17001C Manual 6 C Compiler ...
Page 366: ......
Page 385: ...7 Library S5U1C17001C Manual 7 library ...
Page 386: ......
Page 405: ...8 Assemblr S5U1C17001C Manual 8 assembler ...
Page 406: ......
Page 439: ...9 Linker S5U1C17001C Manual 9 linker ...
Page 440: ......
Page 449: ...10 Debugger S5U1C17001C Manual 10 Debugger ...
Page 450: ......
Page 626: ...11 Tools S5U1C17001C Manual 11 Other Tools ...
Page 627: ......
Page 696: ...S1C17 Family C Compiler Package Quick Reference Reference ...