public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: "Michael Chapman" <michael.chapman@wanadoo.fr>
To: <cgen@sources.redhat.com>
Subject: Different length variants of the same instruction
Date: Fri, 27 Sep 2002 17:19:00 -0000	[thread overview]
Message-ID: <001901c26684$c08ce2d0$8001a8c0@wanadoo.fr> (raw)

I can't figure out how to get the assembler to work with different
lengths of the same instruction e.g.
    mov r1, #imm4    (16 bit instruction for immediate values 0-15)
and
    mov r1, #imm16  (32 bit instruction for immediate values 0-65535)

If I simply have the following description

(dni mov-rd-imm4 "mov rd,#imm4"
     ()
     "mov $rd,$hash$imm4"
     (+ (f-opcode #x10) rd imm4)
     (set rd imm4)
     ()
)

(dni mov-rd-imm16 "mov rd,#imm16"
     ()
     "mov $rd,$hash$imm16"
     (+ (f-opcode #x60) rd (f-rsvd-rs 0) imm16)
     (set rd imm16)
     ()
)

I.e. the imm4 variant before the imm16 variant then I can write
    mov r1, #0x1234
to get a 32 bit instruction.

However if I try
   mov r1, #(l2-l1)
where l1 and l2 are instruction labels, it always tries to assemble this
with the imm4 variant -
even if the value of the expression is too big.

Why?

I have a similiar problem with conditional branches which come in two
lengths as well.

I have experimented with RELAX and RELAXABLE with no sucess.

Can someone explain things?

Thanks,
Mike Chapman


                 reply	other threads:[~2002-09-28  0:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='001901c26684$c08ce2d0$8001a8c0@wanadoo.fr' \
    --to=michael.chapman@wanadoo.fr \
    --cc=cgen@sources.redhat.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).