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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [20110913-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 688 jeremybenn
struct ieee754_double {
2
  double d;
3
};
4
extern const float __exp_deltatable[178];
5
float __ieee754_expf (float x)
6
{
7
  static const float himark = 88.72283935546875;
8
  static const float lomark = -103.972084045410;
9
  if (__builtin_isless(x, himark) && __builtin_isgreater(x, lomark))
10
    {
11
      int tval;
12
      double x22, t, result, dx;
13
      float delta;
14
      struct ieee754_double ex2_u;
15
      dx -= t;
16
      tval = (int) (t * 512.0);
17
      if (t >= 0)
18
        delta = - __exp_deltatable[tval];
19
      else
20
        delta = __exp_deltatable[-tval];
21
      x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
22
      result = x22 * ex2_u.d + ex2_u.d;
23
      return (float) result;
24
    }
25
  return x;
26
}

powered by: WebSVN 2.1.0

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