1 | //===----------------------Hexagon builtin routine ------------------------===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | .macro FUNCTION_BEGIN name |
10 | .text |
11 | .p2align 5 |
12 | .globl \name |
13 | .type \name, @function |
14 | \name: |
15 | .endm |
16 | |
17 | .macro FUNCTION_END name |
18 | .size \name, . - \name |
19 | .endm |
20 | |
21 | #define Q6_ALIAS(TAG) .global __qdsp_##TAG ; .set __qdsp_##TAG, __hexagon_##TAG |
22 | #define FAST_ALIAS(TAG) .global __hexagon_fast_##TAG ; .set __hexagon_fast_##TAG, __hexagon_##TAG |
23 | #define FAST2_ALIAS(TAG) .global __hexagon_fast2_##TAG ; .set __hexagon_fast2_##TAG, __hexagon_##TAG |
24 | |
25 | FUNCTION_BEGIN __hexagon_divsf3 |
26 | { |
27 | r2,p0 = sfrecipa(r0,r1) |
28 | r4 = sffixupd(r0,r1) |
29 | r3 = ##0x3f800000 // 1.0 |
30 | } |
31 | { |
32 | r5 = sffixupn(r0,r1) |
33 | r3 -= sfmpy(r4,r2):lib // 1-(den/recip) yields error? |
34 | r6 = ##0x80000000 |
35 | r7 = r3 |
36 | } |
37 | { |
38 | r2 += sfmpy(r3,r2):lib |
39 | r3 = r7 |
40 | r6 = r5 |
41 | r0 = and(r6,r5) |
42 | } |
43 | { |
44 | r3 -= sfmpy(r4,r2):lib |
45 | r0 += sfmpy(r5,r2):lib |
46 | } |
47 | { |
48 | r2 += sfmpy(r3,r2):lib |
49 | r6 -= sfmpy(r0,r4):lib |
50 | } |
51 | { |
52 | r0 += sfmpy(r6,r2):lib |
53 | } |
54 | { |
55 | r5 -= sfmpy(r0,r4):lib |
56 | } |
57 | { |
58 | r0 += sfmpy(r5,r2,p0):scale |
59 | jumpr r31 |
60 | } |
61 | FUNCTION_END __hexagon_divsf3 |
62 | |
63 | Q6_ALIAS(divsf3) |
64 | FAST_ALIAS(divsf3) |
65 | FAST2_ALIAS(divsf3) |
66 | |