--
--	Inmos Libraries
--	Copyright (C) 1988, 1989, 1990, 1991, 1993  Inmos Limited
--
--	This library is free software; you can redistribute it and/or
--	modify it under the terms of the GNU Lesser General Public
--	License as published by the Free Software Foundation; either
--	version 2 of the License, or (at your option) any later version.
--
--	This library is distributed in the hope that it will be useful,
--	but WITHOUT ANY WARRANTY; without even the implied warranty of
--	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--	Lesser General Public License for more details.
--
--	You should have received a copy of the GNU Lesser General Public
--	License along with this library; if not, write to the Free Software
--	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
--

--** @module forall

--{{{  #options and #comments
#OPTION "E V"  -- no compiler libs, no vector space
#COMMENT "T8 compiler library, V1.1 21/02/89"
#COMMENT "(c) Copyright INMOS Limited 1988"
--}}}

#PRAGMA TRANSLATE DCOPYSIGN "DCOPYSIGN%O"

--{{{  DCOPYSIGN T2, TA & T8
REAL64 FUNCTION DCOPYSIGN (VAL REAL64 Y, Z)

  -- Function version (10 Jun 87)
  -- V1.1, 21-Feb-89
  -- Amalgamated T2, TA and T8 code; 20-Jun-90 SRH

  #INCLUDE "endian.inc" -- 4-Sep-07

  REAL64 X :
  VALOF
    []INT32 X RETYPES X:
    VAL []INT32 Y RETYPES Y:
    VAL []INT32 Z RETYPES Z:
    VAL SignBit IS #80000000(INT32) :
    SEQ
      X [hi] := (Z [hi] /\ SignBit) \/ (Y [hi] /\ (~SignBit))
      X [lo] := Y [lo]
    RESULT X
:
--}}}
