lkml.org 
[lkml]   [2002]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch 4/21] fix ARCH_HAS_PREFETCH
    On Wed, Aug 14, 2002 at 03:53:15PM -0700, David Lang wrote:
    > why are you useing loops for delays in the first place? it's a solution
    > that will fail as clock speeds keep improving (if for no other reason then
    > your loop counter will end up needing to be a larger int to achieve the
    > desired delay!!)
    >
    > rather then debating how to convince gcc how to not optimize them away and
    > messing up the timing we should be talking about how to eliminate such
    > loops in the first place.

    I'm NEVER using loops for delays, I find this awful and always a waste of
    time. But sometimes, you want to benchmark some algorithms, and the compiler
    makes this difficult by eliminating things it thinks are useless. I once had
    this problem when comparing several linked lists algorithms, for example.

    Moreover, some people complain about the fact that gcc doesn't optimize
    everything because of people using loops for delays. If we provide convenient
    ways to help the user tell gcc when not to optimize, gcc could optimize
    everything possible by default.

    Cheers,
    Willy

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:28    [W:3.109 / U:0.404 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site