From: Ken Raeburn Date: Wed, 13 Jul 1994 22:38:03 +0000 (+0000) Subject: ns32k-dis.c (invalid_float): Changed to take char* argument, and test for X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60a70a7b0ebe4e30a99f1a3154ff445c5926b834;p=binutils-gdb.git ns32k-dis.c (invalid_float): Changed to take char* argument, and test for explicitly specified sizes, instead of using sizeof() on host CPU types. (INVALID_FLOAT): Cast first argument. --- diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 0cb8a6d7ac2..abaa9a25607 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -2,7 +2,10 @@ Wed Jul 13 18:01:58 1994 Ken Raeburn (raeburn@cujo.cygnus.com) * ns32k-dis.c: Deleted all code in "#ifdef GDB". (invalid_float): Enabled general version, doesn't require running - on ns32k host. + on ns32k host. Changed to take char* argument, and test for + explicitly specified sizes, instead of using sizeof() on host CPU + types. + (INVALID_FLOAT): Cast first argument. Sun Jul 10 00:27:47 1994 Ian Dall (dall@hfrd.dsto.gov.au) diff --git a/opcodes/ns32k-dis.c b/opcodes/ns32k-dis.c index 1cacee4e364..808fdd204e3 100644 --- a/opcodes/ns32k-dis.c +++ b/opcodes/ns32k-dis.c @@ -32,7 +32,7 @@ static disassemble_info *dis_info; * Hacks to get it to compile <= READ THESE AS FIXES NEEDED */ #define CORE_ADDR unsigned long -#define INVALID_FLOAT(val, size) invalid_float(val, size) +#define INVALID_FLOAT(val, size) invalid_float((char *)val, size) static long read_memory_integer(addr, nr) unsigned char *addr; @@ -801,20 +801,20 @@ get_displacement (buffer, aoffsetp) #if 1 /* a version that should work on ns32k f's&d's on any machine */ int invalid_float(p, len) - register union { double d; float f; } *p; + register char *p; register int len; { register val; - if ( len == sizeof (float) ) - val = (bit_extract(&p.f, 23, 8)/*exponent*/ == 0xff - || (bit_extract(&p, 23, 8)/*exponent*/ == 0 && - bit_extract(&p, 0, 23)/*mantisa*/ != 0)); - else if ( len == sizeof (double) ) - val = (bit_extract(&p.d, 52, 11)/*exponent*/ == 0x7ff - || (bit_extract(&p, 52, 11)/*exponent*/ == 0 - && (bit_extract(&p, 0, 32)/*low mantisa*/ != 0 - || bit_extract(&p, 32, 20)/*high mantisa*/ != 0))); + if ( len == 4 ) + val = (bit_extract(p, 23, 8)/*exponent*/ == 0xff + || (bit_extract(p, 23, 8)/*exponent*/ == 0 && + bit_extract(p, 0, 23)/*mantisa*/ != 0)); + else if ( len == 8 ) + val = (bit_extract(p, 52, 11)/*exponent*/ == 0x7ff + || (bit_extract(p, 52, 11)/*exponent*/ == 0 + && (bit_extract(p, 0, 32)/*low mantisa*/ != 0 + || bit_extract(p, 32, 20)/*high mantisa*/ != 0))); else val = 1; return (val);