Back to index

glibc  2.9
addsf3.c
Go to the documentation of this file.
00001 /* Software floating-point emulation.
00002    Return a + b
00003    Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005    Contributed by Richard Henderson (rth@cygnus.com) and
00006                 Jakub Jelinek (jj@ultra.linux.cz).
00007 
00008    The GNU C Library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Lesser General Public
00010    License as published by the Free Software Foundation; either
00011    version 2.1 of the License, or (at your option) any later version.
00012 
00013    In addition to the permissions in the GNU Lesser General Public
00014    License, the Free Software Foundation gives you unlimited
00015    permission to link the compiled version of this file into
00016    combinations with other programs, and to distribute those
00017    combinations without any restriction coming from the use of this
00018    file.  (The Lesser General Public License restrictions do apply in
00019    other respects; for example, they cover modification of the file,
00020    and distribution when not linked into a combine executable.)
00021 
00022    The GNU C Library is distributed in the hope that it will be useful,
00023    but WITHOUT ANY WARRANTY; without even the implied warranty of
00024    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00025    Lesser General Public License for more details.
00026 
00027    You should have received a copy of the GNU Lesser General Public
00028    License along with the GNU C Library; if not, write to the Free
00029    Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
00030    MA 02110-1301, USA.  */
00031 
00032 #include "soft-fp.h"
00033 #include "single.h"
00034 
00035 SFtype __addsf3(SFtype a, SFtype b)
00036 {
00037   FP_DECL_EX;
00038   FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R);
00039   SFtype r;
00040 
00041   FP_INIT_ROUNDMODE;
00042   FP_UNPACK_SEMIRAW_S(A, a);
00043   FP_UNPACK_SEMIRAW_S(B, b);
00044   FP_ADD_S(R, A, B);
00045   FP_PACK_SEMIRAW_S(r, R);
00046   FP_HANDLE_EXCEPTIONS;
00047 
00048   return r;
00049 }
00050