]> git.proxmox.com Git - rustc.git/blob - vendor/compiler_builtins/compiler-rt/lib/builtins/hexagon/udivsi3.S
New upstream version 1.36.0+dfsg1
[rustc.git] / vendor / compiler_builtins / compiler-rt / lib / builtins / hexagon / udivsi3.S
1 //===----------------------Hexagon builtin routine ------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 .macro FUNCTION_BEGIN name
11 .text
12 .p2align 5
13 .globl \name
14 .type \name, @function
15 \name:
16 .endm
17
18 .macro FUNCTION_END name
19 .size \name, . - \name
20 .endm
21
22
23 FUNCTION_BEGIN __hexagon_udivsi3
24 {
25 r2 = cl0(r0)
26 r3 = cl0(r1)
27 r5:4 = combine(#1,#0)
28 p0 = cmp.gtu(r1,r0)
29 }
30 {
31 r6 = sub(r3,r2)
32 r4 = r1
33 r1:0 = combine(r0,r4)
34 if (p0) jumpr r31
35 }
36 {
37 r3:2 = vlslw(r5:4,r6)
38 loop0(1f,r6)
39 }
40 .falign
41 1:
42 {
43 p0 = cmp.gtu(r2,r1)
44 if (!p0.new) r1 = sub(r1,r2)
45 if (!p0.new) r0 = add(r0,r3)
46 r3:2 = vlsrw(r3:2,#1)
47 }:endloop0
48 {
49 p0 = cmp.gtu(r2,r1)
50 if (!p0.new) r0 = add(r0,r3)
51 jumpr r31
52 }
53 FUNCTION_END __hexagon_udivsi3
54
55 .globl __qdsp_udivsi3
56 .set __qdsp_udivsi3, __hexagon_udivsi3