OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgcc/] [config/] [tilepro/] [softmpy.S] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 734 jeremybenn
/* 64-bit multiplication support for TILEPro.
2
   Copyright (C) 2011, 2012
3
   Free Software Foundation, Inc.
4
   Contributed by Walter Lee (walt@tilera.com)
5
 
6
   This file is free software; you can redistribute it and/or modify it
7
   under the terms of the GNU General Public License as published by the
8
   Free Software Foundation; either version 3, or (at your option) any
9
   later version.
10
 
11
   This file is distributed in the hope that it will be useful, but
12
   WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
   General Public License for more details.
15
 
16
   Under Section 7 of GPL version 3, you are granted additional
17
   permissions described in the GCC Runtime Library Exception, version
18
   3.1, as published by the Free Software Foundation.
19
 
20
   You should have received a copy of the GNU General Public License and
21
   a copy of the GCC Runtime Library Exception along with this program;
22
   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23
   .  */
24
 
25
/* 64-bit multiplication support.  */
26
 
27
        .file "softmpy.S"
28
 
29
/* Parameters */
30
#define lo0             r9   /* low 32 bits of n0  */
31
#define hi0             r1   /* high 32 bits of n0 */
32
#define lo1             r2   /* low 32 bits of n1  */
33
#define hi1             r3   /* high 32 bits of n1 */
34
 
35
/* temps */
36
#define result1_a       r4
37
#define result1_b       r5
38
 
39
#define tmp0            r6
40
#define tmp0_left_16    r7
41
#define tmp1            r8
42
 
43
        .section .text.__muldi3, "ax"
44
        .align 8
45
        .globl __muldi3
46
        .type __muldi3, @function
47
__muldi3:
48
        {
49
         move        lo0, r0 /* so we can write "out r0" while "in r0" alive */
50
         mulhl_uu    tmp0, lo1, r0
51
        }
52
        {
53
         mulll_uu    result1_a, lo1, hi0
54
        }
55
        {
56
         move        tmp1, tmp0
57
         mulhla_uu   tmp0, lo0, lo1
58
        }
59
        {
60
         mulhlsa_uu  result1_a, lo1, hi0
61
        }
62
        {
63
         mulll_uu    result1_b, lo0, hi1
64
         slt_u       tmp1, tmp0, tmp1
65
        }
66
        {
67
         mulhlsa_uu  result1_a, lo0, hi1
68
         shli        r0, tmp0, 16
69
        }
70
        {
71
         move        tmp0_left_16, r0
72
         mulhha_uu   result1_b, lo0, lo1
73
        }
74
        {
75
         mullla_uu   r0, lo1, lo0
76
         shli        tmp1, tmp1, 16
77
        }
78
        {
79
         mulhlsa_uu  result1_b, hi0, lo1
80
         inthh       tmp1, tmp1, tmp0
81
        }
82
        {
83
         mulhlsa_uu  result1_a, hi1, lo0
84
         slt_u       tmp0, r0, tmp0_left_16
85
        }
86
        /* NOTE: this will stall for a cycle here. Oh well. */
87
        {
88
         add         r1, tmp0, tmp1
89
         add         result1_a, result1_a, result1_b
90
        }
91
        {
92
         add         r1, r1, result1_a
93
         jrp         lr
94
        }
95
        .size __muldi3,.-__muldi3

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.