Linux Audio

Check our new training course

Loading...
v4.17
  1/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  2
  3This file is part of GNU CC.
  4
  5GNU CC is free software; you can redistribute it and/or modify
  6it under the terms of the GNU General Public License as published by
  7the Free Software Foundation; either version 2, or (at your option)
  8any later version.
  9
 10GNU CC is distributed in the hope that it will be useful,
 11but WITHOUT ANY WARRANTY; without even the implied warranty of
 12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13GNU General Public License for more details.
 14
 15You should have received a copy of the GNU General Public License
 16along with GNU CC; see the file COPYING.  If not, write to
 17the Free Software Foundation, 59 Temple Place - Suite 330,
 18Boston, MA 02111-1307, USA.  */
 19
 20	.text
 21	.align 4
 22	.globl __udivdi3
 23__udivdi3:
 24	save %sp,-104,%sp
 25	mov %i3,%o3
 26	cmp %i2,0
 27	bne .LL40
 28	mov %i1,%i3
 29	cmp %o3,%i0
 30	bleu .LL41
 31	mov %i3,%o1
 32	! Inlined udiv_qrnnd
 33	mov	32,%g1
 34	subcc	%i0,%o3,%g0
 351:	bcs	5f
 36	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
 37	sub	%i0,%o3,%i0	! this kills msb of n
 38	addx	%i0,%i0,%i0	! so this cannot give carry
 39	subcc	%g1,1,%g1
 402:	bne	1b
 41	 subcc	%i0,%o3,%g0
 42	bcs	3f
 43	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
 44	b	3f
 45	 sub	%i0,%o3,%i0	! this kills msb of n
 464:	sub	%i0,%o3,%i0
 475:	addxcc	%i0,%i0,%i0
 48	bcc	2b
 49	 subcc	%g1,1,%g1
 50! Got carry from n.  Subtract next step to cancel this carry.
 51	bne	4b
 52	 addcc	%o1,%o1,%o1	! shift n1n0 and a 0-bit in lsb
 53	sub	%i0,%o3,%i0
 543:	xnor	%o1,0,%o1
 55	! End of inline udiv_qrnnd
 56	b .LL45
 57	mov 0,%o2
 58.LL41:
 59	cmp %o3,0
 60	bne .LL77
 61	mov %i0,%o2
 62	mov 1,%o0
 
 63	mov 0,%o1
 64	wr %g0, 0, %y
 65	udiv %o0, %o1, %o0
 66	mov %o0,%o3
 67	mov %i0,%o2
 68.LL77:
 69	mov 0,%o4
 70	! Inlined udiv_qrnnd
 71	mov	32,%g1
 72	subcc	%o4,%o3,%g0
 731:	bcs	5f
 74	 addxcc %o2,%o2,%o2	! shift n1n0 and a q-bit in lsb
 75	sub	%o4,%o3,%o4	! this kills msb of n
 76	addx	%o4,%o4,%o4	! so this cannot give carry
 77	subcc	%g1,1,%g1
 782:	bne	1b
 79	 subcc	%o4,%o3,%g0
 80	bcs	3f
 81	 addxcc %o2,%o2,%o2	! shift n1n0 and a q-bit in lsb
 82	b	3f
 83	 sub	%o4,%o3,%o4	! this kills msb of n
 844:	sub	%o4,%o3,%o4
 855:	addxcc	%o4,%o4,%o4
 86	bcc	2b
 87	 subcc	%g1,1,%g1
 88! Got carry from n.  Subtract next step to cancel this carry.
 89	bne	4b
 90	 addcc	%o2,%o2,%o2	! shift n1n0 and a 0-bit in lsb
 91	sub	%o4,%o3,%o4
 923:	xnor	%o2,0,%o2
 93	! End of inline udiv_qrnnd
 94	mov %o4,%i0
 95	mov %i3,%o1
 96	! Inlined udiv_qrnnd
 97	mov	32,%g1
 98	subcc	%i0,%o3,%g0
 991:	bcs	5f
100	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
101	sub	%i0,%o3,%i0	! this kills msb of n
102	addx	%i0,%i0,%i0	! so this cannot give carry
103	subcc	%g1,1,%g1
1042:	bne	1b
105	 subcc	%i0,%o3,%g0
106	bcs	3f
107	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
108	b	3f
109	 sub	%i0,%o3,%i0	! this kills msb of n
1104:	sub	%i0,%o3,%i0
1115:	addxcc	%i0,%i0,%i0
112	bcc	2b
113	 subcc	%g1,1,%g1
114! Got carry from n.  Subtract next step to cancel this carry.
115	bne	4b
116	 addcc	%o1,%o1,%o1	! shift n1n0 and a 0-bit in lsb
117	sub	%i0,%o3,%i0
1183:	xnor	%o1,0,%o1
119	! End of inline udiv_qrnnd
120	b .LL78
121	mov %o1,%l1
122.LL40:
123	cmp %i2,%i0
124	bleu .LL46
125	sethi %hi(65535),%o0
126	b .LL73
127	mov 0,%o1
128.LL46:
129	or %o0,%lo(65535),%o0
130	cmp %i2,%o0
131	bgu .LL53
132	mov %i2,%o1
133	cmp %i2,256
134	addx %g0,-1,%o0
135	b .LL59
136	and %o0,8,%o2
137.LL53:
138	sethi %hi(16777215),%o0
139	or %o0,%lo(16777215),%o0
140	cmp %o1,%o0
141	bgu .LL59
142	mov 24,%o2
143	mov 16,%o2
144.LL59:
145	srl %o1,%o2,%o1
146	sethi %hi(__clz_tab),%o0
147	or %o0,%lo(__clz_tab),%o0
148	ldub [%o1+%o0],%o0
149	add %o0,%o2,%o0
150	mov 32,%o1
151	subcc %o1,%o0,%o2
152	bne,a .LL67
153	mov 32,%o0
154	cmp %i0,%i2
155	bgu .LL69
156	cmp %i3,%o3
157	blu .LL73
158	mov 0,%o1
159.LL69:
160	b .LL73
161	mov 1,%o1
162.LL67:
163	sub %o0,%o2,%o0
164	sll %i2,%o2,%i2
165	srl %o3,%o0,%o1
166	or %i2,%o1,%i2
167	sll %o3,%o2,%o3
168	srl %i0,%o0,%o1
169	sll %i0,%o2,%i0
170	srl %i3,%o0,%o0
171	or %i0,%o0,%i0
172	sll %i3,%o2,%i3
173	mov %i0,%o5
174	mov %o1,%o4
175	! Inlined udiv_qrnnd
176	mov	32,%g1
177	subcc	%o4,%i2,%g0
1781:	bcs	5f
179	 addxcc %o5,%o5,%o5	! shift n1n0 and a q-bit in lsb
180	sub	%o4,%i2,%o4	! this kills msb of n
181	addx	%o4,%o4,%o4	! so this cannot give carry
182	subcc	%g1,1,%g1
1832:	bne	1b
184	 subcc	%o4,%i2,%g0
185	bcs	3f
186	 addxcc %o5,%o5,%o5	! shift n1n0 and a q-bit in lsb
187	b	3f
188	 sub	%o4,%i2,%o4	! this kills msb of n
1894:	sub	%o4,%i2,%o4
1905:	addxcc	%o4,%o4,%o4
191	bcc	2b
192	 subcc	%g1,1,%g1
193! Got carry from n.  Subtract next step to cancel this carry.
194	bne	4b
195	 addcc	%o5,%o5,%o5	! shift n1n0 and a 0-bit in lsb
196	sub	%o4,%i2,%o4
1973:	xnor	%o5,0,%o5
198	! End of inline udiv_qrnnd
199	mov %o4,%i0
200	mov %o5,%o1
201	! Inlined umul_ppmm
202	wr	%g0,%o1,%y	! SPARC has 0-3 delay insn after a wr
203	sra	%o3,31,%g2	! Do not move this insn
204	and	%o1,%g2,%g2	! Do not move this insn
205	andcc	%g0,0,%g1	! Do not move this insn
206	mulscc	%g1,%o3,%g1
207	mulscc	%g1,%o3,%g1
208	mulscc	%g1,%o3,%g1
209	mulscc	%g1,%o3,%g1
210	mulscc	%g1,%o3,%g1
211	mulscc	%g1,%o3,%g1
212	mulscc	%g1,%o3,%g1
213	mulscc	%g1,%o3,%g1
214	mulscc	%g1,%o3,%g1
215	mulscc	%g1,%o3,%g1
216	mulscc	%g1,%o3,%g1
217	mulscc	%g1,%o3,%g1
218	mulscc	%g1,%o3,%g1
219	mulscc	%g1,%o3,%g1
220	mulscc	%g1,%o3,%g1
221	mulscc	%g1,%o3,%g1
222	mulscc	%g1,%o3,%g1
223	mulscc	%g1,%o3,%g1
224	mulscc	%g1,%o3,%g1
225	mulscc	%g1,%o3,%g1
226	mulscc	%g1,%o3,%g1
227	mulscc	%g1,%o3,%g1
228	mulscc	%g1,%o3,%g1
229	mulscc	%g1,%o3,%g1
230	mulscc	%g1,%o3,%g1
231	mulscc	%g1,%o3,%g1
232	mulscc	%g1,%o3,%g1
233	mulscc	%g1,%o3,%g1
234	mulscc	%g1,%o3,%g1
235	mulscc	%g1,%o3,%g1
236	mulscc	%g1,%o3,%g1
237	mulscc	%g1,%o3,%g1
238	mulscc	%g1,0,%g1
239	add	%g1,%g2,%o0
240	rd	%y,%o2
241	cmp %o0,%i0
242	bgu,a .LL73
243	add %o1,-1,%o1
244	bne,a .LL45
245	mov 0,%o2
246	cmp %o2,%i3
247	bleu .LL45
248	mov 0,%o2
249	add %o1,-1,%o1
250.LL73:
251	mov 0,%o2
252.LL45:
253	mov %o1,%l1
254.LL78:
255	mov %o2,%l0
256	mov %l0,%i0
257	mov %l1,%i1
258	ret
259	restore
v3.1
  1/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  2
  3This file is part of GNU CC.
  4
  5GNU CC is free software; you can redistribute it and/or modify
  6it under the terms of the GNU General Public License as published by
  7the Free Software Foundation; either version 2, or (at your option)
  8any later version.
  9
 10GNU CC is distributed in the hope that it will be useful,
 11but WITHOUT ANY WARRANTY; without even the implied warranty of
 12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13GNU General Public License for more details.
 14
 15You should have received a copy of the GNU General Public License
 16along with GNU CC; see the file COPYING.  If not, write to
 17the Free Software Foundation, 59 Temple Place - Suite 330,
 18Boston, MA 02111-1307, USA.  */
 19
 20	.text
 21	.align 4
 22	.globl __udivdi3
 23__udivdi3:
 24	save %sp,-104,%sp
 25	mov %i3,%o3
 26	cmp %i2,0
 27	bne .LL40
 28	mov %i1,%i3
 29	cmp %o3,%i0
 30	bleu .LL41
 31	mov %i3,%o1
 32	! Inlined udiv_qrnnd
 33	mov	32,%g1
 34	subcc	%i0,%o3,%g0
 351:	bcs	5f
 36	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
 37	sub	%i0,%o3,%i0	! this kills msb of n
 38	addx	%i0,%i0,%i0	! so this cannot give carry
 39	subcc	%g1,1,%g1
 402:	bne	1b
 41	 subcc	%i0,%o3,%g0
 42	bcs	3f
 43	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
 44	b	3f
 45	 sub	%i0,%o3,%i0	! this kills msb of n
 464:	sub	%i0,%o3,%i0
 475:	addxcc	%i0,%i0,%i0
 48	bcc	2b
 49	 subcc	%g1,1,%g1
 50! Got carry from n.  Subtract next step to cancel this carry.
 51	bne	4b
 52	 addcc	%o1,%o1,%o1	! shift n1n0 and a 0-bit in lsb
 53	sub	%i0,%o3,%i0
 543:	xnor	%o1,0,%o1
 55	! End of inline udiv_qrnnd
 56	b .LL45
 57	mov 0,%o2
 58.LL41:
 59	cmp %o3,0
 60	bne .LL77
 61	mov %i0,%o2
 62	mov 1,%o0
 63	call .udiv,0
 64	mov 0,%o1
 
 
 65	mov %o0,%o3
 66	mov %i0,%o2
 67.LL77:
 68	mov 0,%o4
 69	! Inlined udiv_qrnnd
 70	mov	32,%g1
 71	subcc	%o4,%o3,%g0
 721:	bcs	5f
 73	 addxcc %o2,%o2,%o2	! shift n1n0 and a q-bit in lsb
 74	sub	%o4,%o3,%o4	! this kills msb of n
 75	addx	%o4,%o4,%o4	! so this cannot give carry
 76	subcc	%g1,1,%g1
 772:	bne	1b
 78	 subcc	%o4,%o3,%g0
 79	bcs	3f
 80	 addxcc %o2,%o2,%o2	! shift n1n0 and a q-bit in lsb
 81	b	3f
 82	 sub	%o4,%o3,%o4	! this kills msb of n
 834:	sub	%o4,%o3,%o4
 845:	addxcc	%o4,%o4,%o4
 85	bcc	2b
 86	 subcc	%g1,1,%g1
 87! Got carry from n.  Subtract next step to cancel this carry.
 88	bne	4b
 89	 addcc	%o2,%o2,%o2	! shift n1n0 and a 0-bit in lsb
 90	sub	%o4,%o3,%o4
 913:	xnor	%o2,0,%o2
 92	! End of inline udiv_qrnnd
 93	mov %o4,%i0
 94	mov %i3,%o1
 95	! Inlined udiv_qrnnd
 96	mov	32,%g1
 97	subcc	%i0,%o3,%g0
 981:	bcs	5f
 99	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
100	sub	%i0,%o3,%i0	! this kills msb of n
101	addx	%i0,%i0,%i0	! so this cannot give carry
102	subcc	%g1,1,%g1
1032:	bne	1b
104	 subcc	%i0,%o3,%g0
105	bcs	3f
106	 addxcc %o1,%o1,%o1	! shift n1n0 and a q-bit in lsb
107	b	3f
108	 sub	%i0,%o3,%i0	! this kills msb of n
1094:	sub	%i0,%o3,%i0
1105:	addxcc	%i0,%i0,%i0
111	bcc	2b
112	 subcc	%g1,1,%g1
113! Got carry from n.  Subtract next step to cancel this carry.
114	bne	4b
115	 addcc	%o1,%o1,%o1	! shift n1n0 and a 0-bit in lsb
116	sub	%i0,%o3,%i0
1173:	xnor	%o1,0,%o1
118	! End of inline udiv_qrnnd
119	b .LL78
120	mov %o1,%l1
121.LL40:
122	cmp %i2,%i0
123	bleu .LL46
124	sethi %hi(65535),%o0
125	b .LL73
126	mov 0,%o1
127.LL46:
128	or %o0,%lo(65535),%o0
129	cmp %i2,%o0
130	bgu .LL53
131	mov %i2,%o1
132	cmp %i2,256
133	addx %g0,-1,%o0
134	b .LL59
135	and %o0,8,%o2
136.LL53:
137	sethi %hi(16777215),%o0
138	or %o0,%lo(16777215),%o0
139	cmp %o1,%o0
140	bgu .LL59
141	mov 24,%o2
142	mov 16,%o2
143.LL59:
144	srl %o1,%o2,%o1
145	sethi %hi(__clz_tab),%o0
146	or %o0,%lo(__clz_tab),%o0
147	ldub [%o1+%o0],%o0
148	add %o0,%o2,%o0
149	mov 32,%o1
150	subcc %o1,%o0,%o2
151	bne,a .LL67
152	mov 32,%o0
153	cmp %i0,%i2
154	bgu .LL69
155	cmp %i3,%o3
156	blu .LL73
157	mov 0,%o1
158.LL69:
159	b .LL73
160	mov 1,%o1
161.LL67:
162	sub %o0,%o2,%o0
163	sll %i2,%o2,%i2
164	srl %o3,%o0,%o1
165	or %i2,%o1,%i2
166	sll %o3,%o2,%o3
167	srl %i0,%o0,%o1
168	sll %i0,%o2,%i0
169	srl %i3,%o0,%o0
170	or %i0,%o0,%i0
171	sll %i3,%o2,%i3
172	mov %i0,%o5
173	mov %o1,%o4
174	! Inlined udiv_qrnnd
175	mov	32,%g1
176	subcc	%o4,%i2,%g0
1771:	bcs	5f
178	 addxcc %o5,%o5,%o5	! shift n1n0 and a q-bit in lsb
179	sub	%o4,%i2,%o4	! this kills msb of n
180	addx	%o4,%o4,%o4	! so this cannot give carry
181	subcc	%g1,1,%g1
1822:	bne	1b
183	 subcc	%o4,%i2,%g0
184	bcs	3f
185	 addxcc %o5,%o5,%o5	! shift n1n0 and a q-bit in lsb
186	b	3f
187	 sub	%o4,%i2,%o4	! this kills msb of n
1884:	sub	%o4,%i2,%o4
1895:	addxcc	%o4,%o4,%o4
190	bcc	2b
191	 subcc	%g1,1,%g1
192! Got carry from n.  Subtract next step to cancel this carry.
193	bne	4b
194	 addcc	%o5,%o5,%o5	! shift n1n0 and a 0-bit in lsb
195	sub	%o4,%i2,%o4
1963:	xnor	%o5,0,%o5
197	! End of inline udiv_qrnnd
198	mov %o4,%i0
199	mov %o5,%o1
200	! Inlined umul_ppmm
201	wr	%g0,%o1,%y	! SPARC has 0-3 delay insn after a wr
202	sra	%o3,31,%g2	! Do not move this insn
203	and	%o1,%g2,%g2	! Do not move this insn
204	andcc	%g0,0,%g1	! Do not move this insn
205	mulscc	%g1,%o3,%g1
206	mulscc	%g1,%o3,%g1
207	mulscc	%g1,%o3,%g1
208	mulscc	%g1,%o3,%g1
209	mulscc	%g1,%o3,%g1
210	mulscc	%g1,%o3,%g1
211	mulscc	%g1,%o3,%g1
212	mulscc	%g1,%o3,%g1
213	mulscc	%g1,%o3,%g1
214	mulscc	%g1,%o3,%g1
215	mulscc	%g1,%o3,%g1
216	mulscc	%g1,%o3,%g1
217	mulscc	%g1,%o3,%g1
218	mulscc	%g1,%o3,%g1
219	mulscc	%g1,%o3,%g1
220	mulscc	%g1,%o3,%g1
221	mulscc	%g1,%o3,%g1
222	mulscc	%g1,%o3,%g1
223	mulscc	%g1,%o3,%g1
224	mulscc	%g1,%o3,%g1
225	mulscc	%g1,%o3,%g1
226	mulscc	%g1,%o3,%g1
227	mulscc	%g1,%o3,%g1
228	mulscc	%g1,%o3,%g1
229	mulscc	%g1,%o3,%g1
230	mulscc	%g1,%o3,%g1
231	mulscc	%g1,%o3,%g1
232	mulscc	%g1,%o3,%g1
233	mulscc	%g1,%o3,%g1
234	mulscc	%g1,%o3,%g1
235	mulscc	%g1,%o3,%g1
236	mulscc	%g1,%o3,%g1
237	mulscc	%g1,0,%g1
238	add	%g1,%g2,%o0
239	rd	%y,%o2
240	cmp %o0,%i0
241	bgu,a .LL73
242	add %o1,-1,%o1
243	bne,a .LL45
244	mov 0,%o2
245	cmp %o2,%i3
246	bleu .LL45
247	mov 0,%o2
248	add %o1,-1,%o1
249.LL73:
250	mov 0,%o2
251.LL45:
252	mov %o1,%l1
253.LL78:
254	mov %o2,%l0
255	mov %l0,%i0
256	mov %l1,%i1
257	ret
258	restore