--
--	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
--

#IF NOT DEFINED(TARGET.HAS.FPU)

--{{{  #options and #comments
#OPTION "V"  -- no vector space
#COMMENT "TA compiler library, V1.2 12/02/90"
#COMMENT "(c) Copyright INMOS Limited 1988"
--}}}

#PRAGMA TRANSLATE DISNAN "DISNAN%O"
#PRAGMA TRANSLATE DORDERED "DORDERED%O"

#INCLUDE "realvals.inc"

#IF (TARGET.BITS.PER.WORD = 32)
--{{{  DISNAN
--{{{  TA
BOOL FUNCTION DISNAN (VAL REAL64 X)

  --  Beta-2 (27feb87)

  VAL [2]INT X RETYPES X :
  INT exp,frac :
  VALOF
    exp, frac := SHIFTLEFT (0, (X [1] <<1), DRealShift)
    RESULT (exp = DRealExp) AND ((frac \/ X [0]) <> 0)
:
--}}}
--}}}
#ENDIF -- TARGET.BITS.PER.WORD = 32
#IF (TARGET.BITS.PER.WORD = 16)
--{{{  DISNAN
--{{{  T2
BOOL FUNCTION DISNAN (VAL REAL64 X)

  -- Function version (25 Aug 87)

  VAL [4]INT X RETYPES X :
  INT exp,frac :
  VALOF
    exp, frac := SHIFTLEFT (0, (X [3] <<1), DRealShift)
    RESULT (exp = DRealExp) AND (((frac \/ X[2]) \/ (X[1] \/ X[0])) <> 0)
:
--}}}
--}}}
#ENDIF -- TARGET.BITS.PER.WORD = 16

--{{{  DORDERED
--{{{  T2 and TA code is the same
BOOL FUNCTION DORDERED (VAL REAL64 X, Y) IS (NOT (DISNAN(X) OR DISNAN(Y))) :
-- Function version (10 Jun 87)
--}}}
--}}}

#ENDIF
