OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libm/] [common/] [sf_fpclassify.c] - Blame information for rev 437

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Copyright (C) 2002,2007 by  Red Hat, Incorporated. All rights reserved.
2
 *
3
 * Permission to use, copy, modify, and distribute this software
4
 * is freely granted, provided that this notice is preserved.
5
 */
6
 
7
#include "fdlibm.h"
8
 
9
int
10
__fpclassifyf (float x)
11
{
12
  __uint32_t w;
13
 
14
  GET_FLOAT_WORD(w,x);
15
 
16
  if (w == 0x00000000 || w == 0x80000000)
17
    return FP_ZERO;
18
  else if ((w >= 0x00800000 && w <= 0x7f7fffff) ||
19
           (w >= 0x80800000 && w <= 0xff7fffff))
20
    return FP_NORMAL;
21
  else if ((w >= 0x00000001 && w <= 0x007fffff) ||
22
           (w >= 0x80000001 && w <= 0x807fffff))
23
    return FP_SUBNORMAL;
24
  else if (w == 0x7f800000 || w == 0xff800000)
25
    return FP_INFINITE;
26
  else
27
    return FP_NAN;
28
}
29
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.