]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/builtins/hexagon/umodsi3.S
Merge compiler-rt trunk r338150, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / builtins / hexagon / umodsi3.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
11         .macro FUNCTION_BEGIN name
12         .text
13         .p2align 5
14         .globl \name
15         .type  \name, @function
16 \name:
17         .endm
18
19         .macro FUNCTION_END name
20         .size  \name, . - \name
21         .endm
22
23
24 FUNCTION_BEGIN __hexagon_umodsi3
25         {
26                 r2 = cl0(r0)
27                 r3 = cl0(r1)
28                 p0 = cmp.gtu(r1,r0)
29         }
30         {
31                 r2 = sub(r3,r2)
32                 if (p0) jumpr r31
33         }
34         {
35                 loop0(1f,r2)
36                 p1 = cmp.eq(r2,#0)
37                 r2 = lsl(r1,r2)
38         }
39         .falign
40 1:
41         {
42                 p0 = cmp.gtu(r2,r0)
43                 if (!p0.new) r0 = sub(r0,r2)
44                 r2 = lsr(r2,#1)
45                 if (p1) r1 = #0
46         }:endloop0
47         {
48                 p0 = cmp.gtu(r2,r0)
49                 if (!p0.new) r0 = sub(r0,r1)
50                 jumpr r31
51         }
52 FUNCTION_END __hexagon_umodsi3
53
54   .globl __qdsp_umodsi3
55   .set   __qdsp_umodsi3, __hexagon_umodsi3