public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* cgen bug with larger-than-normal instructions?
@ 2000-09-14 16:31 matthew green
  2000-09-14 17:07 ` Doug Evans
  2000-10-13  2:49 ` matthew green
  0 siblings, 2 replies; 6+ messages in thread
From: matthew green @ 2000-09-14 16:31 UTC (permalink / raw)
  To: cgen

hi folks.


i am doing a sim port for an architecture that has 16 bit insns for
all but the 16-bit & 32-bit immediately load insns, which are 32-bits
& 48-bits long each, with the immediate value placed after the insn.

currently, cgen produces code that fails to compile:

decode.cxx:1457: implicit declaration of function `int GETIMEMUHI(...)'



this function is currently missing from cgen-cpu.h, but even after i
add it there, the problem persists.  i believe the generate code is
wrong, and (with an insight from bje) i have developed the following
patch.  it makes two changes to cgen itself:

	- call GETIMEM* as "current_cpu->GETIMEM*"

	- first argument of GETIMEM*() is "pc"

this allows my decoder to build, but i haven't tested that it works
yet (i have now pages of errors for sem.cxx to deal with).


is this patch valid?  if so, could someone commit it to sourcware?


thanks,


.mrg.




Index: utils-cgen.scm
===================================================================
RCS file: /cvs/cvsfiles/devo/cgen/utils-cgen.scm,v
retrieving revision 1.55
diff -p -r1.55 utils-cgen.scm
*** utils-cgen.scm	2000/07/27 04:53:32	1.55
--- utils-cgen.scm	2000/09/14 23:17:09
***************
*** 630,642 ****
  ; ??? Aligned/unaligned support?
  
  (define (gen-ifetch pc-var bitoffset bitsize)
!   (string-append "GETIMEM"
  		 (case bitsize
  		   ((8) "UQI")
  		   ((16) "UHI")
  		   ((32) "USI")
  		   (else (error "bad bitsize argument to gen-ifetch" bitsize)))
! 		 " (current_cpu, "
  		 pc-var " + " (number->string (quotient bitoffset 8))
  		 ")")
  )
--- 630,642 ----
  ; ??? Aligned/unaligned support?
  
  (define (gen-ifetch pc-var bitoffset bitsize)
!   (string-append "current_cpu->GETIMEM"
  		 (case bitsize
  		   ((8) "UQI")
  		   ((16) "UHI")
  		   ((32) "USI")
  		   (else (error "bad bitsize argument to gen-ifetch" bitsize)))
! 		 " (pc, "
  		 pc-var " + " (number->string (quotient bitoffset 8))
  		 ")")
  )

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

end of thread, other threads:[~2000-10-13  2:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-14 16:31 cgen bug with larger-than-normal instructions? matthew green
2000-09-14 17:07 ` Doug Evans
2000-09-14 19:19   ` matthew green
2000-09-15  8:55     ` Doug Evans
     [not found]       ` <20000915115929.G14583@redhat.com>
2000-09-15  9:14         ` Doug Evans
2000-10-13  2:49 ` matthew green

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