This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
re: cgen bug with larger-than-normal instructions?
- To: cgen at sources dot redhat dot com
- subject: re: cgen bug with larger-than-normal instructions?
- From: matthew green <mrg at cygnus dot com>
- Date: Fri, 13 Oct 2000 20:49:27 +1100
- organisation: Red Hat, Inc.
OK, here's a patch to move the affected function into si[dm].scm and fix
it there. i've tested that this doesn't affect any other port.
if this is OK, would someone please commit it?
thanks,
.mrg.
2000-10-13 matthew green <mrg@cygnus.com>
* utils-cgen.scm (get-ifetch): Move from here ...
* sim.scm (get-ifetch): ... to here.
* sid.scm (get-ifetch): Copy and port to c++.
Index: sid.scm
===================================================================
RCS file: /cvs/cvsfiles/devo/cgen/sid.scm,v
retrieving revision 1.34
diff -p -r1.34 sid.scm
*** sid.scm 2000/09/08 15:20:01 1.34
--- sid.scm 2000/10/13 09:42:23
***************
*** 181,186 ****
--- 181,203 ----
)
)
+ ; 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.
+ ; ??? 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))
+ ")")
+ )
+
; Return definition of an object's attributes.
; This is like gen-obj-attr-defn, except split for sid.
; TYPE is one of 'ifld, 'hw, 'operand, 'insn.
Index: sim.scm
===================================================================
RCS file: /cvs/cvsfiles/devo/cgen/sim.scm,v
retrieving revision 1.88
diff -p -r1.88 sim.scm
*** sim.scm 2000/09/05 18:39:31 1.88
--- sim.scm 2000/10/13 09:42:24
***************
*** 152,157 ****
--- 152,175 ----
(string-append c-cpu-macro " (" sym ")")
)
+
+ ; 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.
+ ; ??? 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))
+ ")")
+ )
+
; Instruction field support code.
; Return a <c-expr> object of the value of an ifield.
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/10/13 09:42:25
***************
*** 624,645 ****
";} while (0)\n")
)
- ; 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.
- ; ??? 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))
- ")")
- )
; Called before loading the .cpu file to initialize.
--- 624,629 ----