From 8507272844932342665
X-Google-Thread: f78e5,174aa7b34b06a51
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news4.google.com!news.glorb.com!news.wiretrip.org!border2.nntp.ams.giganews.com!nntp.giganews.com!newshub2.home.nl!newshub1.home.nl!home.nl!skynet.be!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: SeeWebsiteForEmail@moderncppdesign.com ("Andrei Alexandrescu (See Website For Email)")
Newsgroups: comp.std.c++
Subject: Re: Is this really unspecified behavior?
Date: Sat, 10 Dec 2005 04:58:00 GMT
Organization: Computer Science & Engineering, U of Washington, Seattle
Lines: 42
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <Ir8zH5.s6D@beaver.cs.washington.edu>
References: <1132759176.368850.264850@g43g2000cwa.googlegroups.com> <H1phf.161529$zb5.99785@bgtnsc04-news.ops.worldnet.att.net> <1132933832.802917.153350@g14g2000cwa.googlegroups.com> <1133551647.532929.325730@z14g2000cwz.googlegroups.com> <1133583412.951239.208510@g49g2000cwa.googlegroups.com> <E1EjGBD-0005T8-00@chx400.switch.ch> <1133910546.716987.80030@g14g2000cwa.googlegroups.com> <E1EjzL6-0006ic-00@chx400.switch.ch> <0l5ep1ppfhdj5p1pcu7e4na4ub0vjajlq3@4ax.com> <67pgp1p61j2vvlr8iphl28clsplb9lf6jk@4ax.c
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1134190686 8290 158.152.254.254 (10 Dec 2005 04:58:06 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 10 Dec 2005 04:58:06 +0000 (UTC)
X-Nntp-Posting-Host: parakeet.ee.washington.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.6 Mnenhy/0.7.2.0
X-Accept-Language: en-us, en
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id jBA4w0mY007820;
	Sat, 10 Dec 2005 15:58:00 +1100 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:2727

Herb Sutter wrote:
> After sending this, I thought I should clarify something that on rereading
> wasn't clear the way I first wrote it:
> 
> hsutter@gotw.ca (Herb Sutter) wrote:
> 
>> a) how much optimization loss there actually is on popular
>>implementations and platforms (note this is likely to vary greatly by
>>application)
> 
> [...]
> 
>>The
>>most concrete information I know of, but which still needs measuring, is
>>that a) is likely to cost several _times_ the throughput on some standard
>>Spec microbenchmarks where we can get an order-of-magnitude perf gain by
>>doing things like choosing to stride the other way across arrays (i.e.,
>>the program's loop strides rows then columns, and we know we'll get better
>>cache behavior by reordering all or just chunks of the loop by striding
>>columns then rows). But we don't know the cost on typical app code (e.g.,
>>some smart people I know expect <10%, maybe <5%, but we need to measure).
> 
> 
> Specifically, the stride issue was specifically about the performance gain
> from of a memory model latitude for reordering reads/writes, not latitude
> for reordering expression evaluation.

Ah, now that makes sense. (I was a bit confused.)

So the jury is still out on finding cases (that are not source-level 
optimizable in an obvious way) in which a specified order of argument 
evaluation forces the compiler to generate pessimized code.


Andrei

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



