Changeset c7afcba7 in mainline for kernel/genarch/src/softint/division.c
- Timestamp:
- 2012-04-07T17:50:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 446ac2a
- Parents:
- 8e893ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/softint/division.c
r8e893ae rc7afcba7 27 27 */ 28 28 29 /** @addtogroup genarch 29 /** @addtogroup genarch 30 30 * @{ 31 31 */ … … 186 186 } 187 187 188 int __divmodsi3(int a, int b, int *c) 189 { 190 unsigned int rem; 191 int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem); 192 193 if (SGN(a) == SGN(b)) { 194 *c = rem; 195 return result; 196 } 197 198 *c = -rem; 199 return -result; 200 } 201 188 202 unsigned int __udivmodsi3(unsigned int a, unsigned int b, 189 203 unsigned int *c) … … 192 206 } 193 207 208 long long __divmoddi3(long long a, long long b, long long *c) 209 { 210 unsigned long long rem; 211 long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem); 212 213 if (SGN(a) == SGN(b)) { 214 *c = rem; 215 return result; 216 } 217 218 *c = -rem; 219 return -result; 220 } 221 194 222 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, 195 223 unsigned long long *c)
Note:
See TracChangeset
for help on using the changeset viewer.