OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libm/] [machine/] [spu/] [headers/] [tgamma.h] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
#include <errno.h>
#include <errno.h>
#include "headers/truncd2.h"
#include "headers/truncd2.h"
#include "headers/tgammad2.h"
#include "headers/tgammad2.h"
 
 
static __inline double _tgamma(double x)
static __inline double _tgamma(double x)
{
{
  double res;
  double res;
  vector double vx;
  vector double vx;
  vector double truncx;
  vector double truncx;
  vector double vc = { 0.0, 0.0 };
  vector double vc = { 0.0, 0.0 };
  vector unsigned long long cmpres;
  vector unsigned long long cmpres;
  vector signed int verrno, ferrno;
  vector signed int verrno, ferrno;
  vector signed int fail = { EDOM, EDOM, EDOM, EDOM };
  vector signed int fail = { EDOM, EDOM, EDOM, EDOM };
 
 
  vx = spu_promote(x, 0);
  vx = spu_promote(x, 0);
  res = spu_extract(_tgammad2(vx), 0);
  res = spu_extract(_tgammad2(vx), 0);
 
 
#ifndef _IEEE_LIBM
#ifndef _IEEE_LIBM
  /*
  /*
   * use vector truncd2 rather than splat x, and splat truncx.
   * use vector truncd2 rather than splat x, and splat truncx.
   */
   */
  truncx = _truncd2(vx);
  truncx = _truncd2(vx);
  cmpres = spu_cmpeq(truncx, vx);
  cmpres = spu_cmpeq(truncx, vx);
  verrno = spu_splats(errno);
  verrno = spu_splats(errno);
  ferrno = spu_sel(verrno, fail, (vector unsigned int) cmpres);
  ferrno = spu_sel(verrno, fail, (vector unsigned int) cmpres);
  cmpres = spu_cmpgt(vc, vx);
  cmpres = spu_cmpgt(vc, vx);
  errno = spu_extract(spu_sel(verrno, ferrno, (vector unsigned int) cmpres), 0);
  errno = spu_extract(spu_sel(verrno, ferrno, (vector unsigned int) cmpres), 0);
#endif
#endif
  return res;
  return res;
}
}
 
 

powered by: WebSVN 2.1.0

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