[commit] Extracting insn fields

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

I've committed the attached patches.

o The change to sid.scm allows for the reading of the final 24 bits of 
an insn beyond the base. This happened with an internal port which has a 
32 bit base and has some 56 bit insns.

o The change to utils-gen.scm corrects a problem for ports with insns of 
length less than the base.  -gen-ifld-extract uses its second argument 
to generate
the 'total' argument to EXTRACT_{LM}SBO_[U]INT which expects it to be 
the width of the base insn word. Using (min base-length total-length) is 
not correct in this situation. base-length seems to be the correct value.

o The change to utils.scm is simply to update the generated copyright years.

Dave
cgen.ChangeLog (text/plain, 229 B)
2005-02-16  Dave Brolley  <[email protected]>

	* utils.scm: Update copyright years.
	* utils-gen.scm (gen-ifld-extract): Pass base-length to -gen-ifld-extract-base.
	* sid.scm (gen-ifetch): Handle the case where bitsize == 24.
cgen.patch.txt (text/plain, 3.6 KB)
Index: cgen/sid.scm
===================================================================
RCS file: /cvs/src/src/cgen/sid.scm,v
retrieving revision 1.12
diff -c -p -r1.12 sid.scm
*** cgen/sid.scm	22 Mar 2004 20:44:16 -0000	1.12
--- cgen/sid.scm	16 Feb 2005 21:48:56 -0000
***************
*** 1,5 ****
  ; Simulator generator support routines.
! ; Copyright (C) 2000-2004 Red Hat, Inc.
  ; This file is part of CGEN.
  
  ; One goal of this file is to provide cover functions for all methods.
--- 1,5 ----
  ; Simulator generator support routines.
! ; Copyright (C) 2000-2005 Red Hat, Inc.
  ; This file is part of CGEN.
  
  ; One goal of this file is to provide cover functions for all methods.
***************
*** 191,196 ****
--- 191,197 ----
  		 (case bitsize
  		   ((8) "UQI")
  		   ((16) "UHI")
+ 		   ((24) "USI")
  		   ((32) "USI")
  		   (else (error "bad bitsize argument to gen-ifetch" bitsize)))
  		 " (pc, "
Index: cgen/utils-gen.scm
===================================================================
RCS file: /cvs/src/src/cgen/utils-gen.scm,v
retrieving revision 1.11
diff -c -p -r1.11 utils-gen.scm
*** cgen/utils-gen.scm	15 Feb 2005 12:52:00 -0000	1.11
--- cgen/utils-gen.scm	16 Feb 2005 21:48:56 -0000
***************
*** 1,5 ****
  ; Application independent utilities for C/C++ code generation.
! ; Copyright (C) 2000, 2001 Red Hat, Inc.
  ; This file is part of CGEN.
  ; See file COPYING.CGEN for details.
  
--- 1,5 ----
  ; Application independent utilities for C/C++ code generation.
! ; Copyright (C) 2000, 2001, 2005 Red Hat, Inc.
  ; This file is part of CGEN.
  ; See file COPYING.CGEN for details.
  
***************
*** 241,248 ****
         (-gen-ifld-extract-base f total-length base-value)
         (if (ifld-beyond-base? f base-length total-length)
  	   (-gen-ifld-extract-beyond f base-length total-length var-list)
! 	   (-gen-ifld-extract-base f (min base-length total-length)
! 				   base-value)))
     ";"
     (if macro? " \\\n" "\n")
     )
--- 241,247 ----
         (-gen-ifld-extract-base f total-length base-value)
         (if (ifld-beyond-base? f base-length total-length)
  	   (-gen-ifld-extract-beyond f base-length total-length var-list)
! 	   (-gen-ifld-extract-base f base-length base-value)))
     ";"
     (if macro? " \\\n" "\n")
     )
Index: cgen/utils.scm
===================================================================
RCS file: /cvs/src/src/cgen/utils.scm,v
retrieving revision 1.15
diff -c -p -r1.15 utils.scm
*** cgen/utils.scm	27 Jan 2005 20:31:12 -0000	1.15
--- cgen/utils.scm	16 Feb 2005 21:48:56 -0000
***************
*** 1,5 ****
  ; Generic Utilities.
! ; Copyright (C) 2000-2004 Red Hat, Inc.
  ; This file is part of CGEN.
  ; See file COPYING.CGEN for details.
  
--- 1,5 ----
  ; Generic Utilities.
! ; Copyright (C) 2000-2005 Red Hat, Inc.
  ; This file is part of CGEN.
  ; See file COPYING.CGEN for details.
  
***************
*** 1251,1257 ****
    (cons "\
  THIS FILE IS MACHINE GENERATED WITH CGEN.
  
! Copyright 1996-2004 Free Software Foundation, Inc.
  "
  	"\
  This program is free software; you can redistribute it and/or modify
--- 1251,1257 ----
    (cons "\
  THIS FILE IS MACHINE GENERATED WITH CGEN.
  
! Copyright 1996-2005 Free Software Foundation, Inc.
  "
  	"\
  This program is free software; you can redistribute it and/or modify
*************** with this program; if not, write to the 
*** 1276,1282 ****
    (cons "\
  THIS FILE IS MACHINE GENERATED WITH CGEN.
  
! Copyright (C) 2000-2004 Red Hat, Inc.
  "
  	"\
  "))
--- 1276,1282 ----
    (cons "\
  THIS FILE IS MACHINE GENERATED WITH CGEN.
  
! Copyright (C) 2000-2005 Red Hat, Inc.
  "
  	"\
  "))
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.