[PATCH] Prepare for the VAX architecture

Jan-Benedict Glaw jbglaw at lug-owl.de
Thu Jan 26 20:08:12 UTC 2006


On Thu, 2006-01-26 11:41:46 +0100, Peter S. Mazinger <ps.m at gmx.net> wrote:
> On Wed, 25 Jan 2006, Jan-Benedict Glaw wrote:
> > diff -Nurp src-uclibc-fresh/libc/stdio/_fpmaxtostr.c src-uclibc-hacked/libc/stdio/_fpmaxtostr.c
> > --- src-uclibc-fresh/libc/stdio/_fpmaxtostr.c	2006-01-22 16:49:49.000000000 +0100
> > +++ src-uclibc-hacked/libc/stdio/_fpmaxtostr.c	2006-01-25 22:45:09.000000000 +0100
> > @@ -280,11 +280,11 @@ ssize_t attribute_hidden _fpmaxtostr(FIL
> >  	}
> >  
> >  	if (x == 0) {				/* Handle 0 now to avoid false positive. */
> > -#if 1
> > +#ifdef __TARGET_HAS_SIGNED_ZERO_FLOATS__
> >  		if (zeroisnegative(x)) { /* Handle 'signed' zero. */
> >  			*sign_str = '-';
> >  		}
> > -#endif
> > +#endif /* __TARGET_HAS_SIGNED_ZERO_FLOATS__ */
> >  		exp = -1;
> >  		goto GENERATE_DIGITS;
> >  	}
> 
> relevant is only above. We began to use bits/uClibc_arch_features.h. If 
> there is no cpu that uses both, I wouldn't make it a config option at all, 
> add #define ...some... or #undef ...some... to those files

I cannot imagine any sane CPU that got *two* different kinds of
floating point arithmetic. Either it's IEEE, or it's somethine
homebrewn (for VAX: predating), but for sure there aren't any
implementations that use both (well, maybe at one day, some MIPS guy
might do that...)

So here's an updated patch adding VAX to the CPU menu, changes all
other targets to use signed zeros (as they do right now) and add a new
uClibc_arch_features.h for VAX that doesn't use IEEE signed zero.

Index: extra/Configs/Config.in
===================================================================
--- extra/Configs/Config.in	(revision 13616)
+++ extra/Configs/Config.in	(working copy)
@@ -71,6 +71,9 @@
 config TARGET_v850
 	bool "v850 (BROKEN)"
 
+config TARGET_vax
+	bool "vax"
+
 config TARGET_x86_64
 	bool "x86_64"
 
Index: libc/stdio/_fpmaxtostr.c
===================================================================
--- libc/stdio/_fpmaxtostr.c	(revision 13616)
+++ libc/stdio/_fpmaxtostr.c	(working copy)
@@ -280,11 +280,11 @@
 	}
 
 	if (x == 0) {				/* Handle 0 now to avoid false positive. */
-#if 1
+#ifdef __UCLIBC_HAVE_SIGNED_ZERO__
 		if (zeroisnegative(x)) { /* Handle 'signed' zero. */
 			*sign_str = '-';
 		}
-#endif
+#endif /* __UCLIBC_HAVE_SIGNED_ZERO__ */
 		exp = -1;
 		goto GENERATE_DIGITS;
 	}
--- /dev/null	2005-11-08 11:37:11.004284232 +0100
+++ libc/sysdeps/linux/vax/bits/uClibc_arch_features.h	2006-01-26 20:55:52.000000000 +0100
@@ -0,0 +1,44 @@
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+/*
+ *
+ * Track misc arch-specific features that aren't config options
+ *
+ */
+
+
+/* instruction used when calling abort() to kill yourself */
+#undef __UCLIBC_ABORT_INSTRUCTION__	"halt"
+
+/* can your target use syscall6() for mmap ? */
+#define __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __UCLIBC_BROKEN_CREATE_MODULE__
+
+/* does your target prefix all symbols with an _ ? */
+#define __UCLIBC_NO_UNDERSCORES__
+
+/* does your target have an asm .set ? */
+#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
+
+/* define if target doesn't like .global */
+#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+
+/* define if target supports .weak */
+#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
+
+/* define if target supports .weakext */
+#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
+
+/* needed probably only for ppc64 */
+#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+
+/* define if target supports IEEE signed zero floats */
+#undef __UCLIBC_HAVE_SIGNED_ZERO__
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/arm/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/arm/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/m68k/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/m68k/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/m68k/bits/uClibc_arch_features.h	(working copy)
@@ -39,4 +39,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/alpha/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/alpha/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/alpha/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/i960/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/i960/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/i960/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/microblaze/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/microblaze/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/microblaze/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/hppa/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/common/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/common/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/common/bits/uClibc_arch_features.h	(working copy)
@@ -38,4 +38,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/i386/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/i386/bits/uClibc_arch_features.h	(working copy)
@@ -35,6 +35,9 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #define internal_function __attribute__ ((regparm (3), stdcall))
 
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/nios2/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/frv/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/frv/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/frv/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/x86_64/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/cris/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/cris/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/cris/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/h8300/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/v850/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/v850/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/v850/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/e1/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/e1/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/e1/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/mips/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/mips/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/mips/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/nios/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/nios/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/sparc/bits/uClibc_arch_features.h	(working copy)
@@ -35,4 +35,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/sh/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/sh/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/sh/bits/uClibc_arch_features.h	(working copy)
@@ -39,4 +39,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h
===================================================================
--- libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h	(revision 13616)
+++ libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h	(working copy)
@@ -36,4 +36,7 @@
 /* needed probably only for ppc64 */
 #undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
 
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */


-- 
Jan-Benedict Glaw       jbglaw at lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20060126/41f0e662/attachment-0002.pgp 


More information about the uClibc mailing list