1 /* Copyright (C) 2004, 2006, 2007-2012 Free Software Foundation, Inc.
2 Contributor: Joern Rennecke <joern.rennecke@embecosm.com>
3 on behalf of Synopsys Inc.
5 This file is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 3, or (at your option) any
10 In addition to the permissions in the GNU General Public License, the
11 Free Software Foundation gives you unlimited permission to link the
12 compiled version of this file into combinations with other programs,
13 and to distribute those combinations without any restriction coming
14 from the use of this file. (The General Public License restrictions
15 do apply in other respects; for example, they cover modification of
16 the file, and distribution when not linked into a combine
19 This file is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with this program; see the file COPYING3. If not see
26 <http://www.gnu.org/licenses/>. */
28 /* Calculate division table for ARC700 integer division
29 Contributed by Joern Rennecke
30 joern.rennecke@arc.com */
40 double q
, r
, err
, max_err
= -1;
42 puts("/* This table has been generated by divtab-arc700.c. */");
44 /* 1/512 .. 1/256, normalized. There is a leading 1 in bit 31.\n\
45 For powers of two, we list unnormalized numbers instead. The values\n\
46 for powers of 2 are loaded, but not used. The value for 1 is actually\n\
47 the first instruction after .Lmuldiv. */\n\
50 for (i
= 256; i
>= 2; --i
)
61 printf ("\t.long\t0x%X\n", (unsigned) r
);
67 printf ("\t/* maximum error: %f */\n", max_err
);