lkml.org 
[lkml]   [2014]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] arm64: LLVMLinux: Fix inline arm64 assembly for use with clang
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


\
 
 \ /
  Last update: 2014-09-09 12:41    [W:0.596 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site