From: will.deacon@arm•com (Will Deacon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] arm64: LLVMLinux: Fix inline arm64 assembly for use with clang
Date: Tue, 9 Sep 2014 11:15:15 +0100 [thread overview]
Message-ID: <20140909101515.GB1754@arm.com> (raw)
In-Reply-To: <CAFzeTN2Q-RkOeDx4jG5jiEtiN7i+gkfmyvBC1b3B1wpDPUDdxw@mail.gmail.com>
On Mon, Sep 08, 2014 at 07:35:47PM +0100, Mark Charlebois wrote:
> When I compile
>
> int main()
> {
> u64 foo, tmp;
>
> // This fails for clang but not gcc
> asm volatile(
> " mrs %0, mair_el1\n"
> " bfi %0, %1, #%2, #8\n"
> " msr mair_el1, %0\n"
> " isb\n"
> : "=&r" (tmp)
> : "r" (foo), "i" (MT_NORMAL * 8));
> }
>
> Clang fails and GCC generates:
>
> 00000000004004f0 <main>:
> 4004f0: d538a208 mrs x8, mair_el1
> 4004f4: b3601d08 bfi x8, x8, #32, #8
> 4004f8: d518a208 msr mair_el1, x8
> 4004fc: d5033fdf isb
> 400500: 2a1f03e0 mov w0, wzr
> 400504: d65f03c0 ret
Ok, so we can just drop the '#' prefix as it probably shouldn't be there
anyway. Can you send a patch making just that change, please?
Will
next prev parent reply other threads:[~2014-09-09 10:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 23:24 [PATCH] arm64: LLVMLinux: Fix inline arm64 assembly for use with clang behanw at converseincode.com
2014-09-08 9:30 ` Olof Johansson
2014-09-10 17:38 ` Will Deacon
2014-09-10 17:49 ` Ard Biesheuvel
2014-09-08 10:53 ` Will Deacon
2014-09-08 18:35 ` Mark Charlebois
2014-09-09 10:15 ` Will Deacon [this message]
2014-09-15 5:30 ` behanw at converseincode.com
2014-09-15 16:02 ` Will Deacon
2014-09-15 16:26 ` Catalin Marinas
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=20140909101515.GB1754@arm.com \
--to=will.deacon@arm$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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