public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* BUG: non-fixed-length ISAs are unsupported for now
@ 2020-04-23 13:37 Sergey Belyashov
  2020-04-27 16:29 ` Frank Ch. Eigler
  0 siblings, 1 reply; 24+ messages in thread
From: Sergey Belyashov @ 2020-04-23 13:37 UTC (permalink / raw)
  To: cgen

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-08-13 14:47 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 13:37 BUG: non-fixed-length ISAs are unsupported for now Sergey Belyashov
2020-04-27 16:29 ` Frank Ch. Eigler
2020-04-27 17:00   ` Sergey Belyashov
2020-04-27 17:52     ` Sergey Belyashov
2020-04-27 18:03     ` Jose E. Marchesi
2020-04-27 19:34       ` Sergey Belyashov
2020-04-27 20:01         ` Jose E. Marchesi
2020-04-27 20:23           ` Sergey Belyashov
2020-04-29 19:11           ` Sergey Belyashov
2020-07-30  9:11             ` Sergey Belyashov
2020-08-11 15:38               ` Frank Ch. Eigler
2020-08-11 15:57                 ` Sergey Belyashov
2020-08-11 16:08                   ` Frank Ch. Eigler
2020-08-12 13:59                     ` Sergey Belyashov
2020-08-12 18:36                       ` Frank Ch. Eigler
2020-08-12 18:53                         ` Jose E. Marchesi
2020-08-12 19:19                           ` Sergey Belyashov
2020-08-12 19:21                             ` Frank Ch. Eigler
2020-08-12 19:27                               ` Jose E. Marchesi
2020-08-12 19:44                                 ` Sergey Belyashov
2020-08-12 19:57                                   ` Frank Ch. Eigler
2020-08-13 13:34                                     ` Sergey Belyashov
2020-08-13 14:32                                       ` Frank Ch. Eigler
2020-08-13 14:47                                         ` Sergey Belyashov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).