/* MN10300 64-bit arithmetic right shift1*2* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public Licence7* as published by the Free Software Foundation; either version8* 2 of the Licence, or (at your option) any later version.9*/10#include <asm/cache.h>1112.text13.balign L1_CACHE_BYTES1415###############################################################################16#17# unsigned long long __ashrdi3(unsigned long long value [D1:D0],18# unsigned by [(12,SP)])19#20###############################################################################21.globl __ashrdi322.type __ashrdi3,@function23__ashrdi3:24mov (12,sp),a025and +63,a026beq __ashrdi3_zero2728cmp +31,a029bhi __ashrdi3_32plus3031# the count is in the range 1-3132lsr a0,d03334mov +32,a135sub a0,a1,a1 # a1 = 32 - count36asl a1,d1,a1 # get underflow from MSW -> LSW3738or_asr a1,d0,a0,d1 # insert underflow into LSW and39# shift the MSW40rets4142.balign L1_CACHE_BYTES43# the count is in the range 32-6344__ashrdi3_32plus:45asr a0,d1,d046ext d0 # sign-extend result through MDR47mov mdr,d148__ashrdi3_zero:49rets5051.size __ashrdi3, .-__ashrdi3525354