1*6cb10275Sriastradh/* $NetBSD: ashrdi3.S,v 1.8 2014/03/18 18:20:37 riastradh Exp $ */ 2ff3bd4dfSjtc 3ff3bd4dfSjtc/*- 4ff3bd4dfSjtc * Copyright (c) 1996 The NetBSD Foundation, Inc. 5ff3bd4dfSjtc * All rights reserved. 6ff3bd4dfSjtc * 7ff3bd4dfSjtc * This code is derived from software contributed to The NetBSD Foundation 8ff3bd4dfSjtc * by J.T. Conklin. 9ff3bd4dfSjtc * 10ff3bd4dfSjtc * Redistribution and use in source and binary forms, with or without 11ff3bd4dfSjtc * modification, are permitted provided that the following conditions 12ff3bd4dfSjtc * are met: 13ff3bd4dfSjtc * 1. Redistributions of source code must retain the above copyright 14ff3bd4dfSjtc * notice, this list of conditions and the following disclaimer. 15ff3bd4dfSjtc * 2. Redistributions in binary form must reproduce the above copyright 16ff3bd4dfSjtc * notice, this list of conditions and the following disclaimer in the 17ff3bd4dfSjtc * documentation and/or other materials provided with the distribution. 18ff3bd4dfSjtc * 19ff3bd4dfSjtc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20ff3bd4dfSjtc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21ff3bd4dfSjtc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 229f3b240eSjtc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 239f3b240eSjtc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24ff3bd4dfSjtc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25ff3bd4dfSjtc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26ff3bd4dfSjtc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27ff3bd4dfSjtc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28ff3bd4dfSjtc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29ff3bd4dfSjtc * POSSIBILITY OF SUCH DAMAGE. 30ff3bd4dfSjtc */ 31ff3bd4dfSjtc 32ff3bd4dfSjtc#include <machine/asm.h> 33ff3bd4dfSjtc 34ff3bd4dfSjtc| d0 msw 35ff3bd4dfSjtc| d1 lsw 36ff3bd4dfSjtc| d2 shift 37ff3bd4dfSjtc| d3 offset (32 - shift) 38ff3bd4dfSjtc 39ff3bd4dfSjtcENTRY(__ashrdi3) 40434ca5fbSmatt link %fp,#-12 41434ca5fbSmatt moveml %d2-%d4,(%sp) 4207a0a325Smatt movel 8(%fp),%d0 4307a0a325Smatt movel 12(%fp),%d1 4407a0a325Smatt movel 16(%fp),%d2 453b435a73Sthorpej moveq #32,%d3 463b435a73Sthorpej subl %d2,%d3 47ff3bd4dfSjtc jgt L2 483b435a73Sthorpej negl %d3 493b435a73Sthorpej movel %d0,%d1 503b435a73Sthorpej asrl %d3,%d1 513b435a73Sthorpej smi %d0 523b435a73Sthorpej extbl %d0 53ff3bd4dfSjtc jra L3 543b435a73SthorpejL2: lsrl %d2,%d1 553b435a73Sthorpej movel %d0,%d4 563b435a73Sthorpej asll %d3,%d4 573b435a73Sthorpej orl %d4,%d1 583b435a73Sthorpej asrl %d2,%d0 5907a0a325SmattL3: moveml -12(%fp),%d2-%d4 6007a0a325Smatt unlk %fp 61ff3bd4dfSjtc rts 62dd123293SmattEND(__ashrdi3) 63