This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]