12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #include "longlong.h"
- long long
- __ashldi3(long long a, unsigned int shift)
- {
- union uu aa;
- if (shift == 0)
- return(a);
- aa.ll = a;
- if (shift >= INT_BITS) {
- aa.ui[H] = aa.ui[L] << (shift - INT_BITS);
- aa.ui[L] = 0;
- } else {
- aa.ui[H] = (aa.ui[H] << shift) |
- (aa.ui[L] >> (INT_BITS - shift));
- aa.ui[L] <<= shift;
- }
- return (aa.ll);
- }
|