Changeset 8348846 in mainline
- Timestamp:
- 2018-01-15T22:39:24Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2013ea9, aec41c8
- Parents:
- dbbbe75b
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 21:54:21)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 22:39:24)
- Location:
- uspace/lib/softint
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softint/generic/comparison.c
rdbbbe75b r8348846 34 34 */ 35 35 36 #include <alias.h> 36 37 #include <comparison.h> 37 38 #include <lltype.h> … … 41 42 #define GREATER 2; 42 43 43 int __cmp di2 (long long a, long long b)44 int __cmpti2 (long long a, long long b) 44 45 { 45 46 union lltype lla; … … 64 65 } 65 66 66 int __ucmp di2 (unsigned long long a, unsigned long long b)67 int __ucmpti2 (unsigned long long a, unsigned long long b) 67 68 { 68 69 union lltype lla; … … 87 88 } 88 89 90 #if LONG_MAX == LLONG_MAX 91 int ALIAS(__cmp, i2); 92 int ALIAS(__ucmp, i2); 93 #endif 94 89 95 /** @} 90 96 */ -
uspace/lib/softint/generic/division.c
rdbbbe75b r8348846 35 35 */ 36 36 37 #include <alias.h> 37 38 #include <division.h> 38 39 … … 121 122 122 123 /* 64bit integer division */ 123 long long __div di3(long long a, long long b)124 long long __divti3(long long a, long long b) 124 125 { 125 126 unsigned long long rem; … … 140 141 141 142 /* 64bit unsigned integer division */ 142 unsigned long long __udiv di3(unsigned long long a, unsigned long long b)143 unsigned long long __udivti3(unsigned long long a, unsigned long long b) 143 144 { 144 145 unsigned long long rem; … … 160 161 161 162 /* 64bit remainder of the signed division */ 162 long long __mod di3(long long a, long long b)163 long long __modti3(long long a, long long b) 163 164 { 164 165 unsigned long long rem; … … 181 182 182 183 /* 64bit remainder of the unsigned division */ 183 unsigned long long __umod di3(unsigned long long a, unsigned long long b)184 unsigned long long __umodti3(unsigned long long a, unsigned long long b) 184 185 { 185 186 unsigned long long rem; … … 202 203 } 203 204 205 int __divmodsi4(int a, int b, int *c) 206 { 207 return __divmodsi3(a, b, c); 208 } 209 204 210 unsigned int __udivmodsi3(unsigned int a, unsigned int b, 205 211 unsigned int *c) … … 208 214 } 209 215 210 long long __divmoddi3(long long a, long long b, long long *c) 216 unsigned int __udivmodsi4(unsigned int a, unsigned int b, 217 unsigned int *c) 218 { 219 return divandmod32(a, b, c); 220 } 221 222 long long __divmodti3(long long a, long long b, long long *c) 211 223 { 212 224 unsigned long long rem; … … 222 234 } 223 235 224 long long __divmoddi4(long long a, long long b, long long *c) 236 237 long long __divmodti4(long long a, long long b, long long *c) 225 238 { 226 239 unsigned long long rem; … … 236 249 } 237 250 238 unsigned long long __udivmod di3(unsigned long long a, unsigned long long b,251 unsigned long long __udivmodti3(unsigned long long a, unsigned long long b, 239 252 unsigned long long *c) 240 253 { … … 242 255 } 243 256 244 unsigned long long __udivmod di4(unsigned long long a, unsigned long long b,257 unsigned long long __udivmodti4(unsigned long long a, unsigned long long b, 245 258 unsigned long long *c) 246 259 { 247 260 return divandmod64(a, b, c); 248 261 } 262 263 long ALIAS(__div, i3); 264 long ALIAS(__mod, i3); 265 long ALIAS(__divmod, i3); 266 long ALIAS(__divmod, i4); 267 unsigned long ALIAS(__udiv, i3); 268 unsigned long ALIAS(__umod, i3); 269 unsigned long ALIAS(__udivmod, i3); 270 unsigned long ALIAS(__udivmod, i4); 249 271 250 272 /** @} -
uspace/lib/softint/generic/multiplication.c
rdbbbe75b r8348846 35 35 */ 36 36 37 #include <alias.h> 37 38 #include <multiplication.h> 38 39 #include <stdint.h> … … 67 68 * 68 69 */ 69 long long __mul di3 (long long a, long long b)70 long long __multi3 (long long a, long long b) 70 71 { 71 72 char neg = 0; … … 120 121 } 121 122 123 #if LONG_MAX == LLONG_MAX 124 long ALIAS(__mul, i3); 125 #endif 126 122 127 /** @} 123 128 */ -
uspace/lib/softint/generic/shift.c
rdbbbe75b r8348846 34 34 */ 35 35 36 #include <alias.h> 36 37 #include <shift.h> 37 38 #include <lltype.h> 38 39 39 long long __ashl di3 (long long val, int shift)40 long long __ashlti3 (long long val, int shift) 40 41 { 41 42 union lltype ll; … … 65 66 } 66 67 67 long long __ashr di3 (long long val, int shift)68 long long __ashrti3 (long long val, int shift) 68 69 { 69 70 union lltype ll; … … 95 96 } 96 97 97 long long __lshr di3 (long long val, int shift)98 long long __lshrti3 (long long val, int shift) 98 99 { 99 100 union lltype ll; … … 133 134 } 134 135 136 #if LONG_MAX == LLONG_MAX 137 long ALIAS(__ashl, i3); 138 long ALIAS(__ashr, i3); 139 long ALIAS(__lshr, i3); 140 #endif 141 135 142 /** @} 136 143 */ -
uspace/lib/softint/include/comparison.h
rdbbbe75b r8348846 38 38 39 39 /* Signed comparison (a < b => 0, a == b => 1, a > b => 2). */ 40 extern int __cmpdi2(long long, long long); 40 extern int __cmpdi2(long, long); 41 extern int __cmpti2(long long, long long); 41 42 42 43 /* Unsigned comparison (a < b => 0, a == b => 1, a > b => 2). */ 43 extern int __ucmpdi2(unsigned long long, unsigned long long); 44 extern int __ucmpdi2(unsigned long, unsigned long); 45 extern int __ucmpti2(unsigned long long, unsigned long long); 44 46 45 47 #endif -
uspace/lib/softint/include/division.h
rdbbbe75b r8348846 38 38 39 39 extern int __divsi3(int, int); 40 extern long long __divdi3(long long, long long); 40 extern long __divdi3(long, long); 41 extern long long __divti3(long long, long long); 41 42 42 43 extern unsigned int __udivsi3(unsigned int, unsigned int); 43 extern unsigned long long __udivdi3(unsigned long long, unsigned long long); 44 extern unsigned long __udivdi3(unsigned long, unsigned long); 45 extern unsigned long long __udivti3(unsigned long long, unsigned long long); 44 46 45 47 extern int __modsi3(int, int); 46 extern long long __moddi3(long long, long long); 48 extern long __moddi3(long, long); 49 extern long long __modti3(long long, long long); 47 50 48 51 extern unsigned int __umodsi3(unsigned int, unsigned int); 49 extern unsigned long long __umoddi3(unsigned long long, unsigned long long); 52 extern unsigned long __umoddi3(unsigned long, unsigned long); 53 extern unsigned long long __umodti3(unsigned long long, unsigned long long); 50 54 51 55 extern int __divmodsi3(int, int, int *); 56 extern long __divmoddi3(long, long, long *); 57 extern long long __divmodti3(long long, long long, long long *); 58 52 59 extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *); 60 extern unsigned long __udivmoddi3(unsigned long, unsigned long, 61 unsigned long *); 62 extern unsigned long long __udivmodti3(unsigned long long, unsigned long long, 63 unsigned long long *); 53 64 54 extern long long __divmoddi3(long long, long long, long long *); 55 extern long long __divmoddi4(long long, long long, long long *); 56 extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long, 57 unsigned long long *); 58 extern unsigned long long __udivmoddi4(unsigned long long, unsigned long long, 65 extern int __divmodsi4(int, int, int *); 66 extern long __divmoddi4(long, long, long *); 67 extern long long __divmodti4(long long, long long, long long *); 68 69 extern unsigned int __udivmodsi4(unsigned int, unsigned int, unsigned int *); 70 extern unsigned long __udivmoddi4(unsigned long, unsigned long, 71 unsigned long *); 72 extern unsigned long long __udivmodti4(unsigned long long, unsigned long long, 59 73 unsigned long long *); 60 74 -
uspace/lib/softint/include/multiplication.h
rdbbbe75b r8348846 38 38 39 39 /* 64 bit multiplication */ 40 extern long long __muldi3(long long, long long); 40 extern long __muldi3(long, long); 41 extern long long __multi3(long long, long long); 41 42 42 43 #endif -
uspace/lib/softint/include/shift.h
rdbbbe75b r8348846 38 38 39 39 /* Arithmetic/logical shift left. */ 40 extern long long __ashldi3(long long, int); 40 extern long __ashldi3(long, int); 41 extern long long __ashlti3(long long, int); 41 42 42 43 /* Arithmetic shift right. */ 43 extern long long __ashrdi3(long long, int); 44 extern long __ashrdi3(long, int); 45 extern long long __ashrti3(long long, int); 44 46 45 47 /* Logical shift right. */ 46 extern long long __lshrdi3(long long, int); 48 extern long __lshrdi3(long, int); 49 extern long long __lshrti3(long long, int); 47 50 48 51
Note:
See TracChangeset
for help on using the changeset viewer.