mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: status of armhf asm with VFP instructions
Date: Fri, 16 Oct 2015 00:33:20 +0200	[thread overview]
Message-ID: <20151015223320.GW10551@port70.net> (raw)

it is not possible to write arm asm in a way that pleases all
assemblers, here is a summary of the problems relevant to musl:

some instructions can be written in several ways since UAL
(= unified assembler language) was introduced to unify arm
and thumb instruction mnemonics.

in case of armhf VFP instructions musl uses the following ones
in hand written asm:

 hex       ual         old

 eeb1XacX  vsqrt.f32   fsqrts
 eeb1XbcX  vsqrt.f64   fsqrtd
 eeb0XacX  vabs.f64    fabss
 eeb0XbcX  vabs.f64    fabsd
 eef1Xa10  vmrs fpscr  mrc p10,7,..
 eee1Xa10  vmsr fpscr  mcr p10,7,..

the issues:

(1) binutils gas rejects UAL VFP instructions unless either
the -mfpu=<vfp variant> option is passed or the asm source
has '.fpu <vfp variant>' directive, the old names work though
(if the target is hard float).  A gcc toolchain built
--with-float=hard but without --with-fpu=<vfp variant> does not
pass -mfpu to the assembler.

(2) Most UAL mnemonics were added in binutils 2.18, older
binutils only supports the old syntax.  Some UAL mnemonics were
added later, vmrs and vmsr only appear in binutils 2.21
(released in 2010).

(3) The clang assembler does not support old mnemonics in general
but includes a few exceptions (e.g. fabs and fsqrt are supported,
but not the mrc or mcr coprocessor instructions).

Using UAL asm is the clean solution, but then to fix (1) we
should have .fpu directives in the asm files.

However the conflict between (2) and (3) means that fenv code
using vmrs and vmsr either drops support for old binutils gas
or the clang assembler.


             reply	other threads:[~2015-10-15 22:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 22:33 Szabolcs Nagy [this message]
2015-10-15 22:44 ` Rich Felker
2015-10-15 23:16   ` Szabolcs Nagy
2015-10-15 23:58     ` Szabolcs Nagy
2015-10-19  6:12       ` Rich Felker
2015-10-16  0:00     ` Rich Felker
2015-10-16  0:33       ` Szabolcs Nagy
2015-10-16  1:03         ` Rich Felker
2015-10-16  3:23           ` Rich Felker
2015-10-16  6:42     ` Khem Raj

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=20151015223320.GW10551@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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