This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
[RFA:] Fix lsb? bug with insn fields beyond base insn size.
- From: Doug Evans <dje at transmeta dot com>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: cgen at sources dot redhat dot com
- Date: Fri, 21 Jun 2002 12:13:19 -0700 (PDT)
- Subject: [RFA:] Fix lsb? bug with insn fields beyond base insn size.
- References: <200206190111.DAA19613@ignucius.axis.se>
Not something of your making, but one thing that can be cleaned
up in -gen-extract-word is it's use of current-arch-insn-lsb0?.
Either it should use the lsb0? argument, or the lsb0? argument
should be removed. I don't have a strong preference which.
[grep for >>>]
(define (-gen-extract-word word-name word-start word-length start length
unsigned? lsb0?)
; ??? lsb0?
(let ((word-end (+ word-start word-length))
(end (+ start length))
(base (if (< start word-start) word-start start)))
(string-append "("
"EXTRACT_"
>>>>>>> (if (current-arch-insn-lsb0?) "LSB0" "MSB0")
(if (and (not unsigned?)
; Only want sign extension for word with sign bit.
(bitrange-overlap? start 1 word-start word-length
lsb0?))
"_INT ("
"_UINT (")
word-name
", "
(number->string word-length)
", "
(number->string (if (< start word-start)
0
(- start word-start)))
", "
(number->string (if (< end word-end)
(- end base)
(- word-end base)))
") << "
(number->string (if (> end word-end)
(- end word-end)
0))
")"))
)