Home | History | Annotate | Line # | Download | only in libbid
      1  1.12  mrg /* Copyright (C) 2007-2022 Free Software Foundation, Inc.
      2   1.1  mrg 
      3   1.1  mrg This file is part of GCC.
      4   1.1  mrg 
      5   1.1  mrg GCC is free software; you can redistribute it and/or modify it under
      6   1.1  mrg the terms of the GNU General Public License as published by the Free
      7   1.1  mrg Software Foundation; either version 3, or (at your option) any later
      8   1.1  mrg version.
      9   1.1  mrg 
     10   1.1  mrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     11   1.1  mrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
     12   1.1  mrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     13   1.1  mrg for more details.
     14   1.1  mrg 
     15   1.1  mrg Under Section 7 of GPL version 3, you are granted additional
     16   1.1  mrg permissions described in the GCC Runtime Library Exception, version
     17   1.1  mrg 3.1, as published by the Free Software Foundation.
     18   1.1  mrg 
     19   1.1  mrg You should have received a copy of the GNU General Public License and
     20   1.1  mrg a copy of the GCC Runtime Library Exception along with this program;
     21   1.1  mrg see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     22   1.1  mrg <http://www.gnu.org/licenses/>.  */
     23   1.1  mrg 
     24   1.1  mrg #include "bid_conf.h"
     25   1.1  mrg #include "bid_functions.h"
     26   1.1  mrg #include "bid_gcc_intrinsics.h"
     27   1.1  mrg 
     28   1.1  mrg _Decimal32
     29   1.1  mrg __bid_mulsd3 (_Decimal32 x, _Decimal32 y) {
     30   1.1  mrg   UINT64 x64, y64, res64;
     31   1.1  mrg   union decimal32 ux, uy, res;
     32   1.1  mrg 
     33   1.1  mrg   ux.d = x;
     34   1.1  mrg   uy.d = y;
     35   1.1  mrg   x64 = __bid32_to_bid64 (ux.i);
     36   1.1  mrg   y64 = __bid32_to_bid64 (uy.i);
     37   1.1  mrg   res64 = __bid64_mul (x64, y64);
     38   1.1  mrg   res.i = __bid64_to_bid32 (res64);
     39   1.1  mrg   return (res.d);
     40   1.1  mrg }
     41