]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S
ArmPkg: use unified asm syntax for CLANG
[mirror_edk2.git] / ArmPkg / Library / CompilerIntrinsicsLib / Arm / udivsi3.S
CommitLineData
3402aac7 1#------------------------------------------------------------------------------\r
1e57a462 2#\r
3# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
4#\r
5# This program and the accompanying materials\r
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12#\r
13#------------------------------------------------------------------------------\r
14\r
15 .text\r
1a0db791 16 .syntax unified\r
1e57a462 17 .align 2\r
18 GCC_ASM_EXPORT(__udivsi3)\r
19\r
20ASM_PFX(__udivsi3):\r
21 cmp r1, #0\r
22 cmpne r0, #0\r
23 stmfd sp!, {r4, r5, r7, lr}\r
24 add r7, sp, #8\r
25 beq L2\r
26 clz r2, r1\r
27 clz r3, r0\r
28 rsb r3, r3, r2\r
29 cmp r3, #31\r
30 bhi L2\r
1a0db791 31 ldmfdeq sp!, {r4, r5, r7, pc}\r
1e57a462 32 add r5, r3, #1\r
33 rsb r3, r3, #31\r
34 mov lr, #0\r
35 mov r2, r0, asl r3\r
36 mov ip, r0, lsr r5\r
37 mov r4, lr\r
38 b L8\r
39L9:\r
40 mov r0, r2, lsr #31\r
41 orr ip, r0, ip, asl #1\r
42 orr r2, r3, lr\r
43 rsb r3, ip, r1\r
44 sub r3, r3, #1\r
45 and r0, r1, r3, asr #31\r
46 mov lr, r3, lsr #31\r
47 rsb ip, r0, ip\r
48 add r4, r4, #1\r
49L8:\r
50 cmp r4, r5\r
51 mov r3, r2, asl #1\r
52 bne L9\r
53 orr r0, r3, lr\r
54 ldmfd sp!, {r4, r5, r7, pc}\r
55L2:\r
56 mov r0, #0\r
57 ldmfd sp!, {r4, r5, r7, pc}\r
58\r