initial import
[glibc.git] / sysdeps / alpha / divq.S
blob79ff6ca7c5f6e7fc7188171e0cd6d628f1eeb0a8
1       /* This file is generated from divrem.m4; DO NOT EDIT! */
2 /* For each N divided by D, we do:
3       result = (double) N / (double) D
4    Then, for each N mod D, we do:
5       result = N - (D * divMODE (N, D))
7    FIXME:
8    The q and qu versions won't deal with operands > 50 bits.  We also
9    don't check for divide by zero.  */
11 #include "DEFS.h"
12 #if 0
13 /* We do not handle div by zero yet.  */
14 #include <machine/pal.h>
15 #endif
16 #include <sysdep.h>
23 FUNC__(divq)
24         /* First set up the dividend.  */
25         
26         stq t10,0(sp)
27         ldt $f10,0(sp)
28         cvtqt $f10,$f10
29         
31         /* Then set up the divisor.  */
32         
33         stq t11,0(sp)
34         ldt $f1,0(sp)
35         cvtqt $f1,$f1
36         
38         /* Do the division.  */
39         divt $f10,$f1,$f10
40         cvttqc $f10,$f10
42         /* Put the result in t12.  */
43         stt $f10,0(sp)
44         ldq t12,0(sp)
45         
47         
49         lda sp,16(sp)
50         ret zero,(t9),1
51         .end NAME__(divq)