Deleted Added
full compact
libgcc2.c (132727) libgcc2.c (146906)
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under

--- 59 unchanged lines hidden (view full) ---

68 .high = -uu.s.high - ((UWtype) -uu.s.low > 0) } };
69
70 return w.ll;
71}
72#endif
73
74#ifdef L_addvsi3
75Wtype
1/* More subroutines needed by GCC output code on some machines. */
2/* Compile this one with gcc. */
3/* Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under

--- 59 unchanged lines hidden (view full) ---

68 .high = -uu.s.high - ((UWtype) -uu.s.low > 0) } };
69
70 return w.ll;
71}
72#endif
73
74#ifdef L_addvsi3
75Wtype
76__addvsi3 (Wtype a, Wtype b)
76__addvSI3 (Wtype a, Wtype b)
77{
78 const Wtype w = a + b;
79
80 if (b >= 0 ? w < a : w > a)
81 abort ();
82
83 return w;
84}
77{
78 const Wtype w = a + b;
79
80 if (b >= 0 ? w < a : w > a)
81 abort ();
82
83 return w;
84}
85#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
86SItype
87__addvsi3 (SItype a, SItype b)
88{
89 const SItype w = a + b;
90
91 if (b >= 0 ? w < a : w > a)
92 abort ();
93
94 return w;
95}
96#endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */
85#endif
86
87#ifdef L_addvdi3
88DWtype
97#endif
98
99#ifdef L_addvdi3
100DWtype
89__addvdi3 (DWtype a, DWtype b)
101__addvDI3 (DWtype a, DWtype b)
90{
91 const DWtype w = a + b;
92
93 if (b >= 0 ? w < a : w > a)
94 abort ();
95
96 return w;
97}
98#endif
99
100#ifdef L_subvsi3
101Wtype
102{
103 const DWtype w = a + b;
104
105 if (b >= 0 ? w < a : w > a)
106 abort ();
107
108 return w;
109}
110#endif
111
112#ifdef L_subvsi3
113Wtype
102__subvsi3 (Wtype a, Wtype b)
114__subvSI3 (Wtype a, Wtype b)
103{
115{
104 const DWtype w = a - b;
116 const Wtype w = a - b;
105
106 if (b >= 0 ? w > a : w < a)
107 abort ();
108
109 return w;
110}
117
118 if (b >= 0 ? w > a : w < a)
119 abort ();
120
121 return w;
122}
123#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
124SItype
125__subvsi3 (SItype a, SItype b)
126{
127 const SItype w = a - b;
128
129 if (b >= 0 ? w > a : w < a)
130 abort ();
131
132 return w;
133}
134#endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */
111#endif
112
113#ifdef L_subvdi3
114DWtype
135#endif
136
137#ifdef L_subvdi3
138DWtype
115__subvdi3 (DWtype a, DWtype b)
139__subvDI3 (DWtype a, DWtype b)
116{
117 const DWtype w = a - b;
118
119 if (b >= 0 ? w > a : w < a)
120 abort ();
121
122 return w;
123}
124#endif
125
126#ifdef L_mulvsi3
127#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
128Wtype
140{
141 const DWtype w = a - b;
142
143 if (b >= 0 ? w > a : w < a)
144 abort ();
145
146 return w;
147}
148#endif
149
150#ifdef L_mulvsi3
151#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
152Wtype
129__mulvsi3 (Wtype a, Wtype b)
153__mulvSI3 (Wtype a, Wtype b)
130{
131 const DWtype w = (DWtype) a * (DWtype) b;
132
154{
155 const DWtype w = (DWtype) a * (DWtype) b;
156
133 if (((a >= 0) == (b >= 0))
134 ? (UDWtype) w > (UDWtype) (((DWtype) 1 << (WORD_SIZE - 1)) - 1)
135 : (UDWtype) w < (UDWtype) ((DWtype) -1 << (WORD_SIZE - 1)))
157 if ((Wtype) (w >> WORD_SIZE) != (Wtype) w >> (WORD_SIZE - 1))
136 abort ();
137
138 return w;
139}
158 abort ();
159
160 return w;
161}
162#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
163#undef WORD_SIZE
164#define WORD_SIZE (sizeof (SItype) * BITS_PER_UNIT)
165SItype
166__mulvsi3 (SItype a, SItype b)
167{
168 const DItype w = (DItype) a * (DItype) b;
169
170 if ((SItype) (w >> WORD_SIZE) != (SItype) w >> (WORD_SIZE-1))
171 abort ();
172
173 return w;
174}
175#endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */
140#endif
141
142#ifdef L_negvsi2
143Wtype
176#endif
177
178#ifdef L_negvsi2
179Wtype
144__negvsi2 (Wtype a)
180__negvSI2 (Wtype a)
145{
146 const Wtype w = -a;
147
148 if (a >= 0 ? w > 0 : w < 0)
149 abort ();
150
151 return w;
152}
181{
182 const Wtype w = -a;
183
184 if (a >= 0 ? w > 0 : w < 0)
185 abort ();
186
187 return w;
188}
189#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
190SItype
191__negvsi2 (SItype a)
192{
193 const SItype w = -a;
194
195 if (a >= 0 ? w > 0 : w < 0)
196 abort ();
197
198 return w;
199}
200#endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */
153#endif
154
155#ifdef L_negvdi2
156DWtype
201#endif
202
203#ifdef L_negvdi2
204DWtype
157__negvdi2 (DWtype a)
205__negvDI2 (DWtype a)
158{
159 const DWtype w = -a;
160
161 if (a >= 0 ? w > 0 : w < 0)
162 abort ();
163
164 return w;
165}
166#endif
167
168#ifdef L_absvsi2
169Wtype
206{
207 const DWtype w = -a;
208
209 if (a >= 0 ? w > 0 : w < 0)
210 abort ();
211
212 return w;
213}
214#endif
215
216#ifdef L_absvsi2
217Wtype
170__absvsi2 (Wtype a)
218__absvSI2 (Wtype a)
171{
172 Wtype w = a;
173
174 if (a < 0)
175#ifdef L_negvsi2
219{
220 Wtype w = a;
221
222 if (a < 0)
223#ifdef L_negvsi2
224 w = __negvSI2 (a);
225#else
226 w = -a;
227
228 if (w < 0)
229 abort ();
230#endif
231
232 return w;
233}
234#ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC
235SItype
236__absvsi2 (SItype a)
237{
238 SItype w = a;
239
240 if (a < 0)
241#ifdef L_negvsi2
176 w = __negvsi2 (a);
177#else
178 w = -a;
179
180 if (w < 0)
181 abort ();
182#endif
183
184 return w;
185}
242 w = __negvsi2 (a);
243#else
244 w = -a;
245
246 if (w < 0)
247 abort ();
248#endif
249
250 return w;
251}
252#endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */
186#endif
187
188#ifdef L_absvdi2
189DWtype
253#endif
254
255#ifdef L_absvdi2
256DWtype
190__absvdi2 (DWtype a)
257__absvDI2 (DWtype a)
191{
192 DWtype w = a;
193
194 if (a < 0)
195#ifdef L_negvdi2
258{
259 DWtype w = a;
260
261 if (a < 0)
262#ifdef L_negvdi2
196 w = __negvdi2 (a);
263 w = __negvDI2 (a);
197#else
198 w = -a;
199
200 if (w < 0)
201 abort ();
202#endif
203
204 return w;
205}
206#endif
207
208#ifdef L_mulvdi3
209#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
210DWtype
264#else
265 w = -a;
266
267 if (w < 0)
268 abort ();
269#endif
270
271 return w;
272}
273#endif
274
275#ifdef L_mulvdi3
276#define WORD_SIZE (sizeof (Wtype) * BITS_PER_UNIT)
277DWtype
211__mulvdi3 (DWtype u, DWtype v)
278__mulvDI3 (DWtype u, DWtype v)
212{
213 /* The unchecked multiplication needs 3 Wtype x Wtype multiplications,
214 but the checked multiplication needs only two. */
215 const DWunion uu = {.ll = u};
216 const DWunion vv = {.ll = v};
217
218 if (__builtin_expect (uu.s.high == uu.s.low >> (WORD_SIZE - 1), 1))
219 {

--- 1463 unchanged lines hidden ---
279{
280 /* The unchecked multiplication needs 3 Wtype x Wtype multiplications,
281 but the checked multiplication needs only two. */
282 const DWunion uu = {.ll = u};
283 const DWunion vv = {.ll = v};
284
285 if (__builtin_expect (uu.s.high == uu.s.low >> (WORD_SIZE - 1), 1))
286 {

--- 1463 unchanged lines hidden ---