1 .file "crypto/bn/asm/x86-gf2m.s" 2 .text 3 .type _mul_1x1_mmx,@function 4 .align 16 5 _mul_1x1_mmx: 6 subl $36,%esp 7 movl %eax,%ecx 8 leal (%eax,%eax,1),%edx 9 andl $1073741823,%ecx 10 leal (%edx,%edx,1),%ebp 11 movl $0,(%esp) 12 andl $2147483647,%edx 13 movd %eax,%mm2 14 movd %ebx,%mm3 15 movl %ecx,4(%esp) 16 xorl %edx,%ecx 17 pxor %mm5,%mm5 18 pxor %mm4,%mm4 19 movl %edx,8(%esp) 20 xorl %ebp,%edx 21 movl %ecx,12(%esp) 22 pcmpgtd %mm2,%mm5 23 paddd %mm2,%mm2 24 xorl %edx,%ecx 25 movl %ebp,16(%esp) 26 xorl %edx,%ebp 27 pand %mm3,%mm5 28 pcmpgtd %mm2,%mm4 29 movl %ecx,20(%esp) 30 xorl %ecx,%ebp 31 psllq $31,%mm5 32 pand %mm3,%mm4 33 movl %edx,24(%esp) 34 movl $7,%esi 35 movl %ebp,28(%esp) 36 movl %esi,%ebp 37 andl %ebx,%esi 38 shrl $3,%ebx 39 movl %ebp,%edi 40 psllq $30,%mm4 41 andl %ebx,%edi 42 shrl $3,%ebx 43 movd (%esp,%esi,4),%mm0 44 movl %ebp,%esi 45 andl %ebx,%esi 46 shrl $3,%ebx 47 movd (%esp,%edi,4),%mm2 48 movl %ebp,%edi 49 psllq $3,%mm2 50 andl %ebx,%edi 51 shrl $3,%ebx 52 pxor %mm2,%mm0 53 movd (%esp,%esi,4),%mm1 54 movl %ebp,%esi 55 psllq $6,%mm1 56 andl %ebx,%esi 57 shrl $3,%ebx 58 pxor %mm1,%mm0 59 movd (%esp,%edi,4),%mm2 60 movl %ebp,%edi 61 psllq $9,%mm2 62 andl %ebx,%edi 63 shrl $3,%ebx 64 pxor %mm2,%mm0 65 movd (%esp,%esi,4),%mm1 66 movl %ebp,%esi 67 psllq $12,%mm1 68 andl %ebx,%esi 69 shrl $3,%ebx 70 pxor %mm1,%mm0 71 movd (%esp,%edi,4),%mm2 72 movl %ebp,%edi 73 psllq $15,%mm2 74 andl %ebx,%edi 75 shrl $3,%ebx 76 pxor %mm2,%mm0 77 movd (%esp,%esi,4),%mm1 78 movl %ebp,%esi 79 psllq $18,%mm1 80 andl %ebx,%esi 81 shrl $3,%ebx 82 pxor %mm1,%mm0 83 movd (%esp,%edi,4),%mm2 84 movl %ebp,%edi 85 psllq $21,%mm2 86 andl %ebx,%edi 87 shrl $3,%ebx 88 pxor %mm2,%mm0 89 movd (%esp,%esi,4),%mm1 90 movl %ebp,%esi 91 psllq $24,%mm1 92 andl %ebx,%esi 93 shrl $3,%ebx 94 pxor %mm1,%mm0 95 movd (%esp,%edi,4),%mm2 96 pxor %mm4,%mm0 97 psllq $27,%mm2 98 pxor %mm2,%mm0 99 movd (%esp,%esi,4),%mm1 100 pxor %mm5,%mm0 101 psllq $30,%mm1 102 addl $36,%esp 103 pxor %mm1,%mm0 104 ret 105 .size _mul_1x1_mmx,.-_mul_1x1_mmx 106 .type _mul_1x1_ialu,@function 107 .align 16 108 _mul_1x1_ialu: 109 subl $36,%esp 110 movl %eax,%ecx 111 leal (%eax,%eax,1),%edx 112 leal (,%eax,4),%ebp 113 andl $1073741823,%ecx 114 leal (%eax,%eax,1),%edi 115 sarl $31,%eax 116 movl $0,(%esp) 117 andl $2147483647,%edx 118 movl %ecx,4(%esp) 119 xorl %edx,%ecx 120 movl %edx,8(%esp) 121 xorl %ebp,%edx 122 movl %ecx,12(%esp) 123 xorl %edx,%ecx 124 movl %ebp,16(%esp) 125 xorl %edx,%ebp 126 movl %ecx,20(%esp) 127 xorl %ecx,%ebp 128 sarl $31,%edi 129 andl %ebx,%eax 130 movl %edx,24(%esp) 131 andl %ebx,%edi 132 movl %ebp,28(%esp) 133 movl %eax,%edx 134 shll $31,%eax 135 movl %edi,%ecx 136 shrl $1,%edx 137 movl $7,%esi 138 shll $30,%edi 139 andl %ebx,%esi 140 shrl $2,%ecx 141 xorl %edi,%eax 142 shrl $3,%ebx 143 movl $7,%edi 144 andl %ebx,%edi 145 shrl $3,%ebx 146 xorl %ecx,%edx 147 xorl (%esp,%esi,4),%eax 148 movl $7,%esi 149 andl %ebx,%esi 150 shrl $3,%ebx 151 movl (%esp,%edi,4),%ebp 152 movl $7,%edi 153 movl %ebp,%ecx 154 shll $3,%ebp 155 andl %ebx,%edi 156 shrl $29,%ecx 157 xorl %ebp,%eax 158 shrl $3,%ebx 159 xorl %ecx,%edx 160 movl (%esp,%esi,4),%ecx 161 movl $7,%esi 162 movl %ecx,%ebp 163 shll $6,%ecx 164 andl %ebx,%esi 165 shrl $26,%ebp 166 xorl %ecx,%eax 167 shrl $3,%ebx 168 xorl %ebp,%edx 169 movl (%esp,%edi,4),%ebp 170 movl $7,%edi 171 movl %ebp,%ecx 172 shll $9,%ebp 173 andl %ebx,%edi 174 shrl $23,%ecx 175 xorl %ebp,%eax 176 shrl $3,%ebx 177 xorl %ecx,%edx 178 movl (%esp,%esi,4),%ecx 179 movl $7,%esi 180 movl %ecx,%ebp 181 shll $12,%ecx 182 andl %ebx,%esi 183 shrl $20,%ebp 184 xorl %ecx,%eax 185 shrl $3,%ebx 186 xorl %ebp,%edx 187 movl (%esp,%edi,4),%ebp 188 movl $7,%edi 189 movl %ebp,%ecx 190 shll $15,%ebp 191 andl %ebx,%edi 192 shrl $17,%ecx 193 xorl %ebp,%eax 194 shrl $3,%ebx 195 xorl %ecx,%edx 196 movl (%esp,%esi,4),%ecx 197 movl $7,%esi 198 movl %ecx,%ebp 199 shll $18,%ecx 200 andl %ebx,%esi 201 shrl $14,%ebp 202 xorl %ecx,%eax 203 shrl $3,%ebx 204 xorl %ebp,%edx 205 movl (%esp,%edi,4),%ebp 206 movl $7,%edi 207 movl %ebp,%ecx 208 shll $21,%ebp 209 andl %ebx,%edi 210 shrl $11,%ecx 211 xorl %ebp,%eax 212 shrl $3,%ebx 213 xorl %ecx,%edx 214 movl (%esp,%esi,4),%ecx 215 movl $7,%esi 216 movl %ecx,%ebp 217 shll $24,%ecx 218 andl %ebx,%esi 219 shrl $8,%ebp 220 xorl %ecx,%eax 221 shrl $3,%ebx 222 xorl %ebp,%edx 223 movl (%esp,%edi,4),%ebp 224 movl %ebp,%ecx 225 shll $27,%ebp 226 movl (%esp,%esi,4),%edi 227 shrl $5,%ecx 228 movl %edi,%esi 229 xorl %ebp,%eax 230 shll $30,%edi 231 xorl %ecx,%edx 232 shrl $2,%esi 233 xorl %edi,%eax 234 xorl %esi,%edx 235 addl $36,%esp 236 ret 237 .size _mul_1x1_ialu,.-_mul_1x1_ialu 238 .globl bn_GF2m_mul_2x2 239 .type bn_GF2m_mul_2x2,@function 240 .align 16 241 bn_GF2m_mul_2x2: 242 .L_bn_GF2m_mul_2x2_begin: 243 call .L000PIC_me_up 244 .L000PIC_me_up: 245 popl %edx 246 leal _GLOBAL_OFFSET_TABLE_+[.-.L000PIC_me_up](%edx),%edx 247 movl OPENSSL_ia32cap_P@GOT(%edx),%edx 248 movl (%edx),%eax 249 movl 4(%edx),%edx 250 testl $8388608,%eax 251 jz .L001ialu 252 testl $16777216,%eax 253 jz .L002mmx 254 testl $2,%edx 255 jz .L002mmx 256 movups 8(%esp),%xmm0 257 shufps $177,%xmm0,%xmm0 258 .byte 102,15,58,68,192,1 259 movl 4(%esp),%eax 260 movups %xmm0,(%eax) 261 ret 262 .align 16 263 .L002mmx: 264 pushl %ebp 265 pushl %ebx 266 pushl %esi 267 pushl %edi 268 movl 24(%esp),%eax 269 movl 32(%esp),%ebx 270 call _mul_1x1_mmx 271 movq %mm0,%mm7 272 movl 28(%esp),%eax 273 movl 36(%esp),%ebx 274 call _mul_1x1_mmx 275 movq %mm0,%mm6 276 movl 24(%esp),%eax 277 movl 32(%esp),%ebx 278 xorl 28(%esp),%eax 279 xorl 36(%esp),%ebx 280 call _mul_1x1_mmx 281 pxor %mm7,%mm0 282 movl 20(%esp),%eax 283 pxor %mm6,%mm0 284 movq %mm0,%mm2 285 psllq $32,%mm0 286 popl %edi 287 psrlq $32,%mm2 288 popl %esi 289 pxor %mm6,%mm0 290 popl %ebx 291 pxor %mm7,%mm2 292 movq %mm0,(%eax) 293 popl %ebp 294 movq %mm2,8(%eax) 295 emms 296 ret 297 .align 16 298 .L001ialu: 299 pushl %ebp 300 pushl %ebx 301 pushl %esi 302 pushl %edi 303 subl $20,%esp 304 movl 44(%esp),%eax 305 movl 52(%esp),%ebx 306 call _mul_1x1_ialu 307 movl %eax,8(%esp) 308 movl %edx,12(%esp) 309 movl 48(%esp),%eax 310 movl 56(%esp),%ebx 311 call _mul_1x1_ialu 312 movl %eax,(%esp) 313 movl %edx,4(%esp) 314 movl 44(%esp),%eax 315 movl 52(%esp),%ebx 316 xorl 48(%esp),%eax 317 xorl 56(%esp),%ebx 318 call _mul_1x1_ialu 319 movl 40(%esp),%ebp 320 movl (%esp),%ebx 321 movl 4(%esp),%ecx 322 movl 8(%esp),%edi 323 movl 12(%esp),%esi 324 xorl %edx,%eax 325 xorl %ecx,%edx 326 xorl %ebx,%eax 327 movl %ebx,(%ebp) 328 xorl %edi,%edx 329 movl %esi,12(%ebp) 330 xorl %esi,%eax 331 addl $20,%esp 332 xorl %esi,%edx 333 popl %edi 334 xorl %edx,%eax 335 popl %esi 336 movl %edx,8(%ebp) 337 popl %ebx 338 movl %eax,4(%ebp) 339 popl %ebp 340 ret 341 .size bn_GF2m_mul_2x2,.-.L_bn_GF2m_mul_2x2_begin 342 .byte 71,70,40,50,94,109,41,32,77,117,108,116,105,112,108,105 343 .byte 99,97,116,105,111,110,32,102,111,114,32,120,56,54,44,32 344 .byte 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97 345 .byte 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 346 .byte 62,0 347 .comm OPENSSL_ia32cap_P,8,4 348