/*- * Copyright (c) 1992 The Regents of the University of California. * All rights reserved. * * This software was developed by the Computer Systems Engineering group * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and * contributed to Berkeley. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)lshldi3.c 5.7 (Berkeley) 06/25/92"; #endif /* LIBC_SCCS and not lint */ #include "quad.h" /* * Shift an (unsigned) quad value left (logical shift left). * This is the same as arithmetic shift left! */ quad_t __lshldi3(a, shift) quad_t a; qshift_t shift; { union uu aa; aa.q = a; if (shift >= LONG_BITS) { aa.ul[H] = shift >= QUAD_BITS ? 0 : aa.ul[L] << (shift - LONG_BITS); aa.ul[L] = 0; } else if (shift > 0) { aa.ul[H] = (aa.ul[H] << shift) | (aa.ul[L] >> (LONG_BITS - shift)); aa.ul[L] <<= shift; } return (aa.q); }