This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] Patch for floating point tracing


The following patch implements proper tracing for floating point
operands.  It makes use of a recent improvement in sim-trace.c to
limit the number of trailing digits printed when formatting floating
point numbers.  Okay to commit?

2000-12-23  Ben Elliston  <bje@redhat.com>

	* cgen-trace.c (trace_result): Handle 'f' type operands; output
	them to the trace stream using sim_fpu_printn_fpu. Include
	"sim-fpu.h".

*** cgen-trace.c	2000/10/08 22:54:11	1.22
--- cgen-trace.c	2000/12/23 12:04:40
***************
*** 22,27 ****
--- 22,28 ----
  #include "dis-asm.h"
  #include "bfd.h"
  #include "sim-main.h"
+ #include "sim-fpu.h"
  
  #undef min
  #define min(a,b) ((a) < (b) ? (a) : (b))
***************
*** 239,244 ****
--- 240,258 ----
      default :
        cgen_trace_printf (cpu, "%s <- 0x%x", name, va_arg (args, int));
        break;
+     case 'f':
+       {
+ 	DI di;
+ 	sim_fpu f;
+ 
+ 	/* this is separated from previous line for sunos cc */
+ 	di = va_arg (args, DI);
+ 	sim_fpu_64to (&f, di);
+ 
+ 	cgen_trace_printf (cpu, "%s <- ", name);
+ 	sim_fpu_printn_fpu (&f, (sim_fpu_print_func *) cgen_trace_printf, 4, cpu);
+ 	break;
+       }
      case 'D' :
        {
  	DI di;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]