Changeset 88d5c1e in mainline for uspace/lib/softint/generic
- Timestamp:
- 2012-04-07T17:55:10Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 41455a22
- Parents:
- 8bcd727
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softint/generic/division.c
r8bcd727 r88d5c1e 188 188 } 189 189 190 int __divmodsi3(int a, int b, int *c) 191 { 192 unsigned int rem; 193 int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem); 194 195 if (SGN(a) == SGN(b)) { 196 *c = rem; 197 return result; 198 } 199 200 *c = -rem; 201 return -result; 202 } 203 190 204 unsigned int __udivmodsi3(unsigned int a, unsigned int b, 191 205 unsigned int *c) … … 194 208 } 195 209 210 long long __divmoddi3(long long a, long long b, long long *c) 211 { 212 unsigned long long rem; 213 long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem); 214 215 if (SGN(a) == SGN(b)) { 216 *c = rem; 217 return result; 218 } 219 220 *c = -rem; 221 return -result; 222 } 223 196 224 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, 197 225 unsigned long long *c)
Note:
See TracChangeset
for help on using the changeset viewer.