0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 .file "round_Xsig.S"
0021
0022 #include "fpu_emu.h"
0023
0024
0025 .text
0026 SYM_FUNC_START(round_Xsig)
0027 pushl %ebp
0028 movl %esp,%ebp
0029 pushl %ebx
0030 pushl %ebx
0031 pushl %esi
0032
0033 movl PARAM1,%esi
0034
0035 movl 8(%esi),%edx
0036 movl 4(%esi),%ebx
0037 movl (%esi),%eax
0038
0039 movl $0,-4(%ebp)
0040
0041 orl %edx,%edx
0042 js L_round
0043 jnz L_shift_1
0044
0045 movl %ebx,%edx
0046 movl %eax,%ebx
0047 xorl %eax,%eax
0048 movl $-32,-4(%ebp)
0049
0050
0051 L_shift_1:
0052 bsrl %edx,%ecx
0053 subl $31,%ecx
0054 negl %ecx
0055 subl %ecx,-4(%ebp)
0056 shld %cl,%ebx,%edx
0057 shld %cl,%eax,%ebx
0058 shl %cl,%eax
0059
0060 L_round:
0061 testl $0x80000000,%eax
0062 jz L_exit
0063
0064 addl $1,%ebx
0065 adcl $0,%edx
0066 jnz L_exit
0067
0068 movl $0x80000000,%edx
0069 incl -4(%ebp)
0070
0071 L_exit:
0072 movl %edx,8(%esi)
0073 movl %ebx,4(%esi)
0074 movl %eax,(%esi)
0075
0076 movl -4(%ebp),%eax
0077
0078 popl %esi
0079 popl %ebx
0080 leave
0081 RET
0082 SYM_FUNC_END(round_Xsig)
0083
0084
0085
0086 SYM_FUNC_START(norm_Xsig)
0087 pushl %ebp
0088 movl %esp,%ebp
0089 pushl %ebx
0090 pushl %ebx
0091 pushl %esi
0092
0093 movl PARAM1,%esi
0094
0095 movl 8(%esi),%edx
0096 movl 4(%esi),%ebx
0097 movl (%esi),%eax
0098
0099 movl $0,-4(%ebp)
0100
0101 orl %edx,%edx
0102 js L_n_exit
0103 jnz L_n_shift_1
0104
0105 movl %ebx,%edx
0106 movl %eax,%ebx
0107 xorl %eax,%eax
0108 movl $-32,-4(%ebp)
0109
0110 orl %edx,%edx
0111 js L_n_exit
0112 jnz L_n_shift_1
0113
0114 movl %ebx,%edx
0115 movl %eax,%ebx
0116 xorl %eax,%eax
0117 addl $-32,-4(%ebp)
0118 jmp L_n_exit
0119
0120
0121
0122 L_n_shift_1:
0123 bsrl %edx,%ecx
0124 subl $31,%ecx
0125 negl %ecx
0126 subl %ecx,-4(%ebp)
0127 shld %cl,%ebx,%edx
0128 shld %cl,%eax,%ebx
0129 shl %cl,%eax
0130
0131 L_n_exit:
0132 movl %edx,8(%esi)
0133 movl %ebx,4(%esi)
0134 movl %eax,(%esi)
0135
0136 movl -4(%ebp),%eax
0137
0138 popl %esi
0139 popl %ebx
0140 leave
0141 RET
0142 SYM_FUNC_END(norm_Xsig)