This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
- From: "joseph at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 23 Apr 2009 22:23:57 -0000
- Subject: [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
- References: <20090423214459.10094.aurelien@aurel32.net>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From joseph at codesourcery dot com 2009-04-23 22:23 -------
Subject: Re: New: use of FPU_SETCW or FPU_GETCW causes
illegal instruction on armel
On Thu, 23 Apr 2009, aurelien at aurel32 dot net wrote:
> /usr/include/fpu_control.h on ARM EABI defines FPU_[SG]ETCW as VFP
> coprocessor instructions, whereas armel is soft-float.
>
> #define _FPU_GETCW(cw) \
> __asm__ __volatile__ ("mrc p10, 7, %0, cr1, cr0, 0" : "=r" (cw))
> /* This is fmxr fpscr, %0. */
> #define _FPU_SETCW(cw) \
> __asm__ __volatile__ ("mcr p10, 7, %0, cr1, cr0, 0" : : "r" (cw))
>
> This causes an illegal instruction trap on hardware that does not have a VFP
> unit.
I'm not convinced this is a bug; these macros are inherently nonportable
and should only be used by code that knows it is being built for a
particular FPU and knows about how to use it. Normal code should use
<fenv.h> instead. That said, making the contents compile-time conditional
like the MIPS version would be reasonable; I don't think it can sensibly
be made run-time conditional.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10094
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.