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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,2c57913d6b8220c1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sun, 27 Sep 2009 23:27:52 +0200 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Tasking for Mandelbrot program References: <4abebaf4$0$31342$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4abfd8df$0$31337$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 27 Sep 2009 23:27:59 CEST NNTP-Posting-Host: 7b4af65c.newsspool4.arcor-online.net X-Trace: DXC=P4:W?\mon9c<6cDJZfMd_c4IUKH_hKQDKiQ7hGo X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8503 Date: 2009-09-27T23:27:59+02:00 List-Id: Martin wrote: > On Sep 27, 2:08 am, Georg Bauhaus bug.bauh...@maps.futureapps.de> wrote: > [snip] >> Z2 := (Z.re ** 2, Z.im ** 2); > [snip] > > Don't know about the rest of the program but on some platforms I've > found it to be much faster to replace "** 2" with a straight > multiplication, e.g. "Z.re * Z.re, Z.im * Z.im". I have just checked. The code that gcc is generating looks the same for ** 2 and for * Z.xx. Irrespective of either sse instructions or i387 instructions. Some more observations: - SSE2 code performs 8% faster when suitable compilation options are present, -mfpmath=sse -msse2 (this is currently the case). Then digits 15 should probably stay in the declaration of Real. - writing the image bytes with Stream_IO removes 6% running time when compared to GNAT.IO.Put. This adds standard Ada but also adds about 10 lines of code for the Put procedure and a Stdout variable. Is it worth it?