Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/stormy16/stormy16-lib2.c @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
56:3c8a44c06a95 | 63:b7f97abdc517 |
---|---|
2 libgcc2.c. Really libgcc ought to be moved out of the gcc directory | 2 libgcc2.c. Really libgcc ought to be moved out of the gcc directory |
3 and into its own top level directory, and then split up into multiple | 3 and into its own top level directory, and then split up into multiple |
4 files. On this glorious day maybe this code can be integrated into | 4 files. On this glorious day maybe this code can be integrated into |
5 it too. */ | 5 it too. */ |
6 | 6 |
7 /* Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc. | 7 /* Copyright (C) 2005, 2008, 2009, 2010 Free Software Foundation, Inc. |
8 | 8 |
9 This file is part of GCC. | 9 This file is part of GCC. |
10 | 10 |
11 GCC is free software; you can redistribute it and/or modify it under | 11 GCC is free software; you can redistribute it and/or modify it under |
12 the terms of the GNU General Public License as published by the Free | 12 the terms of the GNU General Public License as published by the Free |
307 return 0; | 307 return 0; |
308 | 308 |
309 return 16 - __builtin_clz (u & - u); | 309 return 16 - __builtin_clz (u & - u); |
310 } | 310 } |
311 #endif | 311 #endif |
312 | |
313 #ifdef XSTORMY16_UCMPSI2 | |
314 /* Performs an unsigned comparison of two 32-bit values: A and B. | |
315 If A is less than B, then 0 is returned. If A is greater than B, | |
316 then 2 is returned. Otherwise A and B are equal and 1 is returned. */ | |
317 | |
318 word_type | |
319 __ucmpsi2 (USItype a, USItype b) | |
320 { | |
321 word_type hi_a = (a >> 16); | |
322 word_type hi_b = (b >> 16); | |
323 | |
324 if (hi_a == hi_b) | |
325 { | |
326 word_type low_a = (a & 0xffff); | |
327 word_type low_b = (b & 0xffff); | |
328 | |
329 return low_a < low_b ? 0 : (low_a > low_b ? 2 : 1); | |
330 } | |
331 | |
332 return hi_a < hi_b ? 0 : 2; | |
333 } | |
334 #endif |