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


Groups > comp.lang.c > #111984

Re: C speed

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: C speed
Date 2017-06-11 23:47 +0100
Organization A noiseless patient Spider
Message-ID <8760g2dtw4.fsf@bsb.me.uk> (permalink)
References (3 earlier) <ohh8tu$sbv$1@dont-email.me> <b1f00fa2-7ebd-484e-91bb-9c86457eefbf@googlegroups.com> <ohk6hu$j6g$1@dont-email.me> <87bmpue0jw.fsf@bsb.me.uk> <73f34d0e-c8dc-4f6f-9780-d09b2903f5a9@googlegroups.com>

Show all headers | View raw


supercat@casperkitty.com writes:

> On Sunday, June 11, 2017 at 3:23:22 PM UTC-5, Ben Bacarisse wrote:
>> Is this always the case?  In languages were the compiler knows that the
>> pointer is to the start of an array (and this may be a pointer generated
>> internally -- the language may not have pointers as such) the compiler
>> may be able to assume things about alignment that could be helpful for
>> optimisation (particularly vectorisation).
>
> If a compiler knows that arr1 is the start of one array and arr2 is the start
> of a (not necessarily different) array, then it will be entitled to assume
> that for any *unequal* integer values i and j, nothing that is accessed as
> arr1[i] will also be accessed as arr2[j].  That's a *very* useful assumption
> for vectorization.

'restrict' will do that in C, though that makes a rather more general
guarantee.

-- 
Ben.

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


Thread

Re: C speed "James R. Kuyper" <jameskuyper@verizon.net> - 2017-06-09 18:58 -0400
  Re: C speed supercat@casperkitty.com - 2017-06-09 16:21 -0700
    Re: C speed David Brown <david.brown@hesbynett.no> - 2017-06-10 19:09 +0200
      Re: C speed supercat@casperkitty.com - 2017-06-10 12:37 -0700
        Re: C speed David Brown <david.brown@hesbynett.no> - 2017-06-11 21:47 +0200
          Re: C speed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-11 21:23 +0100
            Re: C speed supercat@casperkitty.com - 2017-06-11 13:33 -0700
              Re: C speed Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-06-11 23:47 +0100
            Re: C speed David Brown <david.brown@hesbynett.no> - 2017-06-12 09:12 +0200
          Re: C speed supercat@casperkitty.com - 2017-06-11 13:30 -0700
            Re: C speed David Brown <david.brown@hesbynett.no> - 2017-06-12 09:15 +0200
              Re: C speed supercat@casperkitty.com - 2017-06-12 07:14 -0700

csiph-web