public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Tracing for floating point values
@ 2000-12-08 14:57 Ben Elliston
  2000-12-14 17:04 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Elliston @ 2000-12-08 14:57 UTC (permalink / raw)
  To: CGEN; +Cc: gdb

Currently, the TRACE_RESULTS web of macros/functions in
sim/common/cgen-trace.c don't know how to handle the 'f' printf-type for SF
and DF operands.  Only 'D' and 'x' are handled at present.

I set about fixing this yesterday.  There were two approaches I considered:

	* use the host's native printf %x.  Comments in sim-fpu.[hc]
	  indicate this is a bad mistake.  There's no guarantee that the
	  host will use the same floating point representation as the
	  target.

	* use sim_fpu's sim_fpu_print_fpu to output the real number
	  using cgen_trace_printf as its callback (which works nicely).
	  However, we get very detailed output!

	fr <- +1.0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000*2^+0

Which way seems right to jump?

Ben

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Tracing for floating point values
  2000-12-08 14:57 Tracing for floating point values Ben Elliston
@ 2000-12-14 17:04 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2000-12-14 17:04 UTC (permalink / raw)
  To: Ben Elliston; +Cc: CGEN, gdb

Ben Elliston wrote:
> 
> Currently, the TRACE_RESULTS web of macros/functions in
> sim/common/cgen-trace.c don't know how to handle the 'f' printf-type for SF
> and DF operands.  Only 'D' and 'x' are handled at present.
> 
> I set about fixing this yesterday.  There were two approaches I considered:
> 
>         * use the host's native printf %x.  Comments in sim-fpu.[hc]
>           indicate this is a bad mistake.  There's no guarantee that the
>           host will use the same floating point representation as the
>           target.

You would need to be very careful about SNaNs.

>         * use sim_fpu's sim_fpu_print_fpu to output the real number
>           using cgen_trace_printf as its callback (which works nicely).
>           However, we get very detailed output!
> 
>         fr <- +1.0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000*2^+0
> 
> Which way seems right to jump?

What about a print function that outputs things in decimal - something
like ``%f'' or ``%g''.  While the existing print function is really
useful for someone debugging the internals it isn't much use to normal
users.

	Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-12-14 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-08 14:57 Tracing for floating point values Ben Elliston
2000-12-14 17:04 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).