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]

cgen bug with larger-than-normal instructions?




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


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