BUG: non-fixed-length ISAs are unsupported for now
Sergey Belyashov
sergey.belyashov@gmail.com
Thu Apr 23 13:37:16 GMT 2020
Hi,
While analyzing code of CGEN I have found next code:
; Return the definition of an instruction value entry.
(define (gen-ivalue-entry insn)
(string-list "{ "
"0x" (number->string (insn-value insn) 16)
(if #f ; (ifmt-opcodes-beyond-base? (insn-ifmt insn))
(string-list ", { "
; ??? wip: opcode values beyond the base
insn
"0 }")
"")
" }")
)
and
; Given INSN, return the sum of the constant values in the insn
; (i.e. the opcode field).
;
; See also (compute-insn-base-mask).
;
; FIXME: For non-fixed-length ISAs, using this doesn't feel right.
(define (insn-value insn)
(if (elm-get insn '/insn-value)
(elm-get insn '/insn-value)
(let* ((base-len (insn-base-mask-length insn))
(value (apply +
(map (lambda (fld) (ifld-value fld base-len
(ifld-get-value fld)))
(find ifld-constant?
(ifields-base-ifields (insn-iflds
insn))))
)))
(elm-set! insn '/insn-value value)
value))
)
Can anybody add support for non-fixed-length ISAs?
Best regards,
Sergey Belyashov
More information about the Cgen
mailing list