From owner-freebsd-smp Tue Nov 10 01:26:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA00991 for freebsd-smp-outgoing; Tue, 10 Nov 1998 01:26:46 -0800 (PST) (envelope-from owner-freebsd-smp@FreeBSD.ORG) Received: from dingo.cdrom.com (castles162.castles.com [208.214.165.162]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA00986; Tue, 10 Nov 1998 01:26:44 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id BAA01418; Tue, 10 Nov 1998 01:24:34 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811100924.BAA01418@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Bruce Evans 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 In-reply-to: Your message of "Tue, 10 Nov 1998 20:08:50 +1100." <199811100908.UAA23868@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 10 Nov 1998 01:24:33 -0800 From: Mike Smith Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > >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-smp" in the body of the message