Re: [PATCH 00/31] VAX: Bring the port up to date (yes, MODE_CC conversion is included)
On Thu, Nov 26, 2020 at 06:01:31PM +, Maciej W. Rozycki wrote: > The VAX/NetBSD port however does use hardware FP in their libm as far as > I can tell, so I guess it would be reasonable for libgfortran to do so as > well. I haven't checked how correct their implementation actually is, but > barring evidence otherwise I would assume they did the right thing. It does, but it is not totally correct in all places (due to gcc issues some parts have not received good testing, and others clearly are broken, eg. when tables are used that have not been adjusted for the different limits in VAX float/double formats). Should be a lot easier to fix with newer gcc soonish (I hope). Martin
Re: [PATCH 00/31] VAX: Bring the port up to date (yes, MODE_CC conversion is included)
On Tue, Dec 08, 2020 at 02:38:59PM +, Maciej W. Rozycki wrote: > Here's the full list of math functions that the `configure' script in > libgfortran reports as missing: > > checking for acosl... no > checking for acoshf... no [..] > Except for the Bessel functions these are a part of ISO C; `long double' > versions, some of which appear missing unlike their `float' or `double' > counterparts, should probably just alias to the corresponding `double' > versions as I doubt we want to get into the H-floating format, largely > missing from actual VAX hardware and meant to be emulated by the OS. Thanks for the list - I'll add the aliases soonish (they are likely already there for the IEEE versions but missing from the vax code) and check what remains missing then. Martin
Non portable sed invocation in libgcc configury
libgcc/config/t-hardfp uses sed to convert libgcc function names (like __addsf3) into a tuple of -D defines. The regular expression used for that contains |, which is not a basic regular expression and not understood by posix sed. Gnu sed seems to enable it by default, I suppose - or this should have been noticed earlier. Many other sed implementations need -E or -r (for gnu sed compatibility), which the attached patch adds. It might be better to split the alternatives into several expressions and duplicate the right hand sides, or mix with some sh code, but this is already pretty messy. Martin --- t-hardfp.orig 2014-02-07 08:46:34.0 +0100 +++ t-hardfp2014-03-23 11:36:12.0 +0100 @@ -64,7 +64,7 @@ # TYPE: the last floating-point mode (e.g. sf) hardfp_defines_for = \ $(shell echo $1 | \ -sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/') +sed -r 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/') hardfp-o = $(patsubst %,%$(objext),$(hardfp_func_list)) $(hardfp-o): %$(objext): $(srcdir)/config/hardfp.c
WCONTINUED is not portable
The flag WCONTINUED for waitpid() is not portable. The attached patch just defines it to 0 if missing. Martin --- gcc/lto/lto.c.orig 2014-02-24 23:58:44.0 +0100 +++ gcc/lto/lto.c 2014-03-21 16:43:05.0 +0100 @@ -2470,6 +2470,11 @@ do_stream_out (char *temp_filename, lto_ /* Wait for forked process and signal errors. */ #ifdef HAVE_WORKING_FORK + +#ifndef WCONTINUED +#defineWCONTINUED 0 +#endif + static void wait_for_child () {
Re: Non portable sed invocation in libgcc configury
On Sun, Mar 23, 2014 at 11:59:39AM +0100, Andreas Schwab wrote: > -r changes the regexp syntax to extended, so this will no longer match. Right, it needs a few more \ removed - however, it doesn't work anyway, as our sed does not accept empty alternatives: (si|2|3|) fails with: RE error: empty (sub)expression Since the script is outside posix, what is the prefered solution here? Martin
Re: Non portable sed invocation in libgcc configury
This version seems to work for me - but do you really want to go on this slippery ice? Martin --- libgcc/config/t-hardfp.orig 2014-02-07 08:46:34.0 +0100 +++ libgcc/config/t-hardfp 2014-03-23 13:25:44.0 +0100 @@ -51,11 +51,11 @@ $(subst M,$(pair),truncM2)) # Regexp for matching a floating-point mode. -hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /\\|/g') +hardfp_mode_regexp := $(shell echo $(hardfp_float_modes) | sed 's/ /|/g') # Regexp for matching the end of a function name, after the last # floating-point mode. -hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /\\|/g') +hardfp_suffix_regexp := $(shell echo $(hardfp_int_modes) 2 3 | sed 's/ /|/g') # Add -D options to define: # FUNC: the function name (e.g. __addsf3) @@ -64,7 +64,7 @@ # TYPE: the last floating-point mode (e.g. sf) hardfp_defines_for = \ $(shell echo $1 | \ -sed 's/\(.*\)\($(hardfp_mode_regexp)\)\($(hardfp_suffix_regexp)\|\)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/') +sed -r 's/(.*)($(hardfp_mode_regexp))($(hardfp_suffix_regexp)|.*)$$/-DFUNC=__& -DOP_\1\3 -DTYPE=\2/') hardfp-o = $(patsubst %,%$(objext),$(hardfp_func_list)) $(hardfp-o): %$(objext): $(srcdir)/config/hardfp.c
Lost __mips_o32 predefine on NetBSD
In the mips--netbsdelf target gcc 4.9 lost the pre-definition of __mips_o32, which is heavily used in NetBSD sources. The obvious trivial patch adds it back. Martin --8-<-- Define __mips_o32 for -mabi=32 --- gcc/config/mips/netbsd.h.orig 2014-01-02 23:23:26.0 +0100 +++ gcc/config/mips/netbsd.h2014-03-28 14:19:18.0 +0100 @@ -32,7 +32,9 @@ along with GCC; see the file COPYING3. if (TARGET_ABICALLS) \ builtin_define ("__ABICALLS__");\ \ - if (mips_abi == ABI_EABI)\ + if (mips_abi == ABI_32) \ + builtin_define ("__mips_o32"); \ + else if (mips_abi == ABI_EABI) \ builtin_define ("__mips_eabi"); \ else if (mips_abi == ABI_N32)\ builtin_define ("__mips_n32"); \
Re: Lost __mips_o32 predefine on NetBSD
On Mon, Mar 31, 2014 at 08:35:30PM +0100, Richard Sandiford wrote: > Are you sure it was ever in FSF GCC? I went through every revision > of netbsd.h in git and couldn't see it. No, I'm not - guess I never tried a pure gcc on mips. > I can go ahead and apply the patch anyway if it's the right thing to do. > Just wanted to make sure I wasn't missing something. Matt Thomas should be the authority on this. This was one of the very few changes I needed so far for NetBSD/playstation2 (the others all in bugzilla already). Matt? Martin