From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,103803355c3db607 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.227.67 with SMTP id ry3mr6999258pbc.8.1342356519453; Sun, 15 Jul 2012 05:48:39 -0700 (PDT) Path: l9ni11846pbj.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Keean Schupke Newsgroups: comp.lang.ada Subject: Re: GNAT (GCC) Profile Guided Compilation Date: Sun, 15 Jul 2012 05:48:39 -0700 (PDT) Organization: http://groups.google.com Message-ID: <46d9d433-2bff-410d-ab0e-88fd5a5c0e72@googlegroups.com> References: <38b9c365-a2b2-4b8b-8d2a-1ea39d08ce86@googlegroups.com> <982d531a-3972-4971-b802-c7e7778b8649@googlegroups.com> <520bdc39-6004-4142-a227-facf14ebb0e8@googlegroups.com> <4ff08cb2$0$6575$9b4e6d93@newsspool3.arcor-online.net> <4ff1d731$0$6582$9b4e6d93@newsspool3.arcor-online.net> <4ff41d38$0$6577$9b4e6d93@newsspool3.arcor-online.net> <26b778c4-5abc-4fbf-94b0-888c2ce71831@googlegroups.com> <4ff43956$0$6576$9b4e6d93@newsspool3.arcor-online.net> <2dba1140-4f28-4fb8-ace4-2c10f3a02313@googlegroups.com> NNTP-Posting-Host: 82.44.19.199 Mime-Version: 1.0 X-Trace: posting.google.com 1342356519 3201 127.0.0.1 (15 Jul 2012 12:48:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 15 Jul 2012 12:48:39 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.44.19.199; posting-account=T5Z2vAoAAAB8ExE3yV3f56dVATtEMNcM User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-07-15T05:48:39-07:00 List-Id: On Sunday, 15 July 2012 12:02:31 UTC+1, Niklas Holsti wrote: > On 12-07-15 10:15 , Niklas Holsti wrote: > > > It seems to me that the general belief, regarding the expected relative > > speeds of the short-circuit code versus the long-circuit code for > > Boolean expressions with simple operands, is that the branch penalties > > on modern processors are so large that the short-circuit form is not > > obviously faster. This may explain why the Ada compiler is not using the > > short-circuit code automatically. > > > > Clearly, if the expression is "(simple operand likely to be True) and > > Oops, my brain fart: change that to "likely to be False". > > > (longer and longer expression)", at some point the short-circuit code > > (or changing to "and then") will become faster than the long-circuit > > code, whatever the branch penalty. This point will come sooner if > > profile-guidance is used to reduce the branch penalty. > > -- > Niklas Holsti > Tidorum Ltd > niklas holsti tidorum fi > . @ . Surely True for "or else" (as soon as one argument is true the other need not be evaluated)and false for "and then" (as soon as one argument is false the other need not be evaluated). Cheers, Keean.