Changes in boot/genarch/src/division.c [c7afcba7:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/genarch/src/division.c
rc7afcba7 r9d58539 73 73 { 74 74 unsigned long long result; 75 int steps = sizeof(unsigned long long) * 8; 75 int steps = sizeof(unsigned long long) * 8; 76 76 77 77 *remainder = 0; … … 104 104 105 105 /* 32bit integer division */ 106 int __divsi3(int a, int b) 106 int __divsi3(int a, int b) 107 107 { 108 108 unsigned int rem; … … 116 116 117 117 /* 64bit integer division */ 118 long long __divdi3(long long a, long long b) 118 long long __divdi3(long long a, long long b) 119 119 { 120 120 unsigned long long rem; … … 155 155 156 156 /* 64bit remainder of the signed division */ 157 long long __moddi3(long long a, longlong b)157 long long __moddi3(long long a,long long b) 158 158 { 159 159 unsigned long long rem; … … 183 183 } 184 184 185 int __divmodsi3(int a, int b, int *c)186 {187 unsigned int rem;188 int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);189 190 if (SGN(a) == SGN(b)) {191 *c = rem;192 return result;193 }194 195 *c = -rem;196 return -result;197 }198 199 unsigned int __udivmodsi3(unsigned int a, unsigned int b,200 unsigned int *c)201 {202 return divandmod32(a, b, c);203 }204 205 long long __divmoddi3(long long a, long long b, long long *c)206 {207 unsigned long long rem;208 long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);209 210 if (SGN(a) == SGN(b)) {211 *c = rem;212 return result;213 }214 215 *c = -rem;216 return -result;217 }218 219 185 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, 220 186 unsigned long long *c)
Note:
See TracChangeset
for help on using the changeset viewer.