public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Tracy.Kuhrt@microchip.com
To: cgen@sourceware.cygnus.com
Subject: Derived Operands
Date: Thu, 05 Oct 2000 16:21:00 -0000	[thread overview]
Message-ID: <OF3C6BE4FE.8883544C-ON0725696F.0080163F@microchip.com> (raw)

I am trying to use derived operands.  I know that they are still a work in
progress, but this is functionality that will help me with the CPU that I
am porting with CGEN.

Following is a snippet of code:

...

; Derived operands
(define-derived-operand
   (name m3-dst-reg-direct)
   (comment "m3 dst reg direct")
   (mode UINT)
   (args (m3-dst-reg))
   (syntax "${m3-dst-reg}")
   (base-ifield f-m3-dst-operand)
   (encoding (+ m3-dst-reg))
   (getter ())
   (setter (set newval (const #b000)))
)

(define-derived-operand
   (name m3-dst-reg-indirect)
   (comment "m3 dst reg indirect")
   (mode UINT)
   (args (m3-dst-reg))
   (syntax "${m3-dst-reg}")
   (base-ifield f-m3-dst-operand)
   (encoding (+ m3-dst-reg))
   (getter ())
   (setter (set newval (const #b001)))
)

(define-anyof-operand
   (name m3-dst-operand)
   (comment "This is any of the m3 dst operands.")
   (mode UINT)
   (base-ifield f-m3-dst-operand)
   (choices m3-dst-reg-direct m3-dst-reg-indirect)
)

...

(define-insn
   (name mov)
   (syntax "mov ${m3-src-reg},${m3-dst-operand}")
   (format (+ OP1_7 OP2_8 (f-byte-operation 0) m3-src-reg m3-dst-operand))
   (semantics (set m3-dst-operand m3-src-reg))
)

I am receiving the following error when trying to generate <arch>-opinst.c
for the instruction that uses the anyof-operand.

10* [map #<procedure (insn)> (#(# #) #(# #) #(# #) ...)]
11* [#<procedure (insn)> #(#("object" # mov ...) (# #f # ...))]
12* [gen-obj-sanitize #(#("object" # mov ...) (# #f # ...)) ...
13* [string-append "  & " ...
14* [gen-sym #:unbound]
15  [gen-c-symbol ...
16* [obj:name #:unbound]
17  [send #:unbound get-name]
18* [-object-check #:unbound "send"]
19* (if (not (object? maybe-object)) (apply -object-error (append! #
extra-text)))
20  [apply #<procedure -object-error (proc-name x . text)> ("send"
#:unbound "not an object")]
    ...
21  [error "send: not an object" #:unbound]

./cos.scm:256:3: In procedure error in expression (error (string-append
proc-name ": " ...) x):
./cos.scm:256:3: send: not an object #:unbound
ABORT: (misc-error)

Any ideas where the problem might be?

Also, as a side note, is there any timeframe for when derived operands will
be completed?

Tracy



             reply	other threads:[~2000-10-05 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-05 16:21 Tracy.Kuhrt [this message]
2000-10-06 19:36 ` Frank Ch. Eigler
2001-03-19 10:48 derived operands J. Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF3C6BE4FE.8883544C-ON0725696F.0080163F@microchip.com \
    --to=tracy.kuhrt@microchip.com \
    --cc=cgen@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).