subsf3.c revision 272461
1122142Sphk/* Software floating-point emulation. 2122142Sphk Return a - b 3122142Sphk Copyright (C) 1997,1999,2006 Free Software Foundation, Inc. 4122142Sphk This file is part of the GNU C Library. 5122142Sphk Contributed by Richard Henderson (rth@cygnus.com) and 6122142Sphk Jakub Jelinek (jj@ultra.linux.cz). 7122142Sphk 8122142Sphk The GNU C Library is free software; you can redistribute it and/or 9122142Sphk modify it under the terms of the GNU Lesser General Public 10122142Sphk License as published by the Free Software Foundation; either 11122142Sphk version 2.1 of the License, or (at your option) any later version. 12122142Sphk 13122142Sphk In addition to the permissions in the GNU Lesser General Public 14122142Sphk License, the Free Software Foundation gives you unlimited 15122142Sphk permission to link the compiled version of this file into 16122142Sphk combinations with other programs, and to distribute those 17122142Sphk combinations without any restriction coming from the use of this 18144295Stobez file. (The Lesser General Public License restrictions do apply in 19122142Sphk other respects; for example, they cover modification of the file, 20122142Sphk and distribution when not linked into a combine executable.) 21122142Sphk 22122142Sphk The GNU C Library is distributed in the hope that it will be useful, 23122142Sphk but WITHOUT ANY WARRANTY; without even the implied warranty of 24122142Sphk MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25122142Sphk Lesser General Public License for more details. 26122142Sphk 27122142Sphk You should have received a copy of the GNU Lesser General Public 28122142Sphk License along with the GNU C Library; if not, write to the Free 29122142Sphk Software Foundation, 51 Franklin Street, Fifth Floor, Boston, 30122142Sphk MA 02110-1301, USA. */ 31122142Sphk 32122142Sphk#include "soft-fp.h" 33122142Sphk#include "single.h" 34122142Sphk 35122142SphkSFtype __subsf3(SFtype a, SFtype b) 36122142Sphk{ 37122142Sphk FP_DECL_EX; 38122142Sphk FP_DECL_S(A); FP_DECL_S(B); FP_DECL_S(R); 39122142Sphk SFtype r; 40122142Sphk 41122142Sphk FP_INIT_ROUNDMODE; 42122142Sphk FP_UNPACK_SEMIRAW_S(A, a); 43122142Sphk FP_UNPACK_SEMIRAW_S(B, b); 44122142Sphk FP_SUB_S(R, A, B); 45122142Sphk FP_PACK_SEMIRAW_S(r, R); 46122142Sphk FP_HANDLE_EXCEPTIONS; 47122142Sphk 48122142Sphk return r; 49122142Sphk} 50122142Sphk