swh:1:snp:77163734605b0ec556b01d897b7bb4a7e30d46b6
Raw File
Tip revision: 64291f7db5bd8150a74ad2036f1037e6a0428df2 authored by Linus Torvalds on 30 August 2015, 18:34:09 UTC
Linux 4.2
Tip revision: 64291f7
ashldi3.c
#include "libgcc.h"

DWtype
__ashldi3(DWtype u, word_type b)
{
	const DWunion uu = {.ll = u};
	const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
	DWunion w;

	if (b == 0)
		return u;

	if (bm <= 0) {
		w.s.low = 0;
		w.s.high = (UWtype) uu.s.low << -bm;
	} else {
		const UWtype carries = (UWtype) uu.s.low >> bm;

		w.s.low = (UWtype) uu.s.low << b;
		w.s.high = ((UWtype) uu.s.high << b) | carries;
	}

	return w.ll;
}
back to top