1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
3 <!--Converted with LaTeX2HTML 99.1 release (March 30, 1999)
4 original version by: Nikos Drakos, CBLU, University of Leeds
5 * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
6 * with significant contributions from:
7 Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
10 <TITLE>3.15 Floating Point Support</TITLE>
11 <META NAME="description" CONTENT="3.15 Floating Point Support">
12 <META NAME="keywords" CONTENT="sdccman">
13 <META NAME="resource-type" CONTENT="document">
14 <META NAME="distribution" CONTENT="global">
16 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17 <META NAME="Generator" CONTENT="LaTeX2HTML v99.1 release">
18 <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
20 <LINK REL="STYLESHEET" HREF="sdccman.css">
22 <LINK REL="next" HREF="node35.html">
23 <LINK REL="previous" HREF="node33.html">
24 <LINK REL="up" HREF="node19.html">
25 <LINK REL="next" HREF="node35.html">
29 <!--Navigation Panel-->
32 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A>
35 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A>
38 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A>
41 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A>
44 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A>
46 <B> Next:</B> <A NAME="tex2html753"
47 HREF="node35.html">3.16 MCS51 Memory Models</A>
48 <B> Up:</B> <A NAME="tex2html747"
49 HREF="node19.html">3. Using SDCC</A>
50 <B> Previous:</B> <A NAME="tex2html741"
51 HREF="node33.html">3.14 int(16 bit) and</A>
52   <B> <A NAME="tex2html749"
53 HREF="node1.html">Contents</A></B>
54   <B> <A NAME="tex2html751"
55 HREF="node61.html">Index</A></B>
58 <!--End of Navigation Panel-->
60 <H2><A NAME="SECTION000415000000000000000">
61 3.15 Floating Point Support</A>
65 SDCC supports IEEE (single precision 4bytes) floating point numbers.The
66 floating point support routines are derived from gcc's floatlib.c
67 and consists of the following routines:
71 <I><pending: tabularise this></I>
75 _fsadd.c - add floating point numbers
77 _fssub.c - subtract floating point numbers
79 _fsdiv.c - divide floating point numbers
81 _fsmul.c - multiply floating point numbers
83 _fs2uchar.c - convert floating point to unsigned char
85 _fs2char.c - convert floating point to signed char
87 _fs2uint.c - convert floating point to unsigned int
89 _fs2int.c - convert floating point to signed int
91 _fs2ulong.c - convert floating point to unsigned long
93 _fs2long.c - convert floating point to signed long
95 _uchar2fs.c - convert unsigned char to floating point
97 _char2fs.c - convert char to floating point number
99 _uint2fs.c - convert unsigned int to floating point
101 _int2fs.c - convert int to floating point numbers
103 _ulong2fs.c - convert unsigned long to floating point number
105 _long2fs.c - convert long to floating point number
109 Note if all these routines are used simultaneously the data space
110 might overflow. For serious floating point usage it is strongly recommended
111 that the large model be used.
115 <!--Navigation Panel-->
116 <A NAME="tex2html752"
118 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next_motif.gif"></A>
119 <A NAME="tex2html746"
121 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up_motif.gif"></A>
122 <A NAME="tex2html740"
124 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="previous_motif.gif"></A>
125 <A NAME="tex2html748"
127 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents_motif.gif"></A>
128 <A NAME="tex2html750"
130 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index_motif.gif"></A>
132 <B> Next:</B> <A NAME="tex2html753"
133 HREF="node35.html">3.16 MCS51 Memory Models</A>
134 <B> Up:</B> <A NAME="tex2html747"
135 HREF="node19.html">3. Using SDCC</A>
136 <B> Previous:</B> <A NAME="tex2html741"
137 HREF="node33.html">3.14 int(16 bit) and</A>
138   <B> <A NAME="tex2html749"
139 HREF="node1.html">Contents</A></B>
140   <B> <A NAME="tex2html751"
141 HREF="node61.html">Index</A></B>
142 <!--End of Navigation Panel-->
145 <BR><I>2001-07-13</I>