* [wind@cocodriloo.com: Re: GCC still keeps empty loops? (was: [patch 4/21] fix ARCH_HAS_PREFETCH)]
@ 2002-08-10 19:39 wind
0 siblings, 0 replies; only message in thread
From: wind @ 2002-08-10 19:39 UTC (permalink / raw)
To: linux-kernel
----- Forwarded message from wind@cocodriloo.com -----
Date: Sat, 10 Aug 2002 20:43:13 +0200
From: wind@cocodriloo.com
To: Jamie Lokier <lk@tantalophile.demon.co.uk>
Subject: Re: GCC still keeps empty loops? (was: [patch 4/21] fix ARCH_HAS_PREFETCH)
Message-ID: <20020810184313.GA8486@wind.holaquehay.com>
References: <3D56B13A.D3F741D1@zip.com.au> <Pine.LNX.4.44.0208111203520.9930-100000@home.transmeta.com> <20020811210718.B3206@kushida.apsleyroad.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20020811210718.B3206@kushida.apsleyroad.org>
User-Agent: Mutt/1.3.28i
Status: RO
On Sun, Aug 11, 2002 at 09:07:18PM +0100, Jamie Lokier wrote:
> Linus Torvalds wrote:
> > I thought that special case was removed long ago, because it is untenable
> > in C++ etc (where such empty loops happen due to various abstraction
> > issues, and not optimizing them away is just silly).
> >
> > But testing shows that you're right at least for 2.95 and 2.96. Argh
>
> Unbelievably, 3.1 doesn't remove empty loops either.
> I think there's a case for a compiler flag, `-fremove-empty-loops'.
>
> Empty loop delays aren't portable acrosss compilers in general. If you
> _really_ want an empty loop that must always work with GCC, it's easy
> enough to write:
>
> for (i = 0; i < 100000; i++)
> __asm__ __volatile__ ("");
>
Of course this delay-loop code will delay a diff. amount of time
depending on processor speed. Don't we have the bogomips stuff
exactly for this sort of small wait times?
What about using internal time-counters from various processors (think
RTDSC on i586+ and it's equivalent on PowerPC, for a start...)
I can still the shakeout when most code which assumed 7mhz 68000
processors for timming got to run on 14mhz 68020 with caches
on the amiga world... your floppies would change tracks a little
bit too fast :)
--
es verano y hace calor, el resto de implicaciones son triviales.
::: Antonio Vargas :::
----- End forwarded message -----
--
es verano y hace calor, el resto de implicaciones son triviales.
::: winden/network :::
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-08-12 17:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-10 19:39 [wind@cocodriloo.com: Re: GCC still keeps empty loops? (was: [patch 4/21] fix ARCH_HAS_PREFETCH)] wind
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®