This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
cgen bug with larger-than-normal instructions?
- To: cgen at sources dot redhat dot com
- subject: cgen bug with larger-than-normal instructions?
- From: matthew green <mrg at cygnus dot com>
- Date: Fri, 15 Sep 2000 10:30:48 +1100
- organisation: Red Hat, Inc.
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))
")")
)