[PATCH] Add udivmoddi4.

Tom Rini trini at konsulko.com
Wed Jun 9 20:31:03 CEST 2021


On Mon, Jun 07, 2021 at 11:20:47AM +0200, Christian Melki wrote:

> A newer toolchain will emit udivmoddi4 for certain divide + modulo
> operations instead of a separate divide and modulo operation.
> AFAIU, this would be sufficient.
> 
> Signed-off-by: Christian Melki <christian.melki at t2data.com>
> ---
>  arch/x86/lib/div64.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/x86/lib/div64.c b/arch/x86/lib/div64.c
> index 2bea205f60..a5b536fbc5 100644
> --- a/arch/x86/lib/div64.c
> +++ b/arch/x86/lib/div64.c
> @@ -110,3 +110,8 @@ u64 __umoddi3(u64 num, u64 den)
>  	_64bit_divide(num, den, &v);
>  	return v;
>  }
> +
> +u64 __udivmoddi4(u64 num, u64 den, u64 *rem)
> +{
> +	return _64bit_divide(num, den, rem);
> +}

How do you trigger this and should you not be using do_div(), etc,
instead?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210609/6d49c588/attachment.sig>


More information about the U-Boot mailing list