Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 21 Jul 2015 22:25:16 +0200
From: Szabolcs Nagy <>
Subject: Re: fenv.s ARMv7 with clang

* Szabolcs Nagy <> [2015-07-21 15:08:25 +0200]:
> * Kjell Braden <> [2015-07-21 10:23:56 +0200]:
> > I've attached a patch that allows to compile fenv.s when using clang
> > targeting ARMv7. I haven't tried this with older architectures or other
> > compilers, but clang refuses to compile MRC/MCR with cp10. Instead, it
> > requires using VMSR/VMRS with FPSCR.
> > 
> there is a problem which i also have to fix in math/armhf/*.s
> some armhf toolchains don't pass down -mfpu=vfp to the assembler,
> they just add ".fpu vfp" directive to the asm when compiling c code,
> so when you compile an asm file directly without the .fpu directive
> the vfp instructions are rejected by gas.
> the solution is either pass -mfpu=vfp* in the CFLAGS (but it needs
> some amount of configure trickery) or add the .fpu directive to
> these asm files.
> asm for reading FPSCR (all have the same encoding):
> .word 0xeef10a10       // always ok but not treated as an insn
> mcr p10,7,r0,cp1,cp0,0 // should be always ok, deprecated?
> fmrx r0,fpscr          // old mnemonics, needs vfp
> vmrs r0,fpscr          // new mnemonics, needs vfp and binutils >=2.21
> i think we should change all armhf asm to use the old mnemonics
> (i think "unified assembler language" was introduced in armv7 and
> vfpv3, but new binutils accepts both old and new mnemonics independently
> of arm version) and add ".fpu vfp" if vfp instructions are used.
> i will do these changes if there are no objections.

attached a patch.

View attachment "0001-fix-armhf-asm-to-use-.fpu-vfp-and-robust-mnemonics.patch" of type "text/x-diff" (3792 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.