/*1* Copyright 2004-2009 Analog Devices Inc.2*3* Licensed under the GPL-2 or later.4*/56#include "gcclib.h"78#ifdef CONFIG_ARITHMETIC_OPS_L19DItype __lshrdi3(DItype u, word_type b)__attribute__((l1_text));10#endif1112DItype __lshrdi3(DItype u, word_type b)13{14DIunion w;15word_type bm;16DIunion uu;1718if (b == 0)19return u;2021uu.ll = u;2223bm = (sizeof(SItype) * BITS_PER_UNIT) - b;24if (bm <= 0) {25w.s.high = 0;26w.s.low = (USItype) uu.s.high >> -bm;27} else {28USItype carries = (USItype) uu.s.high << bm;29w.s.high = (USItype) uu.s.high >> b;30w.s.low = ((USItype) uu.s.low >> b) | carries;31}3233return w.ll;34}353637