From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Jim Quinlan <james.quinlan@broadcom.com>
Cc: linux-mips@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND PATCH v1] MIPS: uasm: false warning on use of uasm_i_lui()
Date: Thu, 10 Sep 2020 11:37:09 +0200 [thread overview]
Message-ID: <20200910093709.GA10310@alpha.franken.de> (raw)
In-Reply-To: <20200908164512.15379-1-james.quinlan@broadcom.com>
On Tue, Sep 08, 2020 at 12:45:06PM -0400, Jim Quinlan wrote:
> Currently, the example uasm code
>
> uasm_i_lui(p, tmp, 0xa000);
>
> issues a warning at Linux boot when the code is "assembled". This is
> because the "lui" instruction is defined by the macro "Ip_u1s2(_lui)" -- I
> believe it should be Ip_u1u2(_lui) -- and its definition is associated with
> the SIMM macro -- I believe it should be the UIMM macro. The current code
> takes a 32bit number and checks that it can be converted to a 16bit signed
> immediate. This check fails of course for an immediate such as 0x0000a000.
IMHO SIMM is correct as the upper 16bits will be sign extended on 64bit
CPUs.
Your example looks like to try to load a KSEG1 address, so just use
uasm_i_lui(p, tmp, uasm_rel_hi(0xa0000000));
which even makes it clearer, what this is about.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
next prev parent reply other threads:[~2020-09-10 9:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-08 16:45 [RESEND PATCH v1] MIPS: uasm: false warning on use of uasm_i_lui() Jim Quinlan
2020-09-10 9:37 ` Thomas Bogendoerfer [this message]
2020-09-14 17:02 ` Jim Quinlan
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=20200910093709.GA10310@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=james.quinlan@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
/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 NNTP newsgroup(s).