1 /****************************************************************************
3 * GNAT COMPILER COMPONENTS *
11 * Copyright (C) 1992-2001, Free Software Foundation, Inc. *
13 * GNAT is free software; you can redistribute it and/or modify it under *
14 * terms of the GNU General Public License as published by the Free Soft- *
15 * ware Foundation; either version 2, or (at your option) any later ver- *
16 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
17 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
19 * for more details. You should have received a copy of the GNU General *
20 * Public License distributed with GNAT; see file COPYING. If not, write *
21 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
22 * MA 02111-1307, USA. *
24 * GNAT was originally developed by the GNAT team at New York University. *
25 * It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
27 ****************************************************************************/
29 /* This file corresponds to the Ada package specification Uintp. It was
30 created manually from the files uintp.ads and uintp.adb */
32 /* Support for universal integer arithmetic */
40 /* See if a Uint is within the range of an integer. */
41 #define UI_Is_In_Int_Range uintp__ui_is_in_int_range
42 extern Boolean UI_Is_In_Int_Range PARAMS((Uint));
44 /* Obtain Int value from Uint input. This will abort if the result is
46 #define UI_To_Int uintp__ui_to_int
47 extern Int UI_To_Int PARAMS((Uint));
49 /* Convert an Int into a Uint. */
50 #define UI_From_Int uintp__ui_from_int
51 extern Uint UI_From_Int PARAMS((int));
53 /* Similarly, but return a GCC INTEGER_CST. Overflow is tested by the
54 constant-folding used to build the node. TYPE is the GCC type of the
56 extern tree UI_To_gnu PARAMS((Uint, tree));
58 /* Universal integers are represented by the Uint type which is an index into
59 the Uints_Ptr table containing Uint_Entry values. A Uint_Entry contains an
60 index and length for getting the "digits" of the universal integer from the
63 For efficiency, this method is used only for integer values larger than the
64 constant Uint_Bias. If a Uint is less than this constant, then it contains
65 the integer value itself. The origin of the Uints_Ptr table is adjusted so
66 that a Uint value of Uint_Bias indexes the first element. */
68 #define Uints_Ptr (uintp__uints__table - Uint_Table_Start)
69 extern struct Uint_Entry *uintp__uints__table;
71 #define Udigits_Ptr uintp__udigits__table
72 extern int *uintp__udigits__table;
74 #define Uint_0 (Uint_Direct_Bias + 0)
75 #define Uint_1 (Uint_Direct_Bias + 1)