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 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
#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); \
}
#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
*/
#define DECR_PC_AFTER_BREAK 0
+
+#undef REGISTER_CONVERT_TO_VIRTUAL
+#undef REGISTER_CONVERT_TO_RAW
+#undef REGISTER_CONVERTIBLE
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. */
int regno;
{
struct nindy_regs nindy_regs;
- int regnum, inv;
- double dub;
+ int regnum;
immediate_quit++;
ninRegsGet( (char *) &nindy_regs );
memcpy (®isters[REGISTER_BYTE (PCW_REGNUM)], nindy_regs.pcw_acw, 2*4);
memcpy (®isters[REGISTER_BYTE (IP_REGNUM)], nindy_regs.ip, 1*4);
memcpy (®isters[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,
- ®isters[REGISTER_BYTE (regnum)]);
- }
+ memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], nindy_regs.fp_as_double, 4 * 8);
registers_fetched ();
}
{
struct nindy_regs nindy_regs;
int regnum;
- double dub;
memcpy (nindy_regs.local_regs, ®isters[REGISTER_BYTE (R0_REGNUM)], 16*4);
memcpy (nindy_regs.global_regs, ®isters[REGISTER_BYTE (G0_REGNUM)], 16*4);
memcpy (nindy_regs.pcw_acw, ®isters[REGISTER_BYTE (PCW_REGNUM)], 2*4);
memcpy (nindy_regs.ip, ®isters[REGISTER_BYTE (IP_REGNUM)], 1*4);
memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1*4);
- for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++)
- {
- FLOATFORMAT_TO_DOUBLEST (&floatformat_i960_ext,
- ®isters[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, ®isters[REGISTER_BYTE (FP0_REGNUM)], 8*4);
immediate_quit++;
ninRegsPut( (char *) &nindy_regs );
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);
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. */
/* 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)
{
/* 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;
}
\f
static void put_field PARAMS ((unsigned char *, enum floatformat_byteorders,