* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
@ 2009-04-23 22:24 ` joseph at codesourcery dot com
2009-04-24 9:43 ` aurelien at aurel32 dot net
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: joseph at codesourcery dot com @ 2009-04-23 22:24 UTC (permalink / raw)
To: glibc-bugs
------- 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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
2009-04-23 22:24 ` [Bug ports/10094] " joseph at codesourcery dot com
@ 2009-04-24 9:43 ` aurelien at aurel32 dot net
2009-04-24 9:44 ` aurelien at aurel32 dot net
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: aurelien at aurel32 dot net @ 2009-04-24 9:43 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From aurelien at aurel32 dot net 2009-04-24 09:43 -------
Created an attachment (id=3907)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=3907&action=view)
Patch
--
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
2009-04-23 22:24 ` [Bug ports/10094] " joseph at codesourcery dot com
2009-04-24 9:43 ` aurelien at aurel32 dot net
@ 2009-04-24 9:44 ` aurelien at aurel32 dot net
2009-04-24 11:21 ` joseph at codesourcery dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: aurelien at aurel32 dot net @ 2009-04-24 9:44 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From aurelien at aurel32 dot net 2009-04-24 09:44 -------
> 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.
I agree. The patch I just attached, inspired by the mips version should to
the trick.
--
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
` (2 preceding siblings ...)
2009-04-24 9:44 ` aurelien at aurel32 dot net
@ 2009-04-24 11:21 ` joseph at codesourcery dot com
2009-04-24 19:13 ` aurelien at aurel32 dot net
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: joseph at codesourcery dot com @ 2009-04-24 11:21 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From joseph at codesourcery dot com 2009-04-24 11:21 -------
Subject: Re: use of FPU_SETCW or FPU_GETCW causes illegal
instruction on armel
On Fri, 24 Apr 2009, aurelien at aurel32 dot net wrote:
> ------- Additional Comments From aurelien at aurel32 dot net 2009-04-24 09:44 -------
> > 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.
>
> I agree. The patch I just attached, inspired by the mips version should to
> the trick.
I think you need to condition on _LIBC not being defined as well, or
you'll break the runtime VFP detection in the fenv.h functions (which use
fpu_control.h). I'd be surprised if glibc even built for soft-float with
that patch applied, since fesetenv.c uses _FPU_IEEE which the patch would
make undefined in the soft-float case.
--
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
` (3 preceding siblings ...)
2009-04-24 11:21 ` joseph at codesourcery dot com
@ 2009-04-24 19:13 ` aurelien at aurel32 dot net
2009-04-25 8:19 ` aurelien at aurel32 dot net
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: aurelien at aurel32 dot net @ 2009-04-24 19:13 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From aurelien at aurel32 dot net 2009-04-24 19:13 -------
I admit I hadn't made a build test, it takes long on ARM. I have just
started one, I'll come with the final patch when it is built.
--
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
` (4 preceding siblings ...)
2009-04-24 19:13 ` aurelien at aurel32 dot net
@ 2009-04-25 8:19 ` aurelien at aurel32 dot net
2009-04-25 8:20 ` aurelien at aurel32 dot net
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: aurelien at aurel32 dot net @ 2009-04-25 8:19 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From aurelien at aurel32 dot net 2009-04-25 08:19 -------
Created an attachment (id=3908)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=3908&action=view)
v2 of the patch
--
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
` (5 preceding siblings ...)
2009-04-25 8:19 ` aurelien at aurel32 dot net
@ 2009-04-25 8:20 ` aurelien at aurel32 dot net
2009-04-25 8:20 ` aurelien at aurel32 dot net
2009-04-25 15:25 ` jsm28 at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: aurelien at aurel32 dot net @ 2009-04-25 8:20 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From aurelien at aurel32 dot net 2009-04-25 08:20 -------
I have just added a new version of the patch, with the change you suggested.
This version has been compile tested.
--
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
` (6 preceding siblings ...)
2009-04-25 8:20 ` aurelien at aurel32 dot net
@ 2009-04-25 8:20 ` aurelien at aurel32 dot net
2009-04-25 15:25 ` jsm28 at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: aurelien at aurel32 dot net @ 2009-04-25 8:20 UTC (permalink / raw)
To: glibc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Attachment #3907 is|0 |1
obsolete| |
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug ports/10094] use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel
2009-04-23 21:45 [Bug ports/10094] New: use of FPU_SETCW or FPU_GETCW causes illegal instruction on armel aurelien at aurel32 dot net
` (7 preceding siblings ...)
2009-04-25 8:20 ` aurelien at aurel32 dot net
@ 2009-04-25 15:25 ` jsm28 at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-04-25 15:25 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From jsm28 at gcc dot gnu dot org 2009-04-25 15:25 -------
Thanks, I have committed this patch. Note that the path in your
ChangeLog entry was wrong.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
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.
^ permalink raw reply [flat|nested] 10+ messages in thread