Thread (8 messages) 8 messages, 4 authors, 2020-02-29

Re: [PATCH] ARM: use assembly mnemonics for VFP register access

From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2020-02-25 22:46:38
Also in: lkml

On Tue, Feb 25, 2020 at 12:27 PM Nick Desaulniers
[off-list ref] wrote:
On Tue, Feb 25, 2020 at 11:33 AM Ard Biesheuvel
[off-list ref] wrote:
quoted
On Tue, 25 Feb 2020 at 20:10, Nick Desaulniers [off-list ref] wrote:
quoted
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.
Further, Peter just sent me this response off thread, which I thought
I'd share. Thanks Peter.  Bookmarked.
FWIW the Arm ARM reference manual
https://static.docs.arm.com/ddi0487/ea/DDI0487E_a_armv8_arm.pdf has a
table that maps the pre-UAL syntax to the UAL syntax.

K6.1.2 Pre-UAL instruction syntax for the A32 floating-point instructions
This has an entry mapping pre-UAL (FMRX) to UAL (VMSR)

So they are the same instruction with the modern name being VMSR. If
it is possible to use the new name it will probably confuse fewer
people, but other than that it won't do any harm.
-- 
Thanks,
~Nick Desaulniers

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help