1*fae548d3Szrj /* bignum.h-arbitrary precision integers 2*fae548d3Szrj Copyright (C) 1987-2020 Free Software Foundation, Inc. 3*fae548d3Szrj 4*fae548d3Szrj This file is part of GAS, the GNU Assembler. 5*fae548d3Szrj 6*fae548d3Szrj GAS is free software; you can redistribute it and/or modify 7*fae548d3Szrj it under the terms of the GNU General Public License as published by 8*fae548d3Szrj the Free Software Foundation; either version 3, or (at your option) 9*fae548d3Szrj any later version. 10*fae548d3Szrj 11*fae548d3Szrj GAS is distributed in the hope that it will be useful, but WITHOUT 12*fae548d3Szrj ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13*fae548d3Szrj or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 14*fae548d3Szrj License for more details. 15*fae548d3Szrj 16*fae548d3Szrj You should have received a copy of the GNU General Public License 17*fae548d3Szrj along with GAS; see the file COPYING. If not, write to 18*fae548d3Szrj the Free Software Foundation, 51 Franklin Street - Fifth Floor, 19*fae548d3Szrj Boston, MA 02110-1301, USA. */ 20*fae548d3Szrj 21*fae548d3Szrj /***********************************************************************\ 22*fae548d3Szrj * * 23*fae548d3Szrj * Arbitrary-precision integer arithmetic. * 24*fae548d3Szrj * For speed, we work in groups of bits, even though this * 25*fae548d3Szrj * complicates algorithms. * 26*fae548d3Szrj * Each group of bits is called a 'littlenum'. * 27*fae548d3Szrj * A bunch of littlenums representing a (possibly large) * 28*fae548d3Szrj * integer is called a 'bignum'. * 29*fae548d3Szrj * Bignums are >= 0. * 30*fae548d3Szrj * * 31*fae548d3Szrj \***********************************************************************/ 32*fae548d3Szrj 33*fae548d3Szrj #define LITTLENUM_NUMBER_OF_BITS (16) 34*fae548d3Szrj #define LITTLENUM_RADIX (1 << LITTLENUM_NUMBER_OF_BITS) 35*fae548d3Szrj #define LITTLENUM_MASK (0xFFFF) 36*fae548d3Szrj #define LITTLENUM_SHIFT (1) 37*fae548d3Szrj #define CHARS_PER_LITTLENUM (1 << LITTLENUM_SHIFT) 38*fae548d3Szrj #ifndef BITS_PER_CHAR 39*fae548d3Szrj #define BITS_PER_CHAR (8) 40*fae548d3Szrj #endif 41*fae548d3Szrj 42*fae548d3Szrj typedef unsigned short LITTLENUM_TYPE; 43