Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Nov 1998 01:24:33 -0800
From:      Mike Smith <mike@smith.net.au>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        peter@netplex.com.au, current@FreeBSD.ORG, jc@irbs.com, mike@smith.net.au, narvi@haldjas.folklore.ee, smp@FreeBSD.ORG
Subject:   Re: Dog Sloooow SMP 
Message-ID:  <199811100924.BAA01418@dingo.cdrom.com>
In-Reply-To: Your message of "Tue, 10 Nov 1998 20:08:50 %2B1100." <199811100908.UAA23868@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >However..  One thing that bugs me is that we presently can optimize out 
> >code and tests for a runtime boost when compiled for a specific cpu.  eg: 
> >if we support 386 cpus, we test for whether we have an invlpg instruction 
> >or not - but if we are not compiling with a 386 option then this code and 
> >the test for >= 486 goes away.
> 
> Attempt to keep compile-time options and tests when they make a difference.

It occurred to me that we could probably build a header somewhere full 
of defines like this:


#if defined(CPU_686) && !defined(CPU_586) && !defined....
# define CPU_686_ONLY
#endif
...
#ifdef CPU_686_ONLY
# define CPU_CAP_FOOBAR	(1)
#else
# define CPU_CAP_FOOBAR ((cpu == CPU_686) || (cpu == CPU_PII))
#endif
...

of course, you can customise the "slow mode" definition to suit, but
this is pretty clean.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811100924.BAA01418>