debuggers.hg

view extras/mini-os/arch/ia64/__divdi3.S @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 .file "__divdi3.s"
3 // $FreeBSD: src/sys/libkern/ia64/__divdi3.S,v 1.1 2000/10/04 17:53:03 dfr Exp $
4 //
5 // Copyright (c) 2000, Intel Corporation
6 // All rights reserved.
7 //
8 // Contributed 2/15/2000 by Marius Cornea, John Harrison, Cristina Iordache,
9 // Ted Kubaska, Bob Norin, and Shane Story of the Computational Software Lab,
10 // Intel Corporation.
11 //
12 // WARRANTY DISCLAIMER
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
18 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
23 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 // Intel Corporation is the author of this code, and requests that all
27 // problem reports or change requests be submitted to it directly at
28 // http://developer.intel.com/opensource.
29 //
31 .section .text
32 .proc __divdi3#
33 .align 32
34 .global __divdi3#
35 .align 32
37 // 64-bit signed integer divide
39 __divdi3:
41 { .mii
42 alloc r31=ar.pfs,2,0,0,0
43 nop.i 0
44 nop.i 0;;
45 } { .mmi
47 // 64-BIT SIGNED INTEGER DIVIDE BEGINS HERE
49 setf.sig f8=r32
50 setf.sig f9=r33
51 nop.i 0;;
52 } { .mfb
53 nop.m 0
54 fcvt.xf f6=f8
55 nop.b 0
56 } { .mfb
57 nop.m 0
58 fcvt.xf f7=f9
59 nop.b 0;;
60 } { .mfi
61 nop.m 0
62 // Step (1)
63 // y0 = 1 / b in f8
64 frcpa.s1 f8,p6=f6,f7
65 nop.i 0;;
66 } { .mfi
67 nop.m 0
68 // Step (2)
69 // e0 = 1 - b * y0 in f9
70 (p6) fnma.s1 f9=f7,f8,f1
71 nop.i 0
72 } { .mfi
73 nop.m 0
74 // Step (3)
75 // q0 = a * y0 in f10
76 (p6) fma.s1 f10=f6,f8,f0
77 nop.i 0;;
78 } { .mfi
79 nop.m 0
80 // Step (4)
81 // e1 = e0 * e0 in f11
82 (p6) fma.s1 f11=f9,f9,f0
83 nop.i 0
84 } { .mfi
85 nop.m 0
86 // Step (5)
87 // q1 = q0 + e0 * q0 in f10
88 (p6) fma.s1 f10=f9,f10,f10
89 nop.i 0;;
90 } { .mfi
91 nop.m 0
92 // Step (6)
93 // y1 = y0 + e0 * y0 in f8
94 (p6) fma.s1 f8=f9,f8,f8
95 nop.i 0;;
96 } { .mfi
97 nop.m 0
98 // Step (7)
99 // q2 = q1 + e1 * q1 in f9
100 (p6) fma.s1 f9=f11,f10,f10
101 nop.i 0;;
102 } { .mfi
103 nop.m 0
104 // Step (8)
105 // y2 = y1 + e1 * y1 in f8
106 (p6) fma.s1 f8=f11,f8,f8
107 nop.i 0;;
108 } { .mfi
109 nop.m 0
110 // Step (9)
111 // r2 = a - b * q2 in f10
112 (p6) fnma.s1 f10=f7,f9,f6
113 nop.i 0;;
114 } { .mfi
115 nop.m 0
116 // Step (10)
117 // q3 = q2 + r2 * y2 in f8
118 (p6) fma.s1 f8=f10,f8,f9
119 nop.i 0;;
120 } { .mfb
121 nop.m 0
122 // Step (11)
123 // q = trunc (q3)
124 fcvt.fx.trunc.s1 f8=f8
125 nop.b 0;;
126 } { .mmi
127 // quotient will be in r8 (if b != 0)
128 getf.sig r8=f8
129 nop.m 0
130 nop.i 0;;
131 }
133 // 64-BIT SIGNED INTEGER DIVIDE ENDS HERE
135 { .mmb
136 nop.m 0
137 nop.m 0
138 br.ret.sptk b0;;
139 }
141 .endp __divdi3