From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8675 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: status of armhf asm with VFP instructions Date: Fri, 16 Oct 2015 00:33:20 +0200 Message-ID: <20151015223320.GW10551@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1444948429 20908 80.91.229.3 (15 Oct 2015 22:33:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2015 22:33:49 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8687-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 16 00:33:44 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Zmr5k-0000Zf-8r for gllmg-musl@m.gmane.org; Fri, 16 Oct 2015 00:33:44 +0200 Original-Received: (qmail 24385 invoked by uid 550); 15 Oct 2015 22:33:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 24308 invoked from network); 15 Oct 2015 22:33:32 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:8675 Archived-At: 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= option is passed or the asm source has '.fpu ' directive, the old names work though (if the target is hard float). A gcc toolchain built --with-float=hard but without --with-fpu= 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.