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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.157.9.105 with SMTP id 96mr50932583otp.9.1470091214169; Mon, 01 Aug 2016 15:40:14 -0700 (PDT) X-Received: by 10.157.32.22 with SMTP id n22mr3435097ota.2.1470091214136; Mon, 01 Aug 2016 15:40:14 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!f6no6594423ith.0!news-out.google.com!d68ni14038ith.0!nntp.google.com!f6no6594416ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 1 Aug 2016 15:40:13 -0700 (PDT) In-Reply-To: <04e12bd0-2c9d-f90d-2497-bf58593addfd@spam.spam> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8380:7220:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8380:7220:5985:2c17:9409:aa9c References: <04e12bd0-2c9d-f90d-2497-bf58593addfd@spam.spam> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <845e12db-9e2c-4d0f-a3b0-19ac50f14d24@googlegroups.com> Subject: Re: Profiling Ada binaries From: rieachus@comcast.net Injection-Date: Mon, 01 Aug 2016 22:40:14 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2957 X-Received-Body-CRC: 1538462201 Xref: news.eternal-september.org comp.lang.ada:31244 Date: 2016-08-01T15:40:13-07:00 List-Id: On Tuesday, July 26, 2016 at 4:37:31 AM UTC-4, Markus Sch=C3=B6pflin wrote: =20 > GNAT by default uses static elaboration. There should be no elaboration c= hecks=20 > when calling the generic versions. Or am I mistaken here? >From the GNAT documentation: Strict conformance to the Ada Reference Manual= can be achieved by adding two compiler options for dynamic checks for acce= ss-before-elaboration on subprogram calls and generic instantiations (-gnat= E) and stack overflow checking (-fstack-check). > > I believe GNAT > > has non-generic versions for Short_Float, Float, and Long_Float which u= se > > the hardware built-ins. But I doubt you would get that automatically w= ith > > -O1. > Even using the non-generic versions I have not been able to get the hardw= are=20 > built-ins. The best I can achieve for a call to e.g. cos(X) is:=20 > call ada__numerics__long_elementary_functions__cos That's silly. A project for a rainy afternoon. Hmm. May rain today... Again GNAT docs to the rescue: 15.1 Machine code insertions: The equivalent can be written for GNAT as: Asm ("fsinx %1 %0", My_Float'Asm_Output ("=3Df", result), My_Float'Asm_Input ("f", angle)); I assume I wrap that in a function call: function Sin(Angle: in Float) return Float is Asm ("fsinx %1 %0", My_Float'Asm_Output ("=3Df", result), My_Float'Asm_Input ("f", angle)); end Sin; Now all I have to do is put together a set of test cases... =20