From: Nick Desaulniers <ndesaulniers@google.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Stefan Agner <stefan@agner.ch>, Arnd Bergmann <arnd@arndb.de>,
LKML <linux-kernel@vger.kernel.org>,
Jian Cai <jiancai@google.com>,
clang-built-linux <clang-built-linux@googlegroups.com>,
Manoj Gupta <manojgupta@google.com>,
Russell King <linux@armlinux.org.uk>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: use assembly mnemonics for VFP register access
Date: Tue, 25 Feb 2020 12:27:26 -0800 [thread overview]
Message-ID: <CAKwvOd=9WaeVjvgkkLf5scFaNTpx28d4FAse62vv4X_mEwqRJA@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu881ZSwvuACmsbBnpfdeJpNYsEQxLSoepJBbZ=O6D6Rcg@mail.gmail.com>
On Tue, Feb 25, 2020 at 11:33 AM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Tue, 25 Feb 2020 at 20:10, Nick Desaulniers <ndesaulniers@google.com> wrote:
> > Ah, this is only when streaming to assembly. Looks like they have the
> > same encoding, and produce the same disassembly. (Godbolt emits
> > assembly by default, and has the option to compile, then disassemble).
> > If I take my case from godbolt above:
> >
> > ➜ /tmp arm-linux-gnueabihf-gcc -O2 -c x.c
> > ➜ /tmp llvm-objdump -dr x.o
> >
> > x.o: file format elf32-arm-little
> >
> >
> > Disassembly of section .text:
> >
> > 00000000 bar:
> > 0: f1 ee 10 0a vmrs r0, fpscr
> > 4: 70 47 bx lr
> > 6: 00 bf nop
> >
> > 00000008 baz:
> > 8: f1 ee 10 0a vmrs r0, fpscr
> > c: 70 47 bx lr
> > e: 00 bf nop
> >
> > So indeed a similar encoding exists for the two different assembler
> > instructions.
>
> Does that hold for ARM (A32) instructions as well?
TIL -mthumb is the default for arm-linux-gnueabihf-gcc -O2.
➜ /tmp arm-linux-gnueabihf-gcc -O2 -c x.c -marm
➜ /tmp llvm-objdump -dr x.o
x.o: file format elf32-arm-little
Disassembly of section .text:
00000000 bar:
0: 10 0a f1 ee vmrs r0, fpscr
4: 1e ff 2f e1 bx lr
00000008 baz:
8: 10 0a f1 ee vmrs r0, fpscr
c: 1e ff 2f e1 bx lr
^ Just to show the matching encoding.
--
Thanks,
~Nick Desaulniers
WARNING: multiple messages have this Message-ID (diff)
From: Nick Desaulniers <ndesaulniers@google.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
LKML <linux-kernel@vger.kernel.org>,
Stefan Agner <stefan@agner.ch>, Jian Cai <jiancai@google.com>,
clang-built-linux <clang-built-linux@googlegroups.com>,
Manoj Gupta <manojgupta@google.com>,
Russell King <linux@armlinux.org.uk>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: use assembly mnemonics for VFP register access
Date: Tue, 25 Feb 2020 12:27:26 -0800 [thread overview]
Message-ID: <CAKwvOd=9WaeVjvgkkLf5scFaNTpx28d4FAse62vv4X_mEwqRJA@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu881ZSwvuACmsbBnpfdeJpNYsEQxLSoepJBbZ=O6D6Rcg@mail.gmail.com>
On Tue, Feb 25, 2020 at 11:33 AM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Tue, 25 Feb 2020 at 20:10, Nick Desaulniers <ndesaulniers@google.com> wrote:
> > Ah, this is only when streaming to assembly. Looks like they have the
> > same encoding, and produce the same disassembly. (Godbolt emits
> > assembly by default, and has the option to compile, then disassemble).
> > If I take my case from godbolt above:
> >
> > ➜ /tmp arm-linux-gnueabihf-gcc -O2 -c x.c
> > ➜ /tmp llvm-objdump -dr x.o
> >
> > x.o: file format elf32-arm-little
> >
> >
> > Disassembly of section .text:
> >
> > 00000000 bar:
> > 0: f1 ee 10 0a vmrs r0, fpscr
> > 4: 70 47 bx lr
> > 6: 00 bf nop
> >
> > 00000008 baz:
> > 8: f1 ee 10 0a vmrs r0, fpscr
> > c: 70 47 bx lr
> > e: 00 bf nop
> >
> > So indeed a similar encoding exists for the two different assembler
> > instructions.
>
> Does that hold for ARM (A32) instructions as well?
TIL -mthumb is the default for arm-linux-gnueabihf-gcc -O2.
➜ /tmp arm-linux-gnueabihf-gcc -O2 -c x.c -marm
➜ /tmp llvm-objdump -dr x.o
x.o: file format elf32-arm-little
Disassembly of section .text:
00000000 bar:
0: 10 0a f1 ee vmrs r0, fpscr
4: 1e ff 2f e1 bx lr
00000008 baz:
8: 10 0a f1 ee vmrs r0, fpscr
c: 1e ff 2f e1 bx lr
^ Just to show the matching encoding.
--
Thanks,
~Nick Desaulniers
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-02-25 20:27 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 6:34 [PATCH] ARM: use assembly mnemonics for VFP register access Stefan Agner
2020-02-21 6:34 ` Stefan Agner
2020-02-25 19:10 ` Nick Desaulniers
2020-02-25 19:10 ` Nick Desaulniers
2020-02-25 19:33 ` Ard Biesheuvel
2020-02-25 19:33 ` Ard Biesheuvel
2020-02-25 19:45 ` Robin Murphy
2020-02-25 19:45 ` Robin Murphy
2020-02-25 20:00 ` Stefan Agner
2020-02-25 20:00 ` Stefan Agner
2020-02-25 20:27 ` Nick Desaulniers [this message]
2020-02-25 20:27 ` Nick Desaulniers
2020-02-25 22:46 ` Nick Desaulniers
2020-02-25 22:46 ` Nick Desaulniers
2020-02-29 22:58 ` Stefan Agner
2020-02-29 22:58 ` Stefan Agner
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='CAKwvOd=9WaeVjvgkkLf5scFaNTpx28d4FAse62vv4X_mEwqRJA@mail.gmail.com' \
--to=ndesaulniers@google.com \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=clang-built-linux@googlegroups.com \
--cc=jiancai@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=manojgupta@google.com \
--cc=stefan@agner.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.