On Wed, Dec 18, 2002 at 03:33:42PM +1100, Bruce Evans wrote:
> On Tue, 17 Dec 2002, Ruslan Ermilov wrote:
> 
> > On Mon, Dec 16, 2002 at 09:05:40AM +1030, Greg 'groggy' Lehey wrote:
> > > I suppose it would be a good idea to include an alternatvie i386
> > > kernel on the CD-ROM.  There may be a space issue, of course.  How
> > > many people participating in this thread have an i386 with at least 12
> > > MB of memory and intended to try 5.0 on it?  How many of those don't
> > > have a machine to bootstrap off?
> > >
> > Having only alternative i386 kernel is not enough while userland
> > stuff is still compiled for i486.
> 
> Er, userland stuff is still compiled for original i386's, modulo bugs.
> E.g., in the i386 endian.h:
> 
> % #if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || 
>defined(I686_CPU)) && !defined(I386_CPU)
>       ^^^^^^^^^^^^^^^
> %
> % #define __byte_swap_int(x) \
> % __extension__ ({ register __uint32_t __X = (x); \
> %    __asm ("bswap %0" : "+r" (__X)); \
> %    __X; })
> % #else
> %
> % #define __byte_swap_int(x) \
> % __extension__ ({ register __uint32_t __X = (x); \
> %    __asm ("xchgb %h0, %b0\n\trorl $16, %0\n\txchgb %h0, %b0" \
> %     : "+q" (__X)); \
> %    __X; })
> % #endif
> 
> The _KERNEL part of the ifdef limits the use of the i486 "bswap"
> instruction to the kernel, so userland is properly pessimized to support
> all x86's.  The other parts of the ifdef properly pessimize modules to
> support all x86's (options don't apply to modules so none of the XXX_CPU's
> is defined).
> 
> So kernels get the full epsilon of optimizations from turning off i386
> support, while userland doesn't get any (not counting ones from optimizing
> for non-i386 without breaking i386).
> 
Right.  I forgot for the moment that -mcpu isn't the same as -march,
and the latter is only set if CPUTYPE is also set.


Cheers,
-- 
Ruslan Ermilov          Sysadmin and DBA,
[EMAIL PROTECTED]           Sunbay Software AG,
[EMAIL PROTECTED]          FreeBSD committer,
+380.652.512.251        Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

Attachment: msg48985/pgp00000.pgp
Description: PGP signature

Reply via email to