LKML Archive on
help / color / mirror / Atom feed
From: Peter Smith <>
To: "" <>
Cc: Ard Biesheuvel <>,
	Arnd Bergmann <>,
	clang-built-linux <>,
	Jian Cai <>,
	Linux ARM <>,
	LKML <>,
	"" <>,
	Manoj Gupta <>,
	Nick Desaulniers <>,
	Robin Murphy <>,
	Masahiro Yamada <>, nd <>
Subject: Re: [PATCH 0/3] ARM: make use of UAL VFP mnemonics when possible
Date: Sat, 21 Mar 2020 15:04:14 +0000	[thread overview]
Message-ID: <> (raw)

> To build the kernel with Clang's integrated assembler the VFP code needs
> to make use of the unified assembler language (UAL) VFP mnemonics.
> At first I tried to get rid of the co-processor instructions to access
> the floating point unit along with the macros completely. However, due
> to missing FPINST/FPINST2 argument support in older binutils versions we
> have to keep them around. Once we drop support for binutils 2.24 and
> older, the move to UAL VFP mnemonics will be straight forward with this
> changes applied.
> Tested using Clang with integrated assembler as well as external
> (binutils assembler), various gcc/binutils version down to 4.7/2.23.
> Disassembled and compared the object files in arch/arm/vfp/ to make
> sure this changes leads to the same code. Besides different inlining
> behavior I was not able to spot a difference.

From the perspective of an Arm toolchain developer perspective the
substitutions in this patch series look correct to me.

Some references I found helpful:

The v8-A Arm Architecture Reference Manual chapter Legacy Instruction Syntax for
AArch32 Instruction Sets. Table K6-2 Pre-UAL instruction syntax for A32
floating-point instructions

FMSR/FMRS is the pre-UAL name for VMOV (between general-purpose register and
FMDRR/FMRRD is the pre-UAL name for VMOV (between two general-purpose
registers and a doubleword floating-point register)
FLDMIAD is the pre-UAL name for VLDMIA
FSTMIAD is the pre-UAL name for VSTMIA

FLDMIAX and FSTMIAX has no UAL equivalent and is deprecated in ARMv6 and above,
it is equivalent to pre-UAL FLDMIAD/FSTMIAD except that the imm8 field is set
to twice the number of doubleword registers + 1, instead of twice the number of
doubleword registers. This description is taken from A8.8.50 F*, former
Floating-point instruction mnemonics in the v7-A Arm Architecture reference

The mrrc/mcrr and mcr/mcr correspond to a VMOV instruction. The mrrc/mcrr and
mcr/mcr set opc2 to #4 when accessing registers 16 to 31 as the instructions
can only refer to 16 coprocessor registers. The same bit (7) in the VMOV
corresponds to N, with the register n = UInt(N:Vn) so VMOV can refer to 32

Ref: Arm V8-A
Ref: Arm V7-A

Hope this helps move this forward


> This replaces (and extends) my earlier patch "ARM: use assembly mnemonics
> for VFP register access"
> --
> Stefan
> Stefan Agner (3):
>   ARM: use .fpu assembler directives instead of assembler arguments
>   ARM: use VFP assembler mnemonics in register load/store macros
>   ARM: use VFP assembler mnemonics if available
>  arch/arm/include/asm/vfp.h       |  2 ++
>  arch/arm/include/asm/vfpmacros.h | 31 ++++++++++++++++++++++---------
>  arch/arm/vfp/Makefile            |  5 ++++-
>  arch/arm/vfp/vfphw.S             | 31 ++++++++++++++++++++-----------
>  arch/arm/vfp/vfpinstr.h          | 23 +++++++++++++++++++----
>  5 files changed, 67 insertions(+), 25 deletions(-)
> -- 
> 2.25.1

             reply	other threads:[~2020-03-21 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21 15:04 Peter Smith [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-03-10 22:01 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 0/3] ARM: make use of UAL VFP mnemonics when possible' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).