1af526226Smrg /* Software floating-point emulation.
2af526226Smrg    Return a - b
3*8d286336Smrg    Copyright (C) 1997-2019 Free Software Foundation, Inc.
4af526226Smrg    This file is part of the GNU C Library.
5af526226Smrg    Contributed by Richard Henderson (rth@cygnus.com) and
6af526226Smrg 		  Jakub Jelinek (jj@ultra.linux.cz).
7af526226Smrg 
8af526226Smrg    The GNU C Library is free software; you can redistribute it and/or
9af526226Smrg    modify it under the terms of the GNU Lesser General Public
10af526226Smrg    License as published by the Free Software Foundation; either
11af526226Smrg    version 2.1 of the License, or (at your option) any later version.
12af526226Smrg 
13af526226Smrg    In addition to the permissions in the GNU Lesser General Public
14af526226Smrg    License, the Free Software Foundation gives you unlimited
15af526226Smrg    permission to link the compiled version of this file into
16af526226Smrg    combinations with other programs, and to distribute those
17af526226Smrg    combinations without any restriction coming from the use of this
18af526226Smrg    file.  (The Lesser General Public License restrictions do apply in
19af526226Smrg    other respects; for example, they cover modification of the file,
20af526226Smrg    and distribution when not linked into a combine executable.)
21af526226Smrg 
22af526226Smrg    The GNU C Library is distributed in the hope that it will be useful,
23af526226Smrg    but WITHOUT ANY WARRANTY; without even the implied warranty of
24af526226Smrg    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25af526226Smrg    Lesser General Public License for more details.
26af526226Smrg 
27af526226Smrg    You should have received a copy of the GNU Lesser General Public
28af526226Smrg    License along with the GNU C Library; if not, see
29af526226Smrg    <http://www.gnu.org/licenses/>.  */
30af526226Smrg 
31af526226Smrg #include "soft-fp.h"
32af526226Smrg #include "quad.h"
33af526226Smrg 
345ef59e75Smrg TFtype
__subtf3(TFtype a,TFtype b)355ef59e75Smrg __subtf3 (TFtype a, TFtype b)
36af526226Smrg {
37af526226Smrg   FP_DECL_EX;
385ef59e75Smrg   FP_DECL_Q (A);
395ef59e75Smrg   FP_DECL_Q (B);
405ef59e75Smrg   FP_DECL_Q (R);
41af526226Smrg   TFtype r;
42af526226Smrg 
43af526226Smrg   FP_INIT_ROUNDMODE;
44af526226Smrg   FP_UNPACK_SEMIRAW_Q (A, a);
45af526226Smrg   FP_UNPACK_SEMIRAW_Q (B, b);
46af526226Smrg   FP_SUB_Q (R, A, B);
47af526226Smrg   FP_PACK_SEMIRAW_Q (r, R);
48af526226Smrg   FP_HANDLE_EXCEPTIONS;
49af526226Smrg 
50af526226Smrg   return r;
51af526226Smrg }
52