Back to index

glibc  2.9
Functions
ots_cmp.c File Reference
#include "local-soft-fp.h"

Go to the source code of this file.

Functions

static long internal_equality (long al, long ah, long bl, long bh, long neq)
long _OtsEqlX (long al, long ah, long bl, long bh)
long _OtsNeqX (long al, long ah, long bl, long bh)

Function Documentation

long _OtsEqlX ( long  al,
long  ah,
long  bl,
long  bh 
)

Definition at line 55 of file ots_cmp.c.

{
  return internal_equality (al, ah, bl, bh, 0);
}

Here is the call graph for this function:

long _OtsNeqX ( long  al,
long  ah,
long  bl,
long  bh 
)

Definition at line 61 of file ots_cmp.c.

{
  return internal_equality (al, ah, bl, bh, 1);
}

Here is the call graph for this function:

static long internal_equality ( long  al,
long  ah,
long  bl,
long  bh,
long  neq 
) [static]

Definition at line 25 of file ots_cmp.c.

{
  FP_DECL_EX;
  FP_DECL_Q(A); FP_DECL_Q(B);
  long r;

  FP_UNPACK_RAW_Q(A, a);
  FP_UNPACK_RAW_Q(B, b);

  if ((A_e == _FP_EXPMAX_Q && !_FP_FRAC_ZEROP_2(A))
       || (B_e == _FP_EXPMAX_Q && !_FP_FRAC_ZEROP_2(B)))
    {
      /* EQ and NE signal invalid operation only if either operand is SNaN.  */
      if (FP_ISSIGNAN_Q(A) || FP_ISSIGNAN_Q(B))
       {
         FP_SET_EXCEPTION(FP_EX_INVALID);
         FP_HANDLE_EXCEPTIONS;
       }
      return -1;
    }

  r = (A_e == B_e
       && _FP_FRAC_EQ_2 (A, B)
       && (A_s == B_s || (!A_e && _FP_FRAC_ZEROP_2(A))));
  r ^= neq;

  return r;
}

Here is the caller graph for this function: