* remote-nindy.c (nindy_open): Acquire more target state so that

user can attach to a previously running program.
	* (nindy_fetch_registers nindy_store_registers):  Get rid of fp
	conversion code.  That's all handled in {extract store}_floating
	now.
	* utils.c (floatformat_to_double):  Don't bias exponent when
	handling zero's, denorms or NaNs.
	* config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL
	REGISTER_CONVERT_TO_RAW):  Change to using DOUBLST and
	FLOATFORMAT_TO/FROM_DOUBLEST macros.
	* config/i960/tm-nindy960.h:  Undefine
	REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW, and
	REGISTER_CONVERTIBLE.  These are no longer necessary now that all
	the magic happens in extract/store_floating.
This commit is contained in:
Stu Grossman 1996-04-13 21:33:59 +00:00
parent 9898b3b7c7
commit 449abd8900
5 changed files with 47 additions and 29 deletions

View File

@ -1,3 +1,20 @@
Sat Apr 13 14:21:16 1996 Stu Grossman (grossman@critters.cygnus.com)
* remote-nindy.c (nindy_open): Acquire more target state so that
user can attach to a previously running program.
* (nindy_fetch_registers nindy_store_registers): Get rid of fp
conversion code. That's all handled in {extract store}_floating
now.
* utils.c (floatformat_to_double): Don't bias exponent when
handling zero's, denorms or NaNs.
* config/i960/tm-i960.h (REGISTER_CONVERT_TO_VIRTUAL
REGISTER_CONVERT_TO_RAW): Change to using DOUBLST and
FLOATFORMAT_TO/FROM_DOUBLEST macros.
* config/i960/tm-nindy960.h: Undefine
REGISTER_CONVERT_TO_VIRTUAL, REGISTER_CONVERT_TO_RAW, and
REGISTER_CONVERTIBLE. These are no longer necessary now that all
the magic happens in extract/store_floating.
Sat Apr 13 02:58:02 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* eval.c (evaluate_subexp_standard): Report error when attempting to

View File

@ -170,8 +170,8 @@ extern CORE_ADDR saved_pc_after_call ();
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
{ \
double val; \
floatformat_to_double (&floatformat_i960_ext, (FROM), &val); \
DOUBLEST val; \
FLOATFORMAT_TO_DOUBLEST (&floatformat_i960_ext, (FROM), &val); \
store_floating ((TO), TYPE_LENGTH (TYPE), val); \
}
@ -180,8 +180,8 @@ extern CORE_ADDR saved_pc_after_call ();
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
{ \
double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
floatformat_from_double (&floatformat_i960_ext, &val, (TO)); \
DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
FLOATFORMAT_FROM_DOUBLEST (&floatformat_i960_ext, &val, (TO)); \
}
/* Return the GDB type object for the "standard" data type

View File

@ -95,3 +95,7 @@ nindy_frame_chain_valid(); /* See nindy-tdep.c */
*/
#define DECR_PC_AFTER_BREAK 0
#undef REGISTER_CONVERT_TO_VIRTUAL
#undef REGISTER_CONVERT_TO_RAW
#undef REGISTER_CONVERTIBLE

View File

@ -211,7 +211,13 @@ nindy_open (name, from_tty)
savename = savestring (name, strlen (name));
push_target (&nindy_ops);
target_fetch_registers(-1);
init_thread_list ();
init_wait_for_inferior ();
clear_proceed_status ();
normal_stop ();
}
/* User-initiated quit of nindy operations. */
@ -437,8 +443,7 @@ nindy_fetch_registers(regno)
int regno;
{
struct nindy_regs nindy_regs;
int regnum, inv;
double dub;
int regnum;
immediate_quit++;
ninRegsGet( (char *) &nindy_regs );
@ -449,14 +454,7 @@ nindy_fetch_registers(regno)
memcpy (&registers[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2*4);
memcpy (&registers[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1*4);
memcpy (&registers[REGISTER_BYTE (TCW_REGNUM)], nindy_regs.tcw, 1*4);
for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++) {
dub = unpack_double (builtin_type_double,
&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
&inv);
/* dub now in host byte order */
FLOATFORMAT_FROM_DOUBLEST (&floatformat_i960_ext, &dub,
&registers[REGISTER_BYTE (regnum)]);
}
memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8);
registers_fetched ();
}
@ -474,21 +472,13 @@ nindy_store_registers(regno)
{
struct nindy_regs nindy_regs;
int regnum;
double dub;
memcpy (nindy_regs.local_regs, &registers[REGISTER_BYTE (R0_REGNUM)], 16*4);
memcpy (nindy_regs.global_regs, &registers[REGISTER_BYTE (G0_REGNUM)], 16*4);
memcpy (nindy_regs.pcw_acw, &registers[REGISTER_BYTE (PCW_REGNUM)], 2*4);
memcpy (nindy_regs.ip, &registers[REGISTER_BYTE (IP_REGNUM)], 1*4);
memcpy (nindy_regs.tcw, &registers[REGISTER_BYTE (TCW_REGNUM)], 1*4);
for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++)
{
FLOATFORMAT_TO_DOUBLEST (&floatformat_i960_ext,
&registers[REGISTER_BYTE (regnum)], &dub);
store_floating (&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
REGISTER_VIRTUAL_SIZE (regnum),
dub);
}
memcpy (nindy_regs.fp_as_double, &registers[REGISTER_BYTE (FP0_REGNUM)], 8*4);
immediate_quit++;
ninRegsPut( (char *) &nindy_regs );

View File

@ -2035,6 +2035,7 @@ floatformat_to_long_double (fmt, from, to)
unsigned long mant;
unsigned int mant_bits, mant_off;
int mant_bits_left;
int special_exponent; /* It's a NaN, denorm or zero */
exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
fmt->exp_start, fmt->exp_len);
@ -2045,7 +2046,12 @@ floatformat_to_long_double (fmt, from, to)
mant_bits_left = fmt->man_len;
mant_off = fmt->man_start;
dto = 0.0;
exponent -= fmt->exp_bias;
special_exponent = exponent == 0 || exponent == fmt->exp_nan;
/* Don't bias zero's, denorms or NaNs. */
if (!special_exponent)
exponent -= fmt->exp_bias;
/* Build the result algebraically. Might go infinite, underflow, etc;
who cares. */
@ -2053,10 +2059,11 @@ floatformat_to_long_double (fmt, from, to)
/* If this format uses a hidden bit, explicitly add it in now. Otherwise,
increment the exponent by one to account for the integer bit. */
if (fmt->intbit == floatformat_intbit_no)
dto = ldexp (1.0, exponent);
else
exponent++;
if (!special_exponent)
if (fmt->intbit == floatformat_intbit_no)
dto = ldexp (1.0, exponent);
else
exponent++;
while (mant_bits_left > 0)
{
@ -2074,7 +2081,7 @@ floatformat_to_long_double (fmt, from, to)
/* Negate it if negative. */
if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
dto = -dto;
memcpy (to, &dto, sizeof (dto));
*to = dto;
}
static void put_field PARAMS ((unsigned char *, enum floatformat_byteorders,