BUG: non-fixed-length ISAs are unsupported for now

Sergey Belyashov via Cgen <[email protected]> Thu, 23 Apr 2020 16:37:16 +0300
Newsgroups gmane.comp.tools.cgen.devel
Message-ID <CAOe0RDzfi4+f2QL-EN83LgLowFG2DQpmajf-gK-rL5ys+Y52NQ@mail.gmail.com>
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