Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #32331

Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations

Newsgroups comp.arch
Date 2015-12-31 08:08 -0800
References <99749576-6d5c-4df7-b5d2-c6836024a787@googlegroups.com>
Message-ID <cd815b09-b95d-484b-9841-e4c762d2a98c@googlegroups.com> (permalink)
Subject Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations
From MitchAlsup <MitchAlsup@aol.com>

Show all headers | View raw


On Wednesday, December 30, 2015 at 11:21:45 AM UTC-6, Rick C. Hodgin wrote:

> Consider:
> 
>     extern int a[1000000];
>     extern int b[1000000];
> 
>     for (int i = 0; i < 1000000; i++)
>         a[i] += b[i];
> 
> In this example, the cache would not do well.  

The above code "strip mines" memory.

This is easy to get around by adding loops:

      for (int i = 0; i < 1000000; i++)
         for( int j = 0; j < CacheSize/4; j++, i++ )
            a[i] += b[i];


> I call this "clamping" because it arbitrary clamps its count value at
> the indicated maximum, though the concept may already exist and have
> a different name.

The real name is "saturation". Saturation can also prevent integer overflows
but it has to be attached to the integer operation that would overflow
because once overflow has happened, saturation cannot be applied "easily".
Floating point saturation can be done "after the fact".
 
Other than that, adding the overhead you speak of in the snipped text won't
fly.

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

CLU (clamping logic unit) -- An idea to aid in prefetch operations "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-30 09:21 -0800
  Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations Quadibloc <jsavard@ecn.ab.ca> - 2015-12-30 09:38 -0800
  Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations EricP <ThatWouldBeTelling@thevillage.com> - 2015-12-30 13:06 -0500
  Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations MitchAlsup <MitchAlsup@aol.com> - 2015-12-31 08:08 -0800
    Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations Quadibloc <jsavard@ecn.ab.ca> - 2015-12-31 08:18 -0800
    Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-31 08:19 -0800
      Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations Anonymous <no_email@invalid.invalid> - 2016-01-01 01:00 +0000
        Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-31 17:23 -0800
          Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations Anonymous <no_email@invalid.invalid> - 2016-01-01 01:33 +0000
            Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations Terje Mathisen <terje.mathisen@tmsw.no> - 2016-01-01 11:30 +0100
    Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-31 08:23 -0800
      Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-12-31 08:29 -0800
      Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations Quadibloc <jsavard@ecn.ab.ca> - 2015-12-31 11:33 -0800
    Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-01-02 11:21 -0800
      Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations MitchAlsup <MitchAlsup@aol.com> - 2016-01-02 12:04 -0800
        Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-01-02 12:24 -0800
        Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-03 15:34 +0000
          Re: CLU (clamping logic unit) -- An idea to aid in prefetch operations MitchAlsup <MitchAlsup@aol.com> - 2016-01-03 14:33 -0800

csiph-web