1 /* libgcc functions for Blackfin.
2 Copyright (C) 2005, 2009 Free Software Foundation, Inc.
3 Contributed by Analog Devices.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
30 .type ___divsi3, STT_FUNC;
61 .type ___modsi3, STT_FUNC;
79 .type ___udivsi3, STT_FUNC;
83 LSETUP (0f, 1f) LC0 = P0;
84 /* upper half of dividend */
87 /* The first time round in the loop we shift in garbage, but since we
88 perform 33 shifts, it doesn't matter. */
94 /* Last instruction of the loop. */
97 /* Shift in the last bit. */
99 /* R0 is the result, R3 contains the remainder. */
107 .type ___umodsi3, STT_FUNC;
117 #ifdef L_umulsi3_highpart
119 .global ___umulsi3_highpart;
120 .type ___umulsi3_highpart, STT_FUNC;
123 A1 = R1.L * R0.L (FU);
125 A0 = R1.H * R0.H, A1 += R1.L * R0.H (FU);
126 A1 += R0.L * R1.H (FU);
133 #ifdef L_smulsi3_highpart
135 .global ___smulsi3_highpart;
136 .type ___smulsi3_highpart, STT_FUNC;
139 A1 = R1.L * R0.L (FU);
141 A0 = R0.H * R1.H, A1 += R0.H * R1.L (IS,M);
142 A1 += R1.H * R0.L (IS,M);