summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldivmod.c
blob: 1e0fba2419fcba4ea6696c34baf70c76fe7f9e3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/** @file

  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>

  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#include "Llvm_int_lib.h"
#include <Library/BaseLib.h>


UINT32 __udivsi3(UINT32 n, UINT32 d);
UINT32 __umodsi3(UINT32 a, UINT32 b);


UINT64
__aeabi_uidivmod(unsigned numerator, unsigned denominator)
{
  UINT64  Return;

  Return = __udivsi3 (numerator, denominator);
  Return |= LShiftU64 (__umodsi3 (numerator, denominator), 32);

  return Return;
}

unsigned
__aeabi_uidiv (unsigned n, unsigned d)
{
  return __udivsi3 (n, d);
}