comp.lang.ada
 help / color / mirror / Atom feed
From: David Trudgett <dktrudgett@gmail.com>
Subject: Re: Toy computational "benchmark" in Ada (new blog post)
Date: Thu, 6 Jun 2019 23:21:08 -0700 (PDT)
Date: 2019-06-06T23:21:08-07:00	[thread overview]
Message-ID: <e5547514-d098-4863-b0e4-a726910bcd25@googlegroups.com> (raw)
In-Reply-To: <87y32evsxm.fsf@nightsong.com>

Il giorno venerdì 7 giugno 2019 15:57:36 UTC+10, Paul Rubin ha scritto:
> 
> 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.
> 
>     .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 register.

Cheers,
David

  reply	other threads:[~2019-06-07  6:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 11:05 Toy computational "benchmark" in Ada (new blog post) David Trudgett
2019-06-06 17:48 ` Olivier Henley
2019-06-06 23:14   ` David Trudgett
2019-06-06 23:27     ` Paul Rubin
2019-06-07  5:24       ` David Trudgett
2019-06-07  5:36         ` Paul Rubin
2019-06-06 20:31 ` Jeffrey R. Carter
2019-06-06 23:02   ` David Trudgett
2019-06-07  0:13     ` Paul Rubin
2019-06-07  4:50       ` Paul Rubin
2019-06-07  5:41         ` David Trudgett
2019-06-07  6:00           ` Paul Rubin
2019-06-07  6:25             ` David Trudgett
2019-06-07  6:38               ` Paul Rubin
2019-06-07  5:28       ` David Trudgett
2019-06-07  5:57         ` Paul Rubin
2019-06-07  6:21           ` David Trudgett [this message]
2019-06-07  6:22             ` Paul Rubin
2019-06-07  6:29               ` David Trudgett
2019-06-07  6:42                 ` Paul Rubin
2019-06-07 17:55     ` Jeffrey R. Carter
2019-06-08 11:00       ` David Trudgett
2019-06-07  1:42 ` johnscpg
2019-06-07  5:34   ` David Trudgett
2019-06-08 10:17     ` David Trudgett
2019-06-08  1:14 ` johnscpg
2019-06-08 10:56   ` David Trudgett
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox