Changeset 9b2729c in mainline
- Timestamp:
- 2006-02-07T20:22:17Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8b3eebb
- Parents:
- 47c83bc
- Files:
-
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/Makefile.inc
r47c83bc r9b2729c 54 54 CONFIG_ASID_FIFO = y 55 55 56 57 ## Compile with support for software integer division. 58 # 59 60 CONFIG_SOFTINT = y 61 56 62 ARCH_SOURCES = \ 57 63 arch/$(ARCH)/src/start.S \ -
genarch/Makefile.inc
r47c83bc r9b2729c 56 56 genarch/src/mm/asid_fifo.c 57 57 endif 58 ifeq ($(CONFIG_SOFTINT),y) 59 GENARCH_SOURCES += \ 60 genarch/src/softint/division.c 61 endif -
genarch/include/softint/division.h
r47c83bc r9b2729c 27 27 */ 28 28 29 #ifndef __SOFTINT_ H__30 #define __SOFTINT_ H__29 #ifndef __SOFTINT_DIVISION_H__ 30 #define __SOFTINT_DIVISION_H__ 31 31 32 32 -
genarch/src/softint/division.c
r47c83bc r9b2729c 27 27 */ 28 28 29 #include < softint/softint.h>29 #include <genarch/softint/division.h> 30 30 31 31 #define ABSVAL(x) ( (x) > 0 ? (x) : -(x)) … … 35 35 { 36 36 unsigned int result; 37 int steps = sizeof(unsigned int) ;37 int steps = sizeof(unsigned int) * 8; 38 38 39 39 *remainder = 0; … … 52 52 for ( ; steps > 0; steps--) { 53 53 /* shift one bit to remainder */ 54 *remainder = ( (*remainder) << 1) | (( divident>> 31) & 0x1);54 *remainder = ( (*remainder) << 1) | (( a >> 31) & 0x1); 55 55 result <<= 1; 56 56 … … 59 59 result |= 0x1; 60 60 } 61 divident<<= 1;61 a <<= 1; 62 62 } 63 63 … … 69 69 { 70 70 unsigned long result; 71 int steps = sizeof(unsigned long) ;71 int steps = sizeof(unsigned long) * 8; 72 72 73 73 *remainder = 0; … … 86 86 for ( ; steps > 0; steps--) { 87 87 /* shift one bit to remainder */ 88 *remainder = ( (*remainder) << 1) | (( divident>> 63) & 0x1);88 *remainder = ( (*remainder) << 1) | ((a >> 63) & 0x1); 89 89 result <<= 1; 90 90 … … 93 93 result |= 0x1; 94 94 } 95 divident<<= 1;95 a <<= 1; 96 96 } 97 97 … … 143 143 divandmod32(a, b, &rem); 144 144 145 /* if divident is negative, remainder must be too */145 /* if divident is negative, remainder must be too */ 146 146 if (!(SGN(a))) { 147 147 return -((int)rem); … … 157 157 divandmod64(a, b, &rem); 158 158 159 /* if divident is negative, remainder must be too */159 /* if divident is negative, remainder must be too */ 160 160 if (!(SGN(a))) { 161 161 return -((long)rem);
Note:
See TracChangeset
for help on using the changeset viewer.