[patch] MAX_UNITS for sid profiling

Dave Brolley <[email protected]>
Newsgroups gmane.comp.emulators.sid.devel,gmane.comp.tools.cgen.devel
Organization Red Hat Canada, Ltd
Message-ID <[email protected]>
Hi,

I've committed this patch which generates MAX_UNITS as a static const 
int instead of a #define so that it will be correctly encapsulated 
within the namespace it's declared in. This allows the existency of 
profiling models for multiple cpus with potentially different values of 
MAX_UNITS.

The patch also corrects a typo in a call to 'logit'.

Dave
MAX_UNITS.ChangeLog (text/plain, 194 B)
2003-10-21  Dave Brolley  <[email protected]>

	* sid-model.scm (-gen-model-class-decls): Generate MAX_UNITS as
	a static const int.
	* decode.scm (-opcode-slots): Correct typo in logit call.
MAX_UNITS.patch.txt (text/plain, 2.2 KB)
Index: cgen/decode.scm
===================================================================
RCS file: /cvs/src/src/cgen/decode.scm,v
retrieving revision 1.8
diff -c -p -r1.8 decode.scm
*** cgen/decode.scm	17 Jul 2003 06:19:35 -0000	1.8
--- cgen/decode.scm	21 Oct 2003 16:39:53 -0000
***************
*** 451,457 ****
  	   (opcode-mask (compute (insn-base-mask insn) insn-len decode-len bitnums))
  	   (indices (missing-bit-indices opcode-mask (- (integer-expt 2 decode-len) 1))))
        (logit 3 "insn =" (obj:name insn)
! 	     " insn-base-value=" (insn-base-value insn)
  	     " insn-base-mask=" (insn-base-mask insn)
  	     " insn-len=" insn-len
  	     " decode-len=" decode-len
--- 451,457 ----
  	   (opcode-mask (compute (insn-base-mask insn) insn-len decode-len bitnums))
  	   (indices (missing-bit-indices opcode-mask (- (integer-expt 2 decode-len) 1))))
        (logit 3 "insn =" (obj:name insn)
! 	     " insn-value=" (insn-value insn)
  	     " insn-base-mask=" (insn-base-mask insn)
  	     " insn-len=" insn-len
  	     " decode-len=" decode-len
Index: cgen/sid-model.scm
===================================================================
RCS file: /cvs/src/src/cgen/sid-model.scm,v
retrieving revision 1.7
diff -c -p -r1.7 sid-model.scm
*** cgen/sid-model.scm	16 Jul 2003 05:35:47 -0000	1.7
--- cgen/sid-model.scm	21 Oct 2003 16:39:53 -0000
*************** static const MACH_IMP_PROPERTIES @cpu@_i
*** 249,255 ****
     "  };\n\n"
  
     ; FIXME: revisit MAX_UNITS
!   "  #define MAX_UNITS ("
    (number->string
     (let ((insn-list (non-multi-insns (real-insns (current-insn-list)))))
       (if (null? insn-list)
--- 249,255 ----
     "  };\n\n"
  
     ; FIXME: revisit MAX_UNITS
!   "  static const int MAX_UNITS = "
    (number->string
     (let ((insn-list (non-multi-insns (real-insns (current-insn-list)))))
       (if (null? insn-list)
*************** static const MACH_IMP_PROPERTIES @cpu@_i
*** 264,270 ****
  					 (length (timing:units (cdr insn-timing))))
  				       timing))))
  			  insn-list))))))
!    ")\n"
    )
  )
  
--- 264,270 ----
  					 (length (timing:units (cdr insn-timing))))
  				       timing))))
  			  insn-list))))))
!    ";\n"
    )
  )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.