Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/fp-bit.c @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | a06113de4d67 |
children |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
1 /* This is a software floating point library which can be used | 1 /* This is a software floating point library which can be used |
2 for targets without hardware floating point. | 2 for targets without hardware floating point. |
3 Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, | 3 Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, |
4 2004, 2005, 2008, 2009 Free Software Foundation, Inc. | 4 2004, 2005, 2008, 2009, 2010 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
8 GCC is free software; you can redistribute it and/or modify it under | 8 GCC is free software; you can redistribute it and/or modify it under |
9 the terms of the GNU General Public License as published by the Free | 9 the terms of the GNU General Public License as published by the Free |
46 don't include float->double conversion which requires the double library. | 46 don't include float->double conversion which requires the double library. |
47 This is useful only for machines which can't support doubles, e.g. some | 47 This is useful only for machines which can't support doubles, e.g. some |
48 8-bit processors. | 48 8-bit processors. |
49 CMPtype: Specify the type that floating point compares should return. | 49 CMPtype: Specify the type that floating point compares should return. |
50 This defaults to SItype, aka int. | 50 This defaults to SItype, aka int. |
51 US_SOFTWARE_GOFAST: This makes all entry points use the same names as the | |
52 US Software goFast library. | |
53 _DEBUG_BITFLOAT: This makes debugging the code a little easier, by adding | 51 _DEBUG_BITFLOAT: This makes debugging the code a little easier, by adding |
54 two integers to the FLO_union_type. | 52 two integers to the FLO_union_type. |
55 NO_DENORMALS: Disable handling of denormals. | 53 NO_DENORMALS: Disable handling of denormals. |
56 NO_NANS: Disable nan and infinity handling | 54 NO_NANS: Disable nan and infinity handling |
57 SMALL_MACHINE: Useful when operations on QIs and HIs are faster | 55 SMALL_MACHINE: Useful when operations on QIs and HIs are faster |
1177 | 1175 |
1178 return __fpcmp_parts (&a, &b); | 1176 return __fpcmp_parts (&a, &b); |
1179 } | 1177 } |
1180 #endif /* L_compare_sf || L_compare_df */ | 1178 #endif /* L_compare_sf || L_compare_df */ |
1181 | 1179 |
1182 #ifndef US_SOFTWARE_GOFAST | |
1183 | |
1184 /* These should be optimized for their specific tasks someday. */ | 1180 /* These should be optimized for their specific tasks someday. */ |
1185 | 1181 |
1186 #if defined(L_eq_sf) || defined(L_eq_df) || defined(L_eq_tf) | 1182 #if defined(L_eq_sf) || defined(L_eq_df) || defined(L_eq_tf) |
1187 CMPtype | 1183 CMPtype |
1188 _eq_f2 (FLO_type arg_a, FLO_type arg_b) | 1184 _eq_f2 (FLO_type arg_a, FLO_type arg_b) |
1305 return 1; /* false, truth <= 0 */ | 1301 return 1; /* false, truth <= 0 */ |
1306 | 1302 |
1307 return __fpcmp_parts (&a, &b) ; | 1303 return __fpcmp_parts (&a, &b) ; |
1308 } | 1304 } |
1309 #endif /* L_le_sf || L_le_df */ | 1305 #endif /* L_le_sf || L_le_df */ |
1310 | |
1311 #endif /* ! US_SOFTWARE_GOFAST */ | |
1312 | 1306 |
1313 #if defined(L_unord_sf) || defined(L_unord_df) || defined(L_unord_tf) | 1307 #if defined(L_unord_sf) || defined(L_unord_df) || defined(L_unord_tf) |
1314 CMPtype | 1308 CMPtype |
1315 _unord_f2 (FLO_type arg_a, FLO_type arg_b) | 1309 _unord_f2 (FLO_type arg_a, FLO_type arg_b) |
1316 { | 1310 { |
1432 tmp = a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp); | 1426 tmp = a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp); |
1433 return a.sign ? (-tmp) : (tmp); | 1427 return a.sign ? (-tmp) : (tmp); |
1434 } | 1428 } |
1435 #endif /* L_sf_to_si || L_df_to_si */ | 1429 #endif /* L_sf_to_si || L_df_to_si */ |
1436 | 1430 |
1437 #if defined(L_sf_to_usi) || defined(L_df_to_usi) || defined(L_tf_to_usi) | 1431 #if defined(L_tf_to_usi) |
1438 #if defined US_SOFTWARE_GOFAST || defined(L_tf_to_usi) | |
1439 /* While libgcc2.c defines its own __fixunssfsi and __fixunsdfsi routines, | |
1440 we also define them for GOFAST because the ones in libgcc2.c have the | |
1441 wrong names and I'd rather define these here and keep GOFAST CYG-LOC's | |
1442 out of libgcc2.c. We can't define these here if not GOFAST because then | |
1443 there'd be duplicate copies. */ | |
1444 | |
1445 USItype | 1432 USItype |
1446 float_to_usi (FLO_type arg_a) | 1433 float_to_usi (FLO_type arg_a) |
1447 { | 1434 { |
1448 fp_number_type a; | 1435 fp_number_type a; |
1449 FLO_union_type au; | 1436 FLO_union_type au; |
1469 else if (a.normal_exp > (FRACBITS + NGARDS)) | 1456 else if (a.normal_exp > (FRACBITS + NGARDS)) |
1470 return a.fraction.ll << (a.normal_exp - (FRACBITS + NGARDS)); | 1457 return a.fraction.ll << (a.normal_exp - (FRACBITS + NGARDS)); |
1471 else | 1458 else |
1472 return a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp); | 1459 return a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp); |
1473 } | 1460 } |
1474 #endif /* US_SOFTWARE_GOFAST */ | 1461 #endif /* L_tf_to_usi */ |
1475 #endif /* L_sf_to_usi || L_df_to_usi */ | |
1476 | 1462 |
1477 #if defined(L_negate_sf) || defined(L_negate_df) || defined(L_negate_tf) | 1463 #if defined(L_negate_sf) || defined(L_negate_df) || defined(L_negate_tf) |
1478 FLO_type | 1464 FLO_type |
1479 negate (FLO_type arg_a) | 1465 negate (FLO_type arg_a) |
1480 { | 1466 { |