public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Only fetch "normal" instruction chunk sizes
@ 2005-05-17  1:47 Jim Blandy
  0 siblings, 0 replies; only message in thread
From: Jim Blandy @ 2005-05-17  1:47 UTC (permalink / raw)
  To: cgen


I've committed this.  The comments in the code are supposed to explain
why the code should be this way; if it's not clear, let me know.

2005-05-13  Jim Blandy  <jimb@redhat.com>

	* sid.scm (gen-ifetch): Require BITSIZE to be exactly the size
	fetched by one of our GETIMEM* methods.
	* utils-gen.scm (-extract-chunk-specs): Always fetch full
	base-insn-sized chunks.

Index: cgen/sid.scm
===================================================================
RCS file: /cvs/cvsfiles/devo/cgen/sid.scm,v
retrieving revision 1.60.4.1
diff -c -p -r1.60.4.1 sid.scm
*** cgen/sid.scm	6 Apr 2005 23:42:15 -0000	1.60.4.1
--- cgen/sid.scm	13 May 2005 07:53:55 -0000
***************
*** 173,178 ****
--- 173,185 ----
  ; Return C code to fetch a value from instruction memory.
  ; PC-VAR is the C expression containing the address of the start of the
  ; instruction.
+ ;
+ ; We don't bother trying to handle bitsizes that don't have a
+ ; corresponding GETIMEM method.  Doing so would require us to take
+ ; endianness into account just to ensure that the requested bits end
+ ; up at the proper place in the result.  It's easier just to make the
+ ; caller ask us for something we can do directly.
+ ;
  ; ??? Aligned/unaligned support?
  
  (define (gen-ifetch pc-var bitoffset bitsize)
***************
*** 180,186 ****
  		 (case bitsize
  		   ((8) "UQI")
  		   ((16) "UHI")
- 		   ((24) "USI")
  		   ((32) "USI")
  		   (else (error "bad bitsize argument to gen-ifetch" bitsize)))
  		 " (pc, "
--- 187,192 ----
Index: cgen/utils-gen.scm
===================================================================
RCS file: /cvs/cvsfiles/devo/cgen/utils-gen.scm,v
retrieving revision 1.22
diff -c -p -r1.22 utils-gen.scm
*** cgen/utils-gen.scm	21 Feb 2005 09:06:22 -0000	1.22
--- cgen/utils-gen.scm	13 May 2005 07:53:55 -0000
***************
*** 308,314 ****
  	  (reverse! result)
  	  (loop (+ start chunk-length)
  		(- remaining chunk-length)
! 		(cons (cons start (min chunk-length remaining))
  		      result)))))
  )
  
--- 308,319 ----
  	  (reverse! result)
  	  (loop (+ start chunk-length)
  		(- remaining chunk-length)
! 		; Always fetch full CHUNK-LENGTH-sized chunks here,
! 		; even if we don't actually need that many bytes.
! 		; gen-ifetch only handles "normal" fetch sizes,
! 		; and -gen-extract-word already knows how to find what
! 		; it needs if we give it too much.
! 		(cons (cons start chunk-length)
  		      result)))))
  )
  

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-17  1:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-17  1:47 PATCH: Only fetch "normal" instruction chunk sizes Jim Blandy

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).