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 2002:a24:f587:: with SMTP id k129mr3249807ith.77.1559888469430; Thu, 06 Jun 2019 23:21:09 -0700 (PDT) X-Received: by 2002:a9d:2f0:: with SMTP id 103mr8726485otl.182.1559888469175; Thu, 06 Jun 2019 23:21:09 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g15no164064itd.0!news-out.google.com!l126ni234itl.0!nntp.google.com!s188no169961itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 6 Jun 2019 23:21:08 -0700 (PDT) In-Reply-To: <87y32evsxm.fsf@nightsong.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2001:8004:1420:de2:3c2c:6580:a925:cfe; posting-account=rfeywQoAAAC0TKn5ZjdVW0ytcQM1oMSv NNTP-Posting-Host: 2001:8004:1420:de2:3c2c:6580:a925:cfe References: <55b14350-e255-406c-ab11-b824da77995b@googlegroups.com> <6776b034-1318-49b3-8ff5-5a2f746fac9c@googlegroups.com> <87blzaxnei.fsf@nightsong.com> <87y32evsxm.fsf@nightsong.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Toy computational "benchmark" in Ada (new blog post) From: David Trudgett Injection-Date: Fri, 07 Jun 2019 06:21:09 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56526 Date: 2019-06-06T23:21:08-07:00 List-Id: Il giorno venerd=C3=AC 7 giugno 2019 15:57:36 UTC+10, Paul Rubin ha scritto= : >=20 > I think this is it below. I don't understand why it's accumulating the > values into a stack slot instead of a register, but I don't know the x86 > all that well. >=20 > .L17: > addq $1, %rax > .LEHB4: > movq 416(%r12), %rdx > movsd -8(%rdx,%rax,8), %xmm0 > .LEHE4: > mulsd %xmm0, %xmm0 > cmpq %rax, %rbp > addsd 8(%rsp), %xmm0 > movsd %xmm0, 8(%rsp) > jne .L17 > jmp .L19 Instead, you should have something like: .L5: movsd (%rax), %xmm0 addq $8, %rax cmpq %rbx, %rax mulsd %xmm0, %xmm0 addsd %xmm0, %xmm1 jne .L5 It would appear you did not turn on optimisations since, as you noticed, it= is directly using the stack frame variable rather than keeping it in a reg= ister. Cheers, David