/* SPDX-License-Identifier: GPL-2.0 */1.file "shr_Xsig.S"2/*---------------------------------------------------------------------------+3| shr_Xsig.S |4| |5| 12 byte right shift function |6| |7| Copyright (C) 1992,1994,1995 |8| W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |9| Australia. E-mail [email protected] |10| |11| Call from C as: |12| void shr_Xsig(Xsig *arg, unsigned nr) |13| |14| Extended shift right function. |15| Fastest for small shifts. |16| Shifts the 12 byte quantity pointed to by the first arg (arg) |17| right by the number of bits specified by the second arg (nr). |18| |19+---------------------------------------------------------------------------*/2021#include "fpu_emu.h"2223.text24SYM_FUNC_START(shr_Xsig)25push %ebp26movl %esp,%ebp27pushl %esi28movl PARAM2,%ecx29movl PARAM1,%esi30cmpl $32,%ecx /* shrd only works for 0..31 bits */31jnc L_more_than_313233/* less than 32 bits */34pushl %ebx35movl (%esi),%eax /* lsl */36movl 4(%esi),%ebx /* midl */37movl 8(%esi),%edx /* msl */38shrd %cl,%ebx,%eax39shrd %cl,%edx,%ebx40shr %cl,%edx41movl %eax,(%esi)42movl %ebx,4(%esi)43movl %edx,8(%esi)44popl %ebx45popl %esi46leave47RET4849L_more_than_31:50cmpl $64,%ecx51jnc L_more_than_635253subb $32,%cl54movl 4(%esi),%eax /* midl */55movl 8(%esi),%edx /* msl */56shrd %cl,%edx,%eax57shr %cl,%edx58movl %eax,(%esi)59movl %edx,4(%esi)60movl $0,8(%esi)61popl %esi62leave63RET6465L_more_than_63:66cmpl $96,%ecx67jnc L_more_than_956869subb $64,%cl70movl 8(%esi),%eax /* msl */71shr %cl,%eax72xorl %edx,%edx73movl %eax,(%esi)74movl %edx,4(%esi)75movl %edx,8(%esi)76popl %esi77leave78RET7980L_more_than_95:81xorl %eax,%eax82movl %eax,(%esi)83movl %eax,4(%esi)84movl %eax,8(%esi)85popl %esi86leave87RET88SYM_FUNC_END(shr_Xsig)899091