Pthreads, part 2

Alex Waugh Alex.Waugh at arm.com
Thu Oct 24 06:15:52 PDT 2002


Peter Naulls wrote:

 > I did mean the comment as a general one, not just specific to your FP
 > code of course. But to address this point, insisting on a recent FPE
 > might be an acceptable thing to do. The alternative is checking for
 > 32-bit mode at runtime, which is a 2 instruction sequence.

How about checking the FPE version at runtime?

Index: unixlib/source/sys/_jmp.s
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/sys/_jmp.s,v
retrieving revision 1.2.2.4
diff -u -r1.2.2.4 _jmp.s
--- unixlib/source/sys/_jmp.s	19 Jul 2002 13:12:30 -0000	1.2.2.4
+++ unixlib/source/sys/_jmp.s	24 Oct 2002 13:09:25 -0000
@@ -32,17 +32,16 @@

  	LDR	a4, =|__fpflag|
  	LDR	a4, [a4]
+	CMP	a4, #400
+	SFMGE	f4, 4, [a1], #48
+	BGE	|__setjmp_l1|
  	CMP	a4, #0
  	ADDEQ	a1, a1, #48
-	[ {CONFIG} = 26
  	BEQ	|__setjmp_l1|
  	STFE	f4, [a1], #12
  	STFE	f5, [a1], #12
  	STFE	f6, [a1], #12
  	STFE	f7, [a1], #12
-	|
-	SFMNE	f4, 4, [a1], #48
-	]
  |__setjmp_l1|
  	; warning!!!!
  	; even though a1 does not need to be saved, this position in
@@ -88,17 +87,16 @@
  |__longjmp_l3|
  	LDR	a4, =|__fpflag|
  	LDR	a4, [a4]
+	CMP	a4, #400
+	LFMGE	f4, 4, [v1], #48
+	BGE	|__setjmp_l1|
  	CMP	a4, #0
-	ADDEQ	v1, v1, #48
-	[ {CONFIG} = 26
-	BEQ	|__longjmp_l1|
+	ADDEQ	a1, a1, #48
+	BEQ	|__setjmp_l1|
  	LDFE	f4, [v1], #12
  	LDFE	f5, [v1], #12
  	LDFE	f6, [v1], #12
  	LDFE	f7, [v1], #12
-	|
-	LFMNE	f4, 4, [v1], #48
-	]
  |__longjmp_l1|
  	MOVS	a1, a2
  	MOVEQ	a1, #1			; longjmp can't return 0
Index: unixlib/source/sys/_syslib.s
===================================================================
RCS file: /usr/local/cvsroot/gccsdk/unixlib/source/sys/_syslib.s,v
retrieving revision 1.3.2.11
diff -u -r1.3.2.11 _syslib.s
--- unixlib/source/sys/_syslib.s	21 Oct 2002 20:59:50 -0000	1.3.2.11
+++ unixlib/source/sys/_syslib.s	24 Oct 2002 13:09:25 -0000
@@ -368,7 +368,6 @@
  	; If it does, then there is a floating point ability.
  	SWI	XFPEmulator_Version
  	MOVVS	a1, #0
-	MOVVC	a1, #1
  	STR	a1, [ip, #52]	; __fpflag

  	; Now we'll initialise the C library, then call the user program.




More information about the gcc mailing list