.file "shr_Xsig.S"1/*---------------------------------------------------------------------------+2| shr_Xsig.S |3| |4| 12 byte right shift function |5| |6| Copyright (C) 1992,1994,1995 |7| W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |8| Australia. E-mail [email protected] |9| |10| Call from C as: |11| void shr_Xsig(Xsig *arg, unsigned nr) |12| |13| Extended shift right function. |14| Fastest for small shifts. |15| Shifts the 12 byte quantity pointed to by the first arg (arg) |16| right by the number of bits specified by the second arg (nr). |17| |18+---------------------------------------------------------------------------*/1920#include "fpu_emu.h"2122.text23ENTRY(shr_Xsig)24push %ebp25movl %esp,%ebp26pushl %esi27movl PARAM2,%ecx28movl PARAM1,%esi29cmpl $32,%ecx /* shrd only works for 0..31 bits */30jnc L_more_than_313132/* less than 32 bits */33pushl %ebx34movl (%esi),%eax /* lsl */35movl 4(%esi),%ebx /* midl */36movl 8(%esi),%edx /* msl */37shrd %cl,%ebx,%eax38shrd %cl,%edx,%ebx39shr %cl,%edx40movl %eax,(%esi)41movl %ebx,4(%esi)42movl %edx,8(%esi)43popl %ebx44popl %esi45leave46ret4748L_more_than_31:49cmpl $64,%ecx50jnc L_more_than_635152subb $32,%cl53movl 4(%esi),%eax /* midl */54movl 8(%esi),%edx /* msl */55shrd %cl,%edx,%eax56shr %cl,%edx57movl %eax,(%esi)58movl %edx,4(%esi)59movl $0,8(%esi)60popl %esi61leave62ret6364L_more_than_63:65cmpl $96,%ecx66jnc L_more_than_956768subb $64,%cl69movl 8(%esi),%eax /* msl */70shr %cl,%eax71xorl %edx,%edx72movl %eax,(%esi)73movl %edx,4(%esi)74movl %edx,8(%esi)75popl %esi76leave77ret7879L_more_than_95:80xorl %eax,%eax81movl %eax,(%esi)82movl %eax,4(%esi)83movl %eax,8(%esi)84popl %esi85leave86ret878889