2deaf8b0d6
gcc: * config/arc/arc-opts.h: Add 2013 to Copyright years. * config/arc/arc700.md: Likewise. * config/arc/arc-modes.def: Likewise. * config/arc/arc-simd.h: Likewise. * config/arc/t-arc-uClibc: Likewise. * config/arc/t-arc-newlib: Likewise. libgcc: * config/arc/crtgend.S: Add 2013 to Copyright years. * config/arc/gmon/atomic.h: Likewise. * config/arc/gmon/auxreg.h: Likewise. * config/arc/gmon/sys/gmon_out.h: Likewise. * config/arc/gmon/sys/gmon.h: Likewise. * config/arc/gmon/prof-freq.c: Likewise. * config/arc/gmon/mcount.c: Likewise. * config/arc/gmon/prof-freq-stub.S: Likewise. * config/arc/gmon/gmon.c: Likewise. * config/arc/gmon/machine-gmon.h: Likewise. * config/arc/gmon/profil.S: Likewise. * config/arc/gmon/dcache_linesz.S: Likewise. * config/arc/crtg.S: Likewise. * config/arc/ieee-754/arc600-mul64/divsf3.S: Likewise. * config/arc/ieee-754/arc600-mul64/divdf3.S: Likewise. * config/arc/ieee-754/adddf3.S: Likewise. * config/arc/ieee-754/truncdfsf2.S: Likewise. * config/arc/ieee-754/fixsfsi.S: Likewise. * config/arc/ieee-754/gtsf2.S: Likewise. * config/arc/ieee-754/floatsisf.S: Likewise. * config/arc/ieee-754/arc600-dsp/divsf3.S: Likewise. * config/arc/ieee-754/arc600-dsp/divdf3.S: Likewise. * config/arc/ieee-754/arc600-dsp/mulsf3.S: Likewise. * config/arc/ieee-754/fixdfsi.S: Likewise. * config/arc/ieee-754/addsf3.S: Likewise. * config/arc/ieee-754/gesf2.S: Likewise. * config/arc/ieee-754/floatsidf.S: Likewise. * config/arc/ieee-754/extendsfdf2.S: Likewise. * config/arc/ieee-754/divtab-arc-df.c: Likewise. * config/arc/ieee-754/gtdf2.S: Likewise. * config/arc/ieee-754/fixunsdfsi.S: Likewise. * config/arc/ieee-754/uneqdf2.S: Likewise. * config/arc/ieee-754/divsf3-stdmul.S: Likewise. * config/arc/ieee-754/uneqsf2.S: Likewise. * config/arc/ieee-754/arc-ieee-754.h: Likewise. * config/arc/ieee-754/divtab-arc-sf.c: Likewise. * config/arc/ieee-754/eqdf2.S: Likewise. * config/arc/ieee-754/ordsf2.S: Likewise. * config/arc/ieee-754/divsf3.S: Likewise. * config/arc/ieee-754/divdf3.S: Likewise. * config/arc/ieee-754/floatunsidf.S: Likewise. * config/arc/ieee-754/orddf2.S: Likewise. * config/arc/ieee-754/eqsf2.S: Likewise. * config/arc/ieee-754/gedf2.S: Likewise. * config/arc/crtn.S: Likewise. * config/arc/crti.S: Likewise. * config/arc/t-arc700-uClibc: Likewise. * config/arc/asm.h: Likewise. * config/arc/libgcc-excl.ver: Likewise. * config/arc/t-arc-newlib: Likewise. * config/arc/divtab-arc700.c: Likewise. * config/arc/initfini.c: Likewise. * config/arc/fp-hack.h: Likewise. From-SVN: r203110
71 lines
2.2 KiB
C
71 lines
2.2 KiB
C
/* Copyright (C) 2004, 2006, 2007-2013 Free Software Foundation, Inc.
|
|
Contributor: Joern Rennecke <joern.rennecke@embecosm.com>
|
|
on behalf of Synopsys Inc.
|
|
|
|
This file is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by the
|
|
Free Software Foundation; either version 3, or (at your option) any
|
|
later version.
|
|
|
|
In addition to the permissions in the GNU General Public License, the
|
|
Free Software Foundation gives you unlimited permission to link the
|
|
compiled version of this file into combinations with other programs,
|
|
and to distribute those combinations without any restriction coming
|
|
from the use of this file. (The General Public License restrictions
|
|
do apply in other respects; for example, they cover modification of
|
|
the file, and distribution when not linked into a combine
|
|
executable.)
|
|
|
|
This file 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
|
|
General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; see the file COPYING3. If not see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
/* Calculate division table for ARC700 integer division
|
|
Contributed by Joern Rennecke
|
|
joern.rennecke@arc.com */
|
|
|
|
#include <stdio.h>
|
|
#include <math.h>
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int i, j;
|
|
unsigned x;
|
|
double q, r, err, max_err = -1;
|
|
|
|
puts("/* This table has been generated by divtab-arc700.c. */");
|
|
puts("\
|
|
/* 1/512 .. 1/256, normalized. There is a leading 1 in bit 31.\n\
|
|
For powers of two, we list unnormalized numbers instead. The values\n\
|
|
for powers of 2 are loaded, but not used. The value for 1 is actually\n\
|
|
the first instruction after .Lmuldiv. */\n\
|
|
.balign 4");
|
|
puts (".Ldivtab:\n");
|
|
for (i = 256; i >= 2; --i)
|
|
{
|
|
j = i < 0 ? -i : i;
|
|
if (j & (j-1))
|
|
while (j < 128)
|
|
j += j;
|
|
else
|
|
/* Power of two. */
|
|
j *= 128;
|
|
q = 4.*(1<<30)*128/j;
|
|
r = ceil (q);
|
|
printf ("\t.long\t0x%X\n", (unsigned) r);
|
|
err = r - q;
|
|
if (err > max_err)
|
|
max_err = err;
|
|
}
|
|
#if 0
|
|
printf ("\t/* maximum error: %f */\n", max_err);
|
|
#endif
|
|
exit (0);
|
|
}
|