Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: "Rick C. Hodgin" Newsgroups: comp.compilers Subject: Re: Optimization techniques Date: Thu, 18 Apr 2019 11:22:24 -0400 Organization: Liberty Software Foundation Lines: 39 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-04-007@comp.compilers> References: <19-04-004@comp.compilers> <19-04-006@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="9407"; mail-complaints-to="abuse@iecc.com" Keywords: optimize Posted-Date: 18 Apr 2019 15:27:23 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2191 On 4/18/2019 4:07 AM, George Neuner wrote: > On Wed, 17 Apr 2019 09:42:21 -0400 (EDT), "Rick C. Hodgin" > wrote: > >> Are there resources someone can point me to for learning more about >> time-honored, long-established, safely applied, optimization >> techniques for a C/C++ like language? > > There really aren't many "safe" optimizations you can do before you > run into pointer aliasing problems in C. Almost any modern compiler > text will cover the bulk of them. I'm not sure what that is by its name, but I'll start there. Thank you, George. > [Great reading list, thanks. Floating add and multiply commute but > they don't associate. a+b should be the sams as b+a, but (a+b)+c not > the same as a+(b+c). -John] I think the goal for floating point engines in moving forward is no longer to only be exceeding fast under IEEE-754 or its relatives, but there should be a new model introduced into silicon which carries out computations that are truly accurate, which either an arbitrary pre- cision engine which will admittedly be slower and be accurate out only to some finite degree and inaccurate beyond that, or some kind of sym- bolic tree-based algorithm which doesn't actually conduct the final computation until the tree has been updated to its final form, and is then, and only then, computed, allowing for cancellations and reduc- tions to be made, which I believe is what happens in apps like Maple and Mathematica. -- Rick C. Hodgin [I think you're conflating different things in the FP stuff. The sorts of analysis that Maple and Mathematica do require looking at potentially large amounts of data and deciding on the fly how to do the calculations. It might be reasonable to do some of that in hardware, but I think most of it is too complicated. -John]