197ec5308Schristos /* This is a software decimal floating point library.
2*dc268d07Schristos    Copyright (C) 2007-2018 Free Software Foundation, Inc.
397ec5308Schristos 
497ec5308Schristos This file is part of GCC.
597ec5308Schristos 
697ec5308Schristos GCC is free software; you can redistribute it and/or modify it under
797ec5308Schristos the terms of the GNU General Public License as published by the Free
897ec5308Schristos Software Foundation; either version 3, or (at your option) any later
997ec5308Schristos version.
1097ec5308Schristos 
1197ec5308Schristos GCC is distributed in the hope that it will be useful, but WITHOUT ANY
1297ec5308Schristos WARRANTY; without even the implied warranty of MERCHANTABILITY or
1397ec5308Schristos FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1497ec5308Schristos for more details.
1597ec5308Schristos 
1697ec5308Schristos Under Section 7 of GPL version 3, you are granted additional
1797ec5308Schristos permissions described in the GCC Runtime Library Exception, version
1897ec5308Schristos 3.1, as published by the Free Software Foundation.
1997ec5308Schristos 
2097ec5308Schristos You should have received a copy of the GNU General Public License and
2197ec5308Schristos a copy of the GCC Runtime Library Exception along with this program;
2297ec5308Schristos see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
2397ec5308Schristos <http://www.gnu.org/licenses/>.  */
2497ec5308Schristos 
2597ec5308Schristos /* This implements IEEE 754R decimal floating point arithmetic, but
2697ec5308Schristos    does not provide a mechanism for setting the rounding mode, or for
2797ec5308Schristos    generating or handling exceptions.  Conversions between decimal
2897ec5308Schristos    floating point types and other types depend on C library functions.
2997ec5308Schristos 
3097ec5308Schristos    Contributed by Ben Elliston  <bje@au.ibm.com>.  */
3197ec5308Schristos 
3297ec5308Schristos /* The intended way to use this file is to make two copies, add `#define '
3397ec5308Schristos    to one copy, then compile both copies and add them to libgcc.a.  */
3497ec5308Schristos 
3597ec5308Schristos #include <string.h>
3697ec5308Schristos #include "bid-dpd.h"
3797ec5308Schristos #include "decimal64.h"
3897ec5308Schristos 
3997ec5308Schristos void __host_to_ieee_64 (_Decimal64 in, decimal64 *out);
4097ec5308Schristos void __ieee_to_host_64 (decimal64 in, _Decimal64 *out);
4197ec5308Schristos 
4297ec5308Schristos void
__host_to_ieee_64(_Decimal64 in,decimal64 * out)4397ec5308Schristos __host_to_ieee_64 (_Decimal64 in, decimal64 *out)
4497ec5308Schristos {
4597ec5308Schristos   memcpy ((char *) out, (char *) &in, 8);
4697ec5308Schristos }
4797ec5308Schristos 
4897ec5308Schristos void
__ieee_to_host_64(decimal64 in,_Decimal64 * out)4997ec5308Schristos __ieee_to_host_64 (decimal64 in, _Decimal64 *out)
5097ec5308Schristos {
5197ec5308Schristos   memcpy ((char *) out, (char *) &in, 8);
5297ec5308Schristos }
53