]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/alpha/div.S
Update copyright dates with scripts/update-copyrights
[thirdparty/glibc.git] / sysdeps / alpha / div.S
CommitLineData
dff8da6b 1/* Copyright (C) 1996-2024 Free Software Foundation, Inc.
60c74cf0
UD
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
3214b89b
AJ
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
60c74cf0
UD
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3214b89b 12 Lesser General Public License for more details.
60c74cf0 13
3214b89b 14 You should have received a copy of the GNU Lesser General Public
ab84e3ff 15 License along with the GNU C Library. If not, see
5a82c748 16 <https://www.gnu.org/licenses/>. */
60c74cf0 17
bd68d850 18#include "div_libc.h"
60c74cf0 19
bd68d850
RH
20#undef FRAME
21#ifdef __alpha_fix__
22#define FRAME 0
60c74cf0 23#else
bd68d850 24#define FRAME 16
60c74cf0
UD
25#endif
26
27 .set noat
28
29 .align 4
30 .globl div
31 .ent div
32div:
bd68d850
RH
33 .frame sp, FRAME, ra
34#if FRAME > 0
35 lda sp, -FRAME(sp)
36#endif
60c74cf0 37#ifdef PROF
bd68d850 38 .set macro
60c74cf0
UD
39 ldgp gp, 0(pv)
40 lda AT, _mcount
41 jsr AT, (AT), _mcount
bd68d850 42 .set nomacro
60c74cf0
UD
43 .prologue 1
44#else
45 .prologue 0
46#endif
47
bd68d850 48 beq $18, $divbyzero
a61c91b0
RH
49 excb
50 mf_fpcr $f10
bd68d850
RH
51
52 _ITOFT2 $17, $f0, 0, $18, $f1, 8
53
54 cvtqt $f0, $f0
55 cvtqt $f1, $f1
56 divt/c $f0, $f1, $f0
57 cvttq/c $f0, $f0
a61c91b0
RH
58 excb
59 mt_fpcr $f10
bd68d850
RH
60 _FTOIT $f0, $0, 0
61
62 mull $0, $18, $1
63 subl $17, $1, $1
64
65 stl $0, 0(a0)
66 stl $1, 4(a0)
67 mov a0, v0
68
69#if FRAME > 0
70 lda sp, FRAME(sp)
71#endif
72 ret
60c74cf0
UD
73
74$divbyzero:
75 mov a0, v0
bd68d850 76 lda a0, GEN_INTDIV
60c74cf0 77 call_pal PAL_gentrap
60c74cf0
UD
78 stl zero, 0(v0)
79 stl zero, 4(v0)
bd68d850
RH
80
81#if FRAME > 0
82 lda sp, FRAME(sp)
83#endif
60c74cf0
UD
84 ret
85
86 .end div