kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH v2 kvm-unit-tests 2/2] arm: add eabi version of 64-bit division functions
Date: Wed, 12 May 2021 15:04:06 +0100	[thread overview]
Message-ID: <1748f789-d804-aa8f-2e75-cf1a495f7609@arm.com> (raw)
In-Reply-To: <2d068920-26c2-610c-c27d-b693e406b180@redhat.com>

Hi Paolo,

On 5/12/21 2:51 PM, Paolo Bonzini wrote:
> On 12/05/21 15:44, Alexandru Elisei wrote:
>>> +    bl    __udivmoddi4
>>> +    ldr    r2, [sp, #8]             // remainder returned in r2-r3
>>> +    ldr    r3, [sp, #12]
>>> +    add    sp, sp, #16
>>> +    pop    {r11, pc}
>>
>> I'm not sure what is going on here. Is the function returning 2 64bit arguments as
>> an 128bit vector? Or is the function being called from assembly and this is a
>> convention between it and the caller?
>
> It's an eABI convention that spans the runtime and the compiler.
>
> https://developer.arm.com/documentation/ihi0043/e/?lang=en#standardized-compiler-helper-functions
> says it returns a "pair of (unsigned) long longs is returned in {{r0, r1}, {r2,
> r3}}, the quotient in {r0, r1}, and the remainder in {r2, r3}."

Thanks for the link, the functions are indeed returning the quotient in {r0, r1}
and remainder in {r2, r3} according to the convention:

Reviewed-by: Alexandru Elisei <alexandru.elisei@arm.com>

Thanks,

Alex


  reply	other threads:[~2021-05-12 14:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 10:54 [PATCH v2 kvm-unit-tests 0/2] fix long division routines for ARM eabi Paolo Bonzini
2021-05-12 10:54 ` [PATCH v2 kvm-unit-tests 1/2] libcflat: clean up and complete long division routines Paolo Bonzini
2021-05-12 13:44   ` Alexandru Elisei
2021-05-12 10:54 ` [PATCH v2 kvm-unit-tests 2/2] arm: add eabi version of 64-bit division functions Paolo Bonzini
2021-05-12 13:44   ` Alexandru Elisei
2021-05-12 13:51     ` Paolo Bonzini
2021-05-12 14:04       ` Alexandru Elisei [this message]
2021-05-12 14:04 ` [PATCH v2 kvm-unit-tests 0/2] fix long division routines for ARM eabi Alexandru Elisei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1748f789-d804-aa8f-2e75-cf1a495f7609@arm.com \
    --to=alexandru.elisei@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --subject='Re: [PATCH v2 kvm-unit-tests 2/2] arm: add eabi version of 64-bit division functions' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).