kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexandru Elisei <alexandru.elisei@arm.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:51:40 +0200	[thread overview]
Message-ID: <2d068920-26c2-610c-c27d-b693e406b180@redhat.com> (raw)
In-Reply-To: <e1aa58da-c4c9-6bb0-3aef-f17c12349577@arm.com>

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}."

Paolo


  reply	other threads:[~2021-05-12 13:51 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 [this message]
2021-05-12 14:04       ` Alexandru Elisei
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=2d068920-26c2-610c-c27d-b693e406b180@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=kvm@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).