White space and comment changes, and #ifdef __STDC__ becomes #if
__STDC__ == 1.
This commit is contained in:
parent
5b3fb53040
commit
a87b326934
17 changed files with 244 additions and 233 deletions
|
@ -1,5 +1,5 @@
|
|||
/* atof_ieee.c - turn a Flonum into an IEEE floating point number
|
||||
Copyright (C) 1987 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -74,8 +74,8 @@ static unsigned long mask [] = {
|
|||
0x1fffffff,
|
||||
0x3fffffff,
|
||||
0x7fffffff,
|
||||
0xffffffff
|
||||
};
|
||||
0xffffffff,
|
||||
};
|
||||
|
||||
|
||||
static int bits_left_in_littlenum;
|
||||
|
@ -84,29 +84,27 @@ static LITTLENUM_TYPE *littlenum_pointer;
|
|||
|
||||
static int
|
||||
next_bits (number_of_bits)
|
||||
int number_of_bits;
|
||||
int number_of_bits;
|
||||
{
|
||||
int return_value;
|
||||
int return_value;
|
||||
|
||||
if(!littlenums_left)
|
||||
return 0;
|
||||
if (number_of_bits >= bits_left_in_littlenum)
|
||||
{
|
||||
return_value = mask [bits_left_in_littlenum] & *littlenum_pointer;
|
||||
number_of_bits -= bits_left_in_littlenum;
|
||||
return_value <<= number_of_bits;
|
||||
if(--littlenums_left) {
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS - number_of_bits;
|
||||
littlenum_pointer --;
|
||||
return_value |= (*littlenum_pointer>>bits_left_in_littlenum) & mask[number_of_bits];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bits_left_in_littlenum -= number_of_bits;
|
||||
return_value = mask [number_of_bits] & (*littlenum_pointer>>bits_left_in_littlenum);
|
||||
}
|
||||
return (return_value);
|
||||
if (!littlenums_left)
|
||||
return(0);
|
||||
if (number_of_bits >= bits_left_in_littlenum) {
|
||||
return_value = mask[bits_left_in_littlenum] & *littlenum_pointer;
|
||||
number_of_bits -= bits_left_in_littlenum;
|
||||
return_value <<= number_of_bits;
|
||||
|
||||
if (--littlenums_left) {
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS - number_of_bits;
|
||||
--littlenum_pointer;
|
||||
return_value |= (*littlenum_pointer >> bits_left_in_littlenum) & mask[number_of_bits];
|
||||
}
|
||||
} else {
|
||||
bits_left_in_littlenum -= number_of_bits;
|
||||
return_value = mask[number_of_bits] & (*littlenum_pointer >> bits_left_in_littlenum);
|
||||
}
|
||||
return(return_value);
|
||||
}
|
||||
|
||||
/* Num had better be less than LITTLENUM_NUMBER_OF_BITS */
|
||||
|
@ -114,29 +112,29 @@ static void
|
|||
unget_bits(num)
|
||||
int num;
|
||||
{
|
||||
if(!littlenums_left) {
|
||||
if (!littlenums_left) {
|
||||
++littlenum_pointer;
|
||||
++littlenums_left;
|
||||
bits_left_in_littlenum=num;
|
||||
} else if(bits_left_in_littlenum+num>LITTLENUM_NUMBER_OF_BITS) {
|
||||
bits_left_in_littlenum= num-(LITTLENUM_NUMBER_OF_BITS-bits_left_in_littlenum);
|
||||
bits_left_in_littlenum = num;
|
||||
} else if (bits_left_in_littlenum + num > LITTLENUM_NUMBER_OF_BITS) {
|
||||
bits_left_in_littlenum = num - (LITTLENUM_NUMBER_OF_BITS - bits_left_in_littlenum);
|
||||
++littlenum_pointer;
|
||||
++littlenums_left;
|
||||
} else
|
||||
bits_left_in_littlenum+=num;
|
||||
bits_left_in_littlenum += num;
|
||||
}
|
||||
|
||||
static void
|
||||
make_invalid_floating_point_number (words)
|
||||
LITTLENUM_TYPE * words;
|
||||
make_invalid_floating_point_number(words)
|
||||
LITTLENUM_TYPE *words;
|
||||
{
|
||||
as_bad("cannot create floating-point number");
|
||||
words[0]= ((unsigned)-1)>>1; /* Zero the leftmost bit */
|
||||
words[1]= -1;
|
||||
words[2]= -1;
|
||||
words[3]= -1;
|
||||
words[4]= -1;
|
||||
words[5]= -1;
|
||||
words[0] = ((unsigned) -1) >> 1; /* Zero the leftmost bit */
|
||||
words[1] = -1;
|
||||
words[2] = -1;
|
||||
words[3] = -1;
|
||||
words[4] = -1;
|
||||
words[5] = -1;
|
||||
}
|
||||
|
||||
/***********************************************************************\
|
||||
|
@ -151,19 +149,19 @@ LITTLENUM_TYPE * words;
|
|||
them. */
|
||||
|
||||
char * /* Return pointer past text consumed. */
|
||||
atof_ieee (str, what_kind, words)
|
||||
char * str; /* Text to convert to binary. */
|
||||
char what_kind; /* 'd', 'f', 'g', 'h' */
|
||||
LITTLENUM_TYPE * words; /* Build the binary here. */
|
||||
atof_ieee(str, what_kind, words)
|
||||
char *str; /* Text to convert to binary. */
|
||||
char what_kind; /* 'd', 'f', 'g', 'h' */
|
||||
LITTLENUM_TYPE *words; /* Build the binary here. */
|
||||
{
|
||||
static LITTLENUM_TYPE bits [MAX_PRECISION + MAX_PRECISION + GUARD];
|
||||
static LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD];
|
||||
/* Extra bits for zeroed low-order bits. */
|
||||
/* The 1st MAX_PRECISION are zeroed, */
|
||||
/* the last contain flonum bits. */
|
||||
char * return_value;
|
||||
int precision; /* Number of 16-bit words in the format. */
|
||||
long exponent_bits;
|
||||
FLONUM_TYPE save_gen_flonum;
|
||||
char *return_value;
|
||||
int precision; /* Number of 16-bit words in the format. */
|
||||
long exponent_bits;
|
||||
FLONUM_TYPE save_gen_flonum;
|
||||
|
||||
/* We have to save the generic_floating_point_number because it
|
||||
contains storage allocation about the array of LITTLENUMs
|
||||
|
@ -183,9 +181,9 @@ LITTLENUM_TYPE * words; /* Build the binary here. */
|
|||
/* necessary: the highest flonum may have */
|
||||
/* 15 leading 0 bits, so could be useless. */
|
||||
|
||||
bzero (bits, sizeof(LITTLENUM_TYPE) * MAX_PRECISION);
|
||||
bzero(bits, sizeof(LITTLENUM_TYPE) * MAX_PRECISION);
|
||||
|
||||
switch(what_kind) {
|
||||
switch (what_kind) {
|
||||
case 'f':
|
||||
case 'F':
|
||||
case 's':
|
||||
|
@ -214,20 +212,20 @@ LITTLENUM_TYPE * words; /* Build the binary here. */
|
|||
case 'P':
|
||||
|
||||
precision = P_PRECISION;
|
||||
exponent_bits= -1;
|
||||
exponent_bits = -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
make_invalid_floating_point_number (words);
|
||||
return NULL;
|
||||
make_invalid_floating_point_number(words);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
generic_floating_point_number.high = generic_floating_point_number.low + precision - 1 + GUARD;
|
||||
|
||||
if (atof_generic (& return_value, ".", EXP_CHARS, & generic_floating_point_number)) {
|
||||
if (atof_generic(&return_value, ".", EXP_CHARS, &generic_floating_point_number)) {
|
||||
/* as_bad("Error converting floating point number (Exponent overflow?)"); */
|
||||
make_invalid_floating_point_number (words);
|
||||
return NULL;
|
||||
make_invalid_floating_point_number(words);
|
||||
return(NULL);
|
||||
}
|
||||
gen_to_words(words, precision, exponent_bits);
|
||||
|
||||
|
@ -235,7 +233,7 @@ LITTLENUM_TYPE * words; /* Build the binary here. */
|
|||
(and everything else). */
|
||||
generic_floating_point_number = save_gen_flonum;
|
||||
|
||||
return return_value;
|
||||
return(return_value);
|
||||
}
|
||||
|
||||
/* Turn generic_floating_point_number into a real float/double/extended */
|
||||
|
@ -244,62 +242,62 @@ LITTLENUM_TYPE *words;
|
|||
int precision;
|
||||
long exponent_bits;
|
||||
{
|
||||
int return_value=0;
|
||||
int return_value = 0;
|
||||
|
||||
long exponent_1;
|
||||
long exponent_2;
|
||||
long exponent_3;
|
||||
long exponent_4;
|
||||
int exponent_skippage;
|
||||
LITTLENUM_TYPE word1;
|
||||
LITTLENUM_TYPE * lp;
|
||||
long exponent_1;
|
||||
long exponent_2;
|
||||
long exponent_3;
|
||||
long exponent_4;
|
||||
int exponent_skippage;
|
||||
LITTLENUM_TYPE word1;
|
||||
LITTLENUM_TYPE *lp;
|
||||
|
||||
if (generic_floating_point_number.low > generic_floating_point_number.leader) {
|
||||
/* 0.0e0 seen. */
|
||||
if(generic_floating_point_number.sign=='+')
|
||||
words[0]=0x0000;
|
||||
if (generic_floating_point_number.sign == '+')
|
||||
words[0] = 0x0000;
|
||||
else
|
||||
words[0]=0x8000;
|
||||
bzero (&words[1], sizeof(LITTLENUM_TYPE) * (precision-1));
|
||||
return return_value;
|
||||
words[0] = 0x8000;
|
||||
bzero(&words[1], sizeof(LITTLENUM_TYPE) * (precision - 1));
|
||||
return(return_value);
|
||||
}
|
||||
|
||||
/* NaN: Do the right thing */
|
||||
if(generic_floating_point_number.sign==0) {
|
||||
if(precision==F_PRECISION) {
|
||||
words[0]=0x7fff;
|
||||
words[1]=0xffff;
|
||||
if (generic_floating_point_number.sign == 0) {
|
||||
if (precision == F_PRECISION) {
|
||||
words[0] = 0x7fff;
|
||||
words[1] = 0xffff;
|
||||
} else {
|
||||
words[0]=0x7fff;
|
||||
words[1]=0xffff;
|
||||
words[2]=0xffff;
|
||||
words[3]=0xffff;
|
||||
words[0] = 0x7fff;
|
||||
words[1] = 0xffff;
|
||||
words[2] = 0xffff;
|
||||
words[3] = 0xffff;
|
||||
}
|
||||
return return_value;
|
||||
} else if(generic_floating_point_number.sign=='P') {
|
||||
} else if (generic_floating_point_number.sign == 'P') {
|
||||
/* +INF: Do the right thing */
|
||||
if(precision==F_PRECISION) {
|
||||
words[0]=0x7f80;
|
||||
words[1]=0;
|
||||
if (precision == F_PRECISION) {
|
||||
words[0] = 0x7f80;
|
||||
words[1] = 0;
|
||||
} else {
|
||||
words[0]=0x7ff0;
|
||||
words[1]=0;
|
||||
words[2]=0;
|
||||
words[3]=0;
|
||||
words[0] = 0x7ff0;
|
||||
words[1] = 0;
|
||||
words[2] = 0;
|
||||
words[3] = 0;
|
||||
}
|
||||
return return_value;
|
||||
} else if(generic_floating_point_number.sign=='N') {
|
||||
return(return_value);
|
||||
} else if (generic_floating_point_number.sign == 'N') {
|
||||
/* Negative INF */
|
||||
if(precision==F_PRECISION) {
|
||||
words[0]=0xff80;
|
||||
words[1]=0x0;
|
||||
if (precision == F_PRECISION) {
|
||||
words[0] = 0xff80;
|
||||
words[1] = 0x0;
|
||||
} else {
|
||||
words[0]=0xfff0;
|
||||
words[1]=0x0;
|
||||
words[2]=0x0;
|
||||
words[3]=0x0;
|
||||
words[0] = 0xfff0;
|
||||
words[1] = 0x0;
|
||||
words[2] = 0x0;
|
||||
words[3] = 0x0;
|
||||
}
|
||||
return return_value;
|
||||
return(return_value);
|
||||
}
|
||||
/*
|
||||
* The floating point formats we support have:
|
||||
|
@ -313,12 +311,11 @@ long exponent_bits;
|
|||
*/
|
||||
bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS;
|
||||
littlenum_pointer = generic_floating_point_number.leader;
|
||||
littlenums_left = 1+generic_floating_point_number.leader - generic_floating_point_number.low;
|
||||
littlenums_left = 1 + generic_floating_point_number.leader - generic_floating_point_number.low;
|
||||
/* Seek (and forget) 1st significant bit */
|
||||
for (exponent_skippage = 0;! next_bits(1); exponent_skippage ++)
|
||||
;
|
||||
exponent_1 = generic_floating_point_number.exponent + generic_floating_point_number.leader + 1 -
|
||||
generic_floating_point_number.low;
|
||||
for (exponent_skippage = 0;! next_bits(1); exponent_skippage ++) ;;
|
||||
exponent_1 = generic_floating_point_number.exponent + generic_floating_point_number.leader
|
||||
+ 1 - generic_floating_point_number.low;
|
||||
/* Radix LITTLENUM_RADIX, point just higher than generic_floating_point_number.leader. */
|
||||
exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS;
|
||||
/* Radix 2. */
|
||||
|
@ -330,84 +327,84 @@ long exponent_bits;
|
|||
lp = words;
|
||||
|
||||
/* Word 1. Sign, exponent and perhaps high bits. */
|
||||
word1 = (generic_floating_point_number.sign == '+') ? 0 : (1<<(LITTLENUM_NUMBER_OF_BITS-1));
|
||||
word1 = (generic_floating_point_number.sign == '+') ? 0 : (1 << (LITTLENUM_NUMBER_OF_BITS - 1));
|
||||
|
||||
/* Assume 2's complement integers. */
|
||||
if(exponent_4<1 && exponent_4>=-62) {
|
||||
if (exponent_4 < 1 && exponent_4 >= -62) {
|
||||
int prec_bits;
|
||||
int num_bits;
|
||||
|
||||
unget_bits(1);
|
||||
num_bits= -exponent_4;
|
||||
prec_bits=LITTLENUM_NUMBER_OF_BITS*precision-(exponent_bits+1+num_bits);
|
||||
if(precision==X_PRECISION && exponent_bits==15)
|
||||
prec_bits-=LITTLENUM_NUMBER_OF_BITS+1;
|
||||
num_bits = -exponent_4;
|
||||
prec_bits = LITTLENUM_NUMBER_OF_BITS * precision - (exponent_bits + 1 + num_bits);
|
||||
if(precision == X_PRECISION && exponent_bits == 15)
|
||||
prec_bits -= LITTLENUM_NUMBER_OF_BITS + 1;
|
||||
|
||||
if(num_bits>=LITTLENUM_NUMBER_OF_BITS-exponent_bits) {
|
||||
if (num_bits >= LITTLENUM_NUMBER_OF_BITS - exponent_bits) {
|
||||
/* Bigger than one littlenum */
|
||||
num_bits-=(LITTLENUM_NUMBER_OF_BITS-1)-exponent_bits;
|
||||
*lp++=word1;
|
||||
if(num_bits+exponent_bits+1>=precision*LITTLENUM_NUMBER_OF_BITS) {
|
||||
num_bits -= (LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits;
|
||||
*lp++ = word1;
|
||||
if (num_bits + exponent_bits + 1 >= precision * LITTLENUM_NUMBER_OF_BITS) {
|
||||
/* Exponent overflow */
|
||||
make_invalid_floating_point_number(words);
|
||||
return return_value;
|
||||
return(return_value);
|
||||
}
|
||||
if(precision==X_PRECISION && exponent_bits==15) {
|
||||
*lp++=0;
|
||||
*lp++=0;
|
||||
num_bits-=LITTLENUM_NUMBER_OF_BITS-1;
|
||||
if (precision == X_PRECISION && exponent_bits == 15) {
|
||||
*lp++ = 0;
|
||||
*lp++ = 0;
|
||||
num_bits -= LITTLENUM_NUMBER_OF_BITS - 1;
|
||||
}
|
||||
while(num_bits>=LITTLENUM_NUMBER_OF_BITS) {
|
||||
num_bits-=LITTLENUM_NUMBER_OF_BITS;
|
||||
*lp++=0;
|
||||
while (num_bits >= LITTLENUM_NUMBER_OF_BITS) {
|
||||
num_bits -= LITTLENUM_NUMBER_OF_BITS;
|
||||
*lp++ = 0;
|
||||
}
|
||||
if(num_bits)
|
||||
*lp++=next_bits(LITTLENUM_NUMBER_OF_BITS-(num_bits));
|
||||
if (num_bits)
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS - (num_bits));
|
||||
} else {
|
||||
if(precision==X_PRECISION && exponent_bits==15) {
|
||||
*lp++=word1;
|
||||
*lp++=0;
|
||||
if(num_bits==LITTLENUM_NUMBER_OF_BITS) {
|
||||
*lp++=0;
|
||||
*lp++=next_bits(LITTLENUM_NUMBER_OF_BITS-1);
|
||||
} else if(num_bits==LITTLENUM_NUMBER_OF_BITS-1)
|
||||
*lp++=0;
|
||||
if (precision == X_PRECISION && exponent_bits == 15) {
|
||||
*lp++ = word1;
|
||||
*lp++ = 0;
|
||||
if (num_bits == LITTLENUM_NUMBER_OF_BITS) {
|
||||
*lp++ = 0;
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS - 1);
|
||||
} else if (num_bits == LITTLENUM_NUMBER_OF_BITS - 1)
|
||||
*lp++ = 0;
|
||||
else
|
||||
*lp++=next_bits(LITTLENUM_NUMBER_OF_BITS-1-num_bits);
|
||||
num_bits=0;
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS - 1 - num_bits);
|
||||
num_bits = 0;
|
||||
} else {
|
||||
word1|= next_bits ((LITTLENUM_NUMBER_OF_BITS-1) - (exponent_bits+num_bits));
|
||||
*lp++=word1;
|
||||
word1 |= next_bits((LITTLENUM_NUMBER_OF_BITS - 1) - (exponent_bits + num_bits));
|
||||
*lp++ = word1;
|
||||
}
|
||||
}
|
||||
while(lp<words+precision)
|
||||
*lp++=next_bits(LITTLENUM_NUMBER_OF_BITS);
|
||||
while (lp < words + precision)
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS);
|
||||
|
||||
/* Round the mantissa up, but don't change the number */
|
||||
if(next_bits(1)) {
|
||||
if (next_bits(1)) {
|
||||
--lp;
|
||||
if(prec_bits>LITTLENUM_NUMBER_OF_BITS) {
|
||||
if (prec_bits > LITTLENUM_NUMBER_OF_BITS) {
|
||||
int n = 0;
|
||||
int tmp_bits;
|
||||
|
||||
n=0;
|
||||
tmp_bits=prec_bits;
|
||||
while(tmp_bits>LITTLENUM_NUMBER_OF_BITS) {
|
||||
if(lp[n]!=(LITTLENUM_TYPE)-1)
|
||||
n = 0;
|
||||
tmp_bits = prec_bits;
|
||||
while (tmp_bits > LITTLENUM_NUMBER_OF_BITS) {
|
||||
if (lp[n] != (LITTLENUM_TYPE) - 1)
|
||||
break;
|
||||
--n;
|
||||
tmp_bits-=LITTLENUM_NUMBER_OF_BITS;
|
||||
tmp_bits -= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if(tmp_bits>LITTLENUM_NUMBER_OF_BITS || (lp[n]&mask[tmp_bits])!=mask[tmp_bits]) {
|
||||
if (tmp_bits > LITTLENUM_NUMBER_OF_BITS || (lp[n] & mask[tmp_bits]) != mask[tmp_bits]) {
|
||||
unsigned long carry;
|
||||
|
||||
for (carry = 1; carry && (lp >= words); lp --) {
|
||||
carry = * lp + carry;
|
||||
* lp = carry;
|
||||
carry = *lp + carry;
|
||||
*lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
}
|
||||
} else if((*lp&mask[prec_bits])!=mask[prec_bits])
|
||||
} else if ((*lp & mask[prec_bits]) != mask[prec_bits])
|
||||
lp++;
|
||||
}
|
||||
|
||||
|
@ -425,25 +422,25 @@ long exponent_bits;
|
|||
make_invalid_floating_point_number (words);
|
||||
return return_value;
|
||||
} else {
|
||||
word1 |= (exponent_4 << ((LITTLENUM_NUMBER_OF_BITS-1) - exponent_bits))
|
||||
| next_bits ((LITTLENUM_NUMBER_OF_BITS-1) - exponent_bits);
|
||||
word1 |= (exponent_4 << ((LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits))
|
||||
| next_bits ((LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits);
|
||||
}
|
||||
|
||||
* lp ++ = word1;
|
||||
*lp++ = word1;
|
||||
|
||||
/* X_PRECISION is special: it has 16 bits of zero in the middle,
|
||||
followed by a 1 bit. */
|
||||
if(exponent_bits==15 && precision==X_PRECISION) {
|
||||
*lp++=0;
|
||||
*lp++= 1<<(LITTLENUM_NUMBER_OF_BITS)|next_bits(LITTLENUM_NUMBER_OF_BITS-1);
|
||||
if (exponent_bits == 15 && precision == X_PRECISION) {
|
||||
*lp++ = 0;
|
||||
*lp++ = 1 << (LITTLENUM_NUMBER_OF_BITS) | next_bits(LITTLENUM_NUMBER_OF_BITS - 1);
|
||||
}
|
||||
|
||||
/* The rest of the words are just mantissa bits. */
|
||||
while(lp < words + precision)
|
||||
*lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS);
|
||||
*lp++ = next_bits(LITTLENUM_NUMBER_OF_BITS);
|
||||
|
||||
if (next_bits (1)) {
|
||||
unsigned long carry;
|
||||
if (next_bits(1)) {
|
||||
unsigned long carry;
|
||||
/*
|
||||
* Since the NEXT bit is a 1, round UP the mantissa.
|
||||
* The cunning design of these hidden-1 floats permits
|
||||
|
@ -453,7 +450,6 @@ long exponent_bits;
|
|||
* Is that clear?
|
||||
*/
|
||||
|
||||
|
||||
/* #if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2)
|
||||
Please allow at least 1 more bit in carry than is in a LITTLENUM.
|
||||
We need that extra bit to hold a carry during a LITTLENUM carry
|
||||
|
@ -461,17 +457,17 @@ long exponent_bits;
|
|||
don't get a sticky sign bit after shifting right, and that
|
||||
permits us to propagate the carry without any masking of bits.
|
||||
#endif */
|
||||
for (carry = 1, lp --; carry && (lp >= words); lp --) {
|
||||
carry = * lp + carry;
|
||||
* lp = carry;
|
||||
for (carry = 1, lp--; carry && (lp >= words); lp--) {
|
||||
carry = *lp + carry;
|
||||
*lp = carry;
|
||||
carry >>= LITTLENUM_NUMBER_OF_BITS;
|
||||
}
|
||||
if ( (word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1)) ) {
|
||||
if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) {
|
||||
/* We leave return_value alone: admit we read the
|
||||
* number, but return a floating exception
|
||||
* because we can't encode the number.
|
||||
*/
|
||||
*words&= ~ (1 << (LITTLENUM_NUMBER_OF_BITS - 1));
|
||||
*words &= ~(1 << (LITTLENUM_NUMBER_OF_BITS - 1));
|
||||
/* make_invalid_floating_point_number (words); */
|
||||
/* return return_value; */
|
||||
}
|
||||
|
@ -491,8 +487,8 @@ long x;
|
|||
char *bufp;
|
||||
|
||||
sprintf(buf,"%ld",x);
|
||||
bufp= &buf[0];
|
||||
if(atof_generic(&bufp,".", EXP_CHARS, &generic_floating_point_number))
|
||||
bufp = &buf[0];
|
||||
if (atof_generic(&bufp, ".", EXP_CHARS, &generic_floating_point_number))
|
||||
as_bad("Error converting number to floating point (Exponent overflow?)");
|
||||
}
|
||||
|
||||
|
@ -507,19 +503,23 @@ FLONUM_TYPE *gen;
|
|||
float fv;
|
||||
static char sbuf[40];
|
||||
|
||||
if(gen) {
|
||||
f=generic_floating_point_number;
|
||||
generic_floating_point_number= *gen;
|
||||
if (gen) {
|
||||
f = generic_floating_point_number;
|
||||
generic_floating_point_number = *gen;
|
||||
}
|
||||
gen_to_words(&arr[0],4,11);
|
||||
bcopy(&arr[0],&dv,sizeof(double));
|
||||
sprintf(sbuf,"%x %x %x %x %.14G ",arr[0],arr[1],arr[2],arr[3],dv);
|
||||
gen_to_words(&arr[0], 4, 11);
|
||||
bcopy(&arr[0], &dv, sizeof(double));
|
||||
sprintf(sbuf, "%x %x %x %x %.14G ", arr[0], arr[1], arr[2], arr[3], dv);
|
||||
gen_to_words(&arr[0],2,8);
|
||||
bcopy(&arr[0],&fv,sizeof(float));
|
||||
sprintf(sbuf+strlen(sbuf),"%x %x %.12g\n",arr[0],arr[1],fv);
|
||||
if(gen)
|
||||
generic_floating_point_number=f;
|
||||
return sbuf;
|
||||
sprintf(sbuf + strlen(sbuf), "%x %x %.12g\n", arr[0], arr[1],
|
||||
fv);
|
||||
|
||||
if (gen) {
|
||||
generic_floating_point_number = f;
|
||||
}
|
||||
|
||||
return(sbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -55,17 +55,17 @@
|
|||
#define strchr(s, c) index(s, c)
|
||||
#endif
|
||||
|
||||
#ifndef __STDC__
|
||||
#if __STDC__ != 1
|
||||
#define const
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
extern char *cplus_demangle (const char *type);
|
||||
#else
|
||||
extern char *cplus_demangle ();
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
extern char *xmalloc (int);
|
||||
extern char *xrealloc (char *, int);
|
||||
#else
|
||||
|
@ -119,7 +119,7 @@ typedef struct {
|
|||
char *e; /* pointer after end of allocated space */
|
||||
} string;
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
static void string_need (string *s, int n);
|
||||
static void string_delete (string *s);
|
||||
static void string_init (string *s);
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
along with GAS; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef __STDC__
|
||||
#if __STDC__ != 1
|
||||
#define NO_STDARG
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
#if !defined(__GNUC__) & !defined(__STDC__)
|
||||
#if !defined(__GNUC__) && (__STDC__ != 1)
|
||||
#include <memory.h>
|
||||
#else
|
||||
extern int memset();
|
||||
|
@ -35,23 +35,25 @@ extern int memset();
|
|||
|
||||
/* externs for system libraries. */
|
||||
|
||||
extern char *strchr();
|
||||
/*extern int abort();*/
|
||||
/*extern int exit();*/
|
||||
extern char *malloc();
|
||||
extern char *realloc();
|
||||
extern char *strchr();
|
||||
extern char *strrchr();
|
||||
extern int _filbuf();
|
||||
extern int _flsbuf();
|
||||
/*extern int abort();*/
|
||||
extern int bcopy();
|
||||
extern int bzero();
|
||||
extern int bzero();
|
||||
/*extern int exit();*/
|
||||
extern int fclose();
|
||||
extern int fgetc();
|
||||
extern int fprintf();
|
||||
extern int fread();
|
||||
extern int free();
|
||||
extern int perror();
|
||||
extern int printf();
|
||||
extern int rewind();
|
||||
extern int setvbuf();
|
||||
extern int sscanf();
|
||||
extern int strcmp();
|
||||
|
@ -61,6 +63,7 @@ extern int time();
|
|||
extern int ungetc();
|
||||
extern int vfprintf();
|
||||
extern int vprintf();
|
||||
extern int vsprintf();
|
||||
extern long atol();
|
||||
|
||||
#ifndef tolower
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#define M_VAX 1
|
||||
|
||||
#ifndef __STDC__
|
||||
#if __STDC__ != 1
|
||||
#define NO_STDARG
|
||||
#endif /* not ansi */
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* a.out object file format
|
||||
Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -57,15 +57,15 @@ const segT N_TYPE_seg [N_TYPE+2] = { /* N_TYPE == 0x1E = 32-2 */
|
|||
SEG_GOOF,
|
||||
};
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
static void obj_aout_stab(int what);
|
||||
static void obj_aout_line(void);
|
||||
static void obj_aout_desc(void);
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
static void obj_aout_desc();
|
||||
static void obj_aout_stab();
|
||||
static void obj_aout_line();
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
const pseudo_typeS obj_pseudo_table[] = {
|
||||
#ifndef IGNORE_DEBUG
|
||||
|
|
|
@ -53,15 +53,15 @@ const segT N_TYPE_seg [N_TYPE+2] = { /* N_TYPE == 0x1E = 32-2 */
|
|||
SEG_GOOF,
|
||||
};
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
static void obj_bout_stab(int what);
|
||||
static void obj_bout_line(void);
|
||||
static void obj_bout_desc(void);
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
static void obj_bout_desc();
|
||||
static void obj_bout_stab();
|
||||
static void obj_bout_line();
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
const pseudo_typeS obj_pseudo_table[] = {
|
||||
/* stabs (aka a.out aka b.out directives for debug symbols) */
|
||||
|
|
|
@ -297,12 +297,12 @@ typedef struct {
|
|||
#define OBJ_EMIT_LINENO(a, b, c) {;}
|
||||
#define obj_pre_write_hook(a) {;}
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__
|
||||
struct fix;
|
||||
void tc_aout_fix_to_chars(char *where, struct fix *fixP, relax_addressT segment_address);
|
||||
#else
|
||||
#else /* not __STDC__ */
|
||||
void tc_aout_fix_to_chars();
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* coff object file format
|
||||
Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS.
|
||||
|
||||
|
@ -59,7 +59,7 @@ const segT N_TYPE_seg [32] =
|
|||
SEG_GOOF,SEG_GOOF,SEG_GOOF,SEG_GOOF,SEG_GOOF,SEG_GOOF,SEG_GOOF
|
||||
};
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
char *s_get_name(symbolS *s);
|
||||
static symbolS *tag_find_or_make(char *name);
|
||||
|
@ -83,7 +83,7 @@ static void obj_coff_val(void);
|
|||
static void tag_init(void);
|
||||
static void tag_insert(char *name, symbolS *symbolP);
|
||||
|
||||
#else
|
||||
#else /* not __STDC__ */
|
||||
|
||||
char *s_get_name();
|
||||
static symbolS *tag_find();
|
||||
|
@ -103,7 +103,7 @@ static void obj_coff_val();
|
|||
static void tag_init();
|
||||
static void tag_insert();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
static struct hash_control *tag_hash;
|
||||
static symbolS *def_symbol_in_progress = NULL;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
/* Names for signals from 0 to NSIG-1. */
|
||||
extern char *sys_siglist[];
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
/* Return the abbreviation (e.g. ABRT, FPE, etc.) for signal NUMBER.
|
||||
Do not return this as a const char *. The caller might want to
|
||||
assign it to a char *. */
|
||||
|
@ -32,12 +32,12 @@ int sig_number (const char *abbrev);
|
|||
a colon, and followed by a newline. */
|
||||
void psignal (int signal, const char *message);
|
||||
|
||||
#else
|
||||
#else /* not __STDC__ */
|
||||
|
||||
char *sig_abbrev ();
|
||||
int sig_number ();
|
||||
void psignal ();
|
||||
|
||||
#endif
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
/* end of signame.h */
|
||||
|
|
|
@ -51,7 +51,7 @@ struct machine_it {
|
|||
enum reloc_type reloc;
|
||||
} the_insn;
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
/* static int getExpression(char *str); */
|
||||
static void machine_ip(char *str);
|
||||
|
@ -59,7 +59,7 @@ static void machine_ip(char *str);
|
|||
static void s_data1(void);
|
||||
static void s_use(void);
|
||||
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
|
||||
/* static int getExpression(); */
|
||||
static void machine_ip();
|
||||
|
@ -67,7 +67,7 @@ static void machine_ip();
|
|||
static void s_data1();
|
||||
static void s_use();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
const pseudo_typeS
|
||||
md_pseudo_table[] = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* i386.c -- Assemble code for the Intel 80386
|
||||
Copyright (C) 1989, 1991 Free Software Foundation.
|
||||
Copyright (C) 1989, 1991, 1992 Free Software Foundation.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -200,19 +200,19 @@ const relax_typeS md_relax_table[] = {
|
|||
|
||||
};
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
static char *output_invalid(int c);
|
||||
static int i386_operand(char *operand_string);
|
||||
static reg_entry *parse_register(char *reg_string);
|
||||
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
|
||||
static char *output_invalid();
|
||||
static int i386_operand();
|
||||
static reg_entry *parse_register();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
|
||||
/* Ignore certain directives generated by gcc. This probably should
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* i860.c -- Assemble for the I860
|
||||
Copyright (C) 1989 Free Software Foundation, Inc.
|
||||
/* tc-i860.c -- Assemble for the I860
|
||||
Copyright (C) 1989, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -132,13 +132,18 @@ struct i860_it {
|
|||
enum reloc_type reloc;
|
||||
} the_insn;
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
static void print_insn(struct i860_it *insn);
|
||||
static int getExpression(char *str);
|
||||
#else
|
||||
|
||||
#else /* not __STDC__ */
|
||||
|
||||
static void print_insn();
|
||||
static int getExpression();
|
||||
#endif
|
||||
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
static char *expr_end;
|
||||
static char last_expand; /* error if expansion after branch */
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* m68k.c All the m68020 specific stuff in one convenient, huge,
|
||||
/* tc-m68k.c All the m68020 specific stuff in one convenient, huge,
|
||||
slow to compile, easy to find file.
|
||||
Copyright (C) 1987, 1991 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -381,7 +382,7 @@ struct m68k_incant {
|
|||
#define gettwo(x) (((x)->m_opcode)&0xffff)
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
static char *crack_operand(char *str, struct m68k_op *opP);
|
||||
static int get_num(struct m68k_exp *exp, int ok);
|
||||
|
@ -397,7 +398,7 @@ static void s_data2(void);
|
|||
static void s_even(void);
|
||||
static void s_proc(void);
|
||||
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
|
||||
static char *crack_operand();
|
||||
static int get_num();
|
||||
|
@ -413,7 +414,7 @@ static void s_data2();
|
|||
static void s_even();
|
||||
static void s_proc();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
static enum m68k_architecture current_architecture = 0;
|
||||
|
||||
|
|
|
@ -386,7 +386,7 @@ struct m68k_incant {
|
|||
#define gettwo(x) (((x)->m_opcode)&0xffff)
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
static char *crack_operand(char *str, struct m68k_op *opP);
|
||||
static int get_num(struct m68k_exp *exp, int ok);
|
||||
|
@ -402,7 +402,7 @@ static void s_data2(void);
|
|||
static void s_even(void);
|
||||
static void s_proc(void);
|
||||
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
|
||||
static char *crack_operand();
|
||||
static int get_num();
|
||||
|
@ -418,7 +418,7 @@ static void s_data2();
|
|||
static void s_even();
|
||||
static void s_proc();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
static enum m68k_architecture current_architecture = 0;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* ns32k.c -- Assemble on the National Semiconductor 32k series
|
||||
Copyright (C) 1987 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -354,19 +354,19 @@ char disp_test[]={ 0,0,0,0,0,0,0,0,
|
|||
char disp_size[]={ 4,1,2,0,4 };
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
static segT evaluate_expr(expressionS *resultP, char *ptr);
|
||||
static void md_number_to_disp(char *buf, long val, int n);
|
||||
static void md_number_to_imm(char *buf, long val, int n);
|
||||
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
|
||||
static segT evaluate_expr();
|
||||
static void md_number_to_disp();
|
||||
static void md_number_to_imm();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
/* Parses a general operand into an addressingmode struct
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* ns32k-opcode.h -- Opcode table for National Semi 32k processor
|
||||
Copyright (C) 1987 Free Software Foundation, Inc.
|
||||
/* tc-ns32k.h -- Opcode table for National Semi 32k processor
|
||||
Copyright (C) 1987, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
|||
#define MAX_ARGS 4
|
||||
#define ARG_LEN 50
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
|
||||
void fix_new_ns32k(fragS *frag,
|
||||
int where,
|
||||
|
@ -47,11 +47,11 @@ void fix_new_ns32k(fragS *frag,
|
|||
void *bit_fixP, /* really bit_fixS */
|
||||
int bsr);
|
||||
|
||||
#else /* __STDC__ */
|
||||
#else /* not __STDC__ */
|
||||
|
||||
void fix_new_ns32k();
|
||||
|
||||
#endif /* __STDC__ */
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
|
||||
/* end of tc-ns32k.h */
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#define cypress 1234
|
||||
/* tc-sparc.c -- Assemble for the SPARC
|
||||
Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
|
@ -18,6 +17,8 @@
|
|||
along with GAS; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#define cypress 1234
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -111,17 +112,18 @@ int pcrel;
|
|||
enum reloc_type reloc;
|
||||
} the_insn, set_insn;
|
||||
|
||||
#ifdef __STDC__
|
||||
#if __STDC__ == 1
|
||||
#if 0
|
||||
static void print_insn(struct sparc_it *insn);
|
||||
#endif
|
||||
static int getExpression(char *str);
|
||||
#else
|
||||
#else /* not __STDC__ */
|
||||
#if 0
|
||||
static void print_insn();
|
||||
#endif
|
||||
static int getExpression();
|
||||
#endif
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
static char *expr_end;
|
||||
static int special_case;
|
||||
|
||||
|
@ -1496,7 +1498,7 @@ void tc_aout_fix_to_chars(where, fixP, segment_address_in_file)
|
|||
{
|
||||
long r_index;
|
||||
long r_extern;
|
||||
long r_addend;
|
||||
long r_addend = 0;
|
||||
long r_address;
|
||||
|
||||
know(fixP->fx_addsy);
|
||||
|
|
Loading…
Reference in a new issue