X86_32_PICASM improvements
Showing the changes to codec/decoder (1 of 18 files). Show all
Unified · Split
| @@ -49,7 +49,11 @@ · 48 unmodified lines | ||
| 49 | 49 | ; Local Data (Read Only) |
| 50 | 50 | ;******************************************************************************* |
| 51 | 51 | |
| 52 | +%ifdef X86_32_PICASM | |
| 53 | +SECTION .text align=16 | |
| 54 | +%else | |
| 52 | 55 | SECTION .rodata align=16 |
| 56 | +%endif | |
| 53 | 57 | |
| 54 | 58 | align 16 |
| 55 | 59 | sse2_plane_inc_minus dw -7, -6, -5, -4, -3, -2, -1, 0 |
| @@ -132,40 +136,14 @@ sse2_wd_0x02: times 8 dw 0x02 · 76 unmodified lines | ||
| 132 | 136 | %macro COPY_16_TIMES 2 |
| 133 | 137 | movdqa %2, [%1-16] |
| 134 | 138 | psrldq %2, 15 |
| 135 | −%ifdef X86_32_PICASM | |
| 136 | − push r5 | |
| 137 | − mov r5, esp | |
| 138 | − and esp, 0xfffffff0 | |
| 139 | − push 0x01010101 ;mmx_01bytes | |
| 140 | − push 0x01010101 | |
| 141 | − push 0x01010101 | |
| 142 | − push 0x01010101 | |
| 143 | − pmuludq %2, [esp] | |
| 144 | − mov esp, r5 | |
| 145 | − pop r5 | |
| 146 | −%else | |
| 147 | − pmuludq %2, [mmx_01bytes] | |
| 148 | −%endif | |
| 139 | + pmuludq %2, [pic(mmx_01bytes)] | |
| 149 | 140 | pshufd %2, %2, 0 |
| 150 | 141 | %endmacro |
| 151 | 142 | |
| 152 | 143 | %macro COPY_16_TIMESS 3 |
| 153 | 144 | movdqa %2, [%1+%3-16] |
| 154 | 145 | psrldq %2, 15 |
| 155 | −%ifdef X86_32_PICASM | |
| 156 | − push r5 | |
| 157 | − mov r5, esp | |
| 158 | − and esp, 0xfffffff0 | |
| 159 | − push 0x01010101 ;mmx_01bytes | |
| 160 | − push 0x01010101 | |
| 161 | − push 0x01010101 | |
| 162 | − push 0x01010101 | |
| 163 | − pmuludq %2, [esp] | |
| 164 | − mov esp, r5 | |
| 165 | − pop r5 | |
| 166 | −%else | |
| 167 | − pmuludq %2, [mmx_01bytes] | |
| 168 | −%endif | |
| 146 | + pmuludq %2, [pic(mmx_01bytes)] | |
| 169 | 147 | pshufd %2, %2, 0 |
| 170 | 148 | %endmacro |
| 171 | 149 | |
| @@ -203,52 +181,26 @@ SECTION .text · 31 unmodified lines | ||
| 203 | 181 | ;******************************************************************************* |
| 204 | 182 | WELS_EXTERN WelsDecoderI4x4LumaPredH_sse2 |
| 205 | 183 | %assign push_num 0 |
| 184 | + INIT_X86_32_PIC r3 | |
| 206 | 185 | LOAD_2_PARA |
| 207 | 186 | SIGN_EXTENSION r1, r1d |
| 208 | −%ifdef X86_32_PICASM | |
| 209 | − push r3 | |
| 210 | − mov r3, esp | |
| 211 | − and esp, 0xfffffff0 | |
| 212 | − push 0x01010101 ;mmx_01bytes | |
| 213 | − push 0x01010101 | |
| 214 | − push 0x01010101 | |
| 215 | − push 0x01010101 | |
| 216 | −%endif | |
| 217 | 187 | |
| 218 | 188 | movzx r2, byte [r0-1] |
| 219 | 189 | movd xmm0, r2d |
| 220 | −%ifdef X86_32_PICASM | |
| 221 | − pmuludq xmm0, [esp] | |
| 222 | −%else | |
| 223 | − pmuludq xmm0, [mmx_01bytes] | |
| 224 | −%endif | |
| 190 | + pmuludq xmm0, [pic(mmx_01bytes)] | |
| 225 | 191 | |
| 226 | 192 | movzx r2, byte [r0+r1-1] |
| 227 | 193 | movd xmm1, r2d |
| 228 | −%ifdef X86_32_PICASM | |
| 229 | − pmuludq xmm1, [esp] | |
| 230 | −%else | |
| 231 | − pmuludq xmm1, [mmx_01bytes] | |
| 232 | −%endif | |
| 194 | + pmuludq xmm1, [pic(mmx_01bytes)] | |
| 233 | 195 | |
| 234 | 196 | lea r0, [r0+r1] |
| 235 | 197 | movzx r2, byte [r0+r1-1] |
| 236 | 198 | movd xmm2, r2d |
| 237 | −%ifdef X86_32_PICASM | |
| 238 | − pmuludq xmm2, [esp] | |
| 239 | −%else | |
| 240 | − pmuludq xmm2, [mmx_01bytes] | |
| 241 | −%endif | |
| 199 | + pmuludq xmm2, [pic(mmx_01bytes)] | |
| 242 | 200 | |
| 243 | 201 | movzx r2, byte [r0+2*r1-1] |
| 244 | 202 | movd xmm3, r2d |
| 245 | −%ifdef X86_32_PICASM | |
| 246 | − pmuludq xmm3, [esp] | |
| 247 | − mov esp, r3 | |
| 248 | − pop r3 | |
| 249 | −%else | |
| 250 | − pmuludq xmm3, [mmx_01bytes] | |
| 251 | −%endif | |
| 203 | + pmuludq xmm3, [pic(mmx_01bytes)] | |
| 252 | 204 | |
| 253 | 205 | sub r0, r1 |
| 254 | 206 | movd [r0], xmm0 |
| @@ -257,6 +209,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredH_sse2 · 2 unmodified lines | ||
| 257 | 209 | movd [r0], xmm2 |
| 258 | 210 | movd [r0+r1], xmm3 |
| 259 | 211 | |
| 212 | + DEINIT_X86_32_PIC | |
| 260 | 213 | ret |
| 261 | 214 | |
| 262 | 215 | ;******************************************************************************* |
| @@ -266,6 +219,7 @@ WELS_EXTERN WelsDecoderI16x16LumaPredPlane_sse2 · 3 unmodified lines | ||
| 266 | 219 | push r3 |
| 267 | 220 | push r4 |
| 268 | 221 | %assign push_num 2 |
| 222 | + INIT_X86_32_PIC r5 | |
| 269 | 223 | LOAD_2_PARA |
| 270 | 224 | PUSH_XMM 8 |
| 271 | 225 | SIGN_EXTENSION r1, r1d |
| @@ -276,37 +230,11 @@ WELS_EXTERN WelsDecoderI16x16LumaPredPlane_sse2 · 4 unmodified lines | ||
| 276 | 230 | ;for H |
| 277 | 231 | pxor xmm7, xmm7 |
| 278 | 232 | movq xmm0, [r0] |
| 279 | −%ifdef X86_32_PICASM | |
| 280 | − push r0 | |
| 281 | − mov r0, esp | |
| 282 | − and esp, 0xfffffff0 | |
| 283 | − push 0x00010002 | |
| 284 | − push 0x00030004 | |
| 285 | − push 0x00050006 | |
| 286 | − push 0x00070008 | |
| 287 | − movdqa xmm5, [esp] | |
| 288 | − mov esp, r0 | |
| 289 | − pop r0 | |
| 290 | −%else | |
| 291 | − movdqa xmm5, [sse2_plane_dec] | |
| 292 | −%endif | |
| 233 | + movdqa xmm5, [pic(sse2_plane_dec)] | |
| 293 | 234 | punpcklbw xmm0, xmm7 |
| 294 | 235 | pmullw xmm0, xmm5 |
| 295 | 236 | movq xmm1, [r0 + 9] |
| 296 | −%ifdef X86_32_PICASM | |
| 297 | − push r0 | |
| 298 | − mov r0, esp | |
| 299 | − and esp, 0xfffffff0 | |
| 300 | − push 0x00080007 ;sse2_plane_inc | |
| 301 | − push 0x00060005 | |
| 302 | − push 0x00040003 | |
| 303 | − push 0x00020001 | |
| 304 | − movdqa xmm6, [esp] | |
| 305 | − mov esp, r0 | |
| 306 | − pop r0 | |
| 307 | −%else | |
| 308 | − movdqa xmm6, [sse2_plane_inc] | |
| 309 | −%endif | |
| 237 | + movdqa xmm6, [pic(sse2_plane_inc)] | |
| 310 | 238 | punpcklbw xmm1, xmm7 |
| 311 | 239 | pmullw xmm1, xmm6 |
| 312 | 240 | psubw xmm1, xmm0 |
| @@ -361,19 +289,7 @@ WELS_EXTERN WelsDecoderI16x16LumaPredPlane_sse2 · 48 unmodified lines | ||
| 361 | 289 | SSE2_Copy8Times xmm0, r3d ; xmm0 = s,s,s,s,s,s,s,s |
| 362 | 290 | |
| 363 | 291 | xor r2, r2 |
| 364 | −%ifdef X86_32_PICASM | |
| 365 | − mov r2, esp | |
| 366 | − and esp, 0xfffffff0 | |
| 367 | − push 0x0000ffff ;sse2_plane_inc_minus | |
| 368 | − push 0xfffefffd | |
| 369 | − push 0xfffcfffb | |
| 370 | − push 0xfffafff9 | |
| 371 | − movdqa xmm5, [esp] | |
| 372 | − mov esp, r2 | |
| 373 | − xor r2, r2 | |
| 374 | −%else | |
| 375 | − movdqa xmm5, [sse2_plane_inc_minus] | |
| 376 | −%endif | |
| 292 | + movdqa xmm5, [pic(sse2_plane_inc_minus)] | |
| 377 | 293 | |
| 378 | 294 | get_i16x16_luma_pred_plane_sse2_1: |
| 379 | 295 | movdqa xmm2, xmm1 |
| @@ -393,6 +309,7 @@ get_i16x16_luma_pred_plane_sse2_1: · 13 unmodified lines | ||
| 393 | 309 | jnz get_i16x16_luma_pred_plane_sse2_1 |
| 394 | 310 | |
| 395 | 311 | POP_XMM |
| 312 | + DEINIT_X86_32_PIC | |
| 396 | 313 | pop r4 |
| 397 | 314 | pop r3 |
| 398 | 315 | ret |
| @@ -414,6 +331,7 @@ get_i16x16_luma_pred_plane_sse2_1: · 15 unmodified lines | ||
| 414 | 331 | |
| 415 | 332 | WELS_EXTERN WelsDecoderI16x16LumaPredH_sse2 |
| 416 | 333 | %assign push_num 0 |
| 334 | + INIT_X86_32_PIC_NOPRESERVE r2 | |
| 417 | 335 | LOAD_2_PARA |
| 418 | 336 | SIGN_EXTENSION r1, r1d |
| 419 | 337 | |
| @@ -430,6 +348,7 @@ WELS_EXTERN WelsDecoderI16x16LumaPredH_sse2 · 10 unmodified lines | ||
| 430 | 348 | SSE2_PRED_H_16X16_TWO_LINE_DEC r0, r1 |
| 431 | 349 | SSE2_PRED_H_16X16_TWO_LINE_DEC r0, r1 |
| 432 | 350 | |
| 351 | + DEINIT_X86_32_PIC | |
| 433 | 352 | ret |
| 434 | 353 | |
| 435 | 354 | ;******************************************************************************* |
| @@ -477,6 +396,7 @@ WELS_EXTERN WelsDecoderIChromaPredPlane_sse2 · 41 unmodified lines | ||
| 477 | 396 | push r3 |
| 478 | 397 | push r4 |
| 479 | 398 | %assign push_num 2 |
| 399 | + INIT_X86_32_PIC r5 | |
| 480 | 400 | LOAD_2_PARA |
| 481 | 401 | PUSH_XMM 8 |
| 482 | 402 | SIGN_EXTENSION r1, r1d |
| @@ -486,30 +406,11 @@ WELS_EXTERN WelsDecoderIChromaPredPlane_sse2 · 3 unmodified lines | ||
| 486 | 406 | |
| 487 | 407 | pxor mm7, mm7 |
| 488 | 408 | movq mm0, [r0] |
| 489 | −%ifdef X86_32_PICASM | |
| 490 | − push r5 | |
| 491 | − mov r5, esp | |
| 492 | − and esp, 0xfffffff0 | |
| 493 | − push 0x00010002 ;sse2_plane_dec_c | |
| 494 | − push 0x00030004 | |
| 495 | − push 0x00040003 ;sse2_plane_inc_c | |
| 496 | − push 0x00020001 | |
| 497 | − push 0x00040003 ; | |
| 498 | − push 0x00020001 | |
| 499 | − push 0x0000ffff | |
| 500 | − push 0xfffefffd | |
| 501 | − movq mm5, [esp+24] | |
| 502 | −%else | |
| 503 | − movq mm5, [sse2_plane_dec_c] | |
| 504 | −%endif | |
| 409 | + movq mm5, [pic(sse2_plane_dec_c)] | |
| 505 | 410 | punpcklbw mm0, mm7 |
| 506 | 411 | pmullw mm0, mm5 |
| 507 | 412 | movq mm1, [r0 + 5] |
| 508 | −%ifdef X86_32_PICASM | |
| 509 | − movq mm6, [esp+16] | |
| 510 | −%else | |
| 511 | − movq mm6, [sse2_plane_inc_c] | |
| 512 | −%endif | |
| 413 | + movq mm6, [pic(sse2_plane_inc_c)] | |
| 513 | 414 | punpcklbw mm1, mm7 |
| 514 | 415 | pmullw mm1, mm6 |
| 515 | 416 | psubw mm1, mm0 |
| @@ -561,13 +462,7 @@ WELS_EXTERN WelsDecoderIChromaPredPlane_sse2 · 45 unmodified lines | ||
| 561 | 462 | SSE2_Copy8Times xmm0, r3d ; xmm0 = s,s,s,s,s,s,s,s |
| 562 | 463 | |
| 563 | 464 | xor r2, r2 |
| 564 | −%ifdef X86_32_PICASM | |
| 565 | − movdqa xmm5, [esp] | |
| 566 | − mov esp, r5 | |
| 567 | − pop r5 | |
| 568 | −%else | |
| 569 | − movdqa xmm5, [sse2_plane_mul_b_c] | |
| 570 | −%endif | |
| 465 | + movdqa xmm5, [pic(sse2_plane_mul_b_c)] | |
| 571 | 466 | |
| 572 | 467 | get_i_chroma_pred_plane_sse2_1: |
| 573 | 468 | movdqa xmm2, xmm1 |
| @@ -583,6 +478,7 @@ get_i_chroma_pred_plane_sse2_1: · 9 unmodified lines | ||
| 583 | 478 | jnz get_i_chroma_pred_plane_sse2_1 |
| 584 | 479 | |
| 585 | 480 | POP_XMM |
| 481 | + DEINIT_X86_32_PIC | |
| 586 | 482 | pop r4 |
| 587 | 483 | pop r3 |
| 588 | 484 | WELSEMMS |
| @@ -602,6 +498,7 @@ get_i_chroma_pred_plane_sse2_1: · 13 unmodified lines | ||
| 602 | 498 | ;******************************************************************************* |
| 603 | 499 | WELS_EXTERN WelsDecoderI4x4LumaPredDDR_mmx |
| 604 | 500 | %assign push_num 0 |
| 501 | + INIT_X86_32_PIC r3 | |
| 605 | 502 | LOAD_2_PARA |
| 606 | 503 | SIGN_EXTENSION r1, r1d |
| 607 | 504 | mov r2, r0 |
| @@ -629,20 +526,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredDDR_mmx · 21 unmodified lines | ||
| 629 | 526 | movq mm4,mm3 ;mm4[8]=[3],mm4[7]=[2],mm4[6]=[1],mm4[5]=[0],mm4[4]=[6],mm4[3]=[11],mm4[2]=[16],mm4[1]=[21] |
| 630 | 527 | pavgb mm3,mm1 ;mm3=([11]+[21]+1)/2 |
| 631 | 528 | pxor mm1,mm4 ;find odd value in the lowest bit of each byte |
| 632 | −%ifdef X86_32_PICASM | |
| 633 | − push r0 | |
| 634 | − mov r0, esp | |
| 635 | − and esp, 0xfffffff0 | |
| 636 | − push 0x01010101 | |
| 637 | − push 0x01010101 | |
| 638 | − push 0x01010101 | |
| 639 | − push 0x01010101 | |
| 640 | − pand mm1,[esp] ;set the odd bit | |
| 641 | − mov esp, r0 | |
| 642 | − pop r0 | |
| 643 | −%else | |
| 644 | − pand mm1,[mmx_01bytes] ;set the odd bit | |
| 645 | −%endif | |
| 529 | + pand mm1,[pic(mmx_01bytes)] ;set the odd bit | |
| 646 | 530 | psubusb mm3,mm1 ;decrease 1 from odd bytes |
| 647 | 531 | pavgb mm2,mm3 ;mm2=(([11]+[21]+1)/2+1+[16])/2 |
| 648 | 532 | |
| @@ -655,6 +539,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredDDR_mmx · 6 unmodified lines | ||
| 655 | 539 | movd [r0+r1],mm2 |
| 656 | 540 | psrlq mm2,8 |
| 657 | 541 | movd [r0],mm2 |
| 542 | + DEINIT_X86_32_PIC | |
| 658 | 543 | WELSEMMS |
| 659 | 544 | ret |
| 660 | 545 | |
| @@ -667,20 +552,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredDDR_mmx · 6 unmodified lines | ||
| 667 | 552 | movq %1, [%3-8] |
| 668 | 553 | psrlq %1, 38h |
| 669 | 554 | |
| 670 | −%ifdef X86_32_PICASM | |
| 671 | − push r0 | |
| 672 | − mov r0, esp | |
| 673 | − and esp, 0xfffffff0 | |
| 674 | − push 0x01010101 | |
| 675 | − push 0x01010101 | |
| 676 | − push 0x01010101 | |
| 677 | − push 0x01010101 | |
| 678 | − pmullw %1, [esp] | |
| 679 | − mov esp, r0 | |
| 680 | − pop r0 | |
| 681 | −%else | |
| 682 | − pmullw %1, [mmx_01bytes] | |
| 683 | −%endif | |
| 555 | + pmullw %1, [pic(mmx_01bytes)] | |
| 684 | 556 | pshufw %1, %1, 0 |
| 685 | 557 | movq [%4], %1 |
| 686 | 558 | %endmacro |
| @@ -689,26 +561,14 @@ WELS_EXTERN WelsDecoderI4x4LumaPredDDR_mmx · 2 unmodified lines | ||
| 689 | 561 | movq %1, [%3+r1-8] |
| 690 | 562 | psrlq %1, 38h |
| 691 | 563 | |
| 692 | −%ifdef X86_32_PICASM | |
| 693 | − push r0 | |
| 694 | − mov r0, esp | |
| 695 | − and esp, 0xfffffff0 | |
| 696 | − push 0x01010101 | |
| 697 | − push 0x01010101 | |
| 698 | − push 0x01010101 | |
| 699 | − push 0x01010101 | |
| 700 | − pmullw %1, [esp] | |
| 701 | − mov esp, r0 | |
| 702 | − pop r0 | |
| 703 | −%else | |
| 704 | − pmullw %1, [mmx_01bytes] | |
| 705 | −%endif | |
| 564 | + pmullw %1, [pic(mmx_01bytes)] | |
| 706 | 565 | pshufw %1, %1, 0 |
| 707 | 566 | movq [%4], %1 |
| 708 | 567 | %endmacro |
| 709 | 568 | |
| 710 | 569 | WELS_EXTERN WelsDecoderIChromaPredH_mmx |
| 711 | 570 | %assign push_num 0 |
| 571 | + INIT_X86_32_PIC r3 | |
| 712 | 572 | LOAD_2_PARA |
| 713 | 573 | SIGN_EXTENSION r1, r1d |
| 714 | 574 | mov r2, r0 |
| @@ -716,20 +576,7 @@ WELS_EXTERN WelsDecoderIChromaPredH_mmx · 1 unmodified line | ||
| 716 | 576 | movq mm0, [r2-8] |
| 717 | 577 | psrlq mm0, 38h |
| 718 | 578 | |
| 719 | −%ifdef X86_32_PICASM | |
| 720 | − push r0 | |
| 721 | − mov r0, esp | |
| 722 | − and esp, 0xfffffff0 | |
| 723 | − push 0x01010101 | |
| 724 | − push 0x01010101 | |
| 725 | − push 0x01010101 | |
| 726 | − push 0x01010101 | |
| 727 | − pmullw mm0, [esp] | |
| 728 | − mov esp, r0 | |
| 729 | − pop r0 | |
| 730 | −%else | |
| 731 | − pmullw mm0, [mmx_01bytes] | |
| 732 | −%endif | |
| 579 | + pmullw mm0, [pic(mmx_01bytes)] | |
| 733 | 580 | pshufw mm0, mm0, 0 |
| 734 | 581 | movq [r0], mm0 |
| 735 | 582 | |
| @@ -753,6 +600,7 @@ WELS_EXTERN WelsDecoderIChromaPredH_mmx · 17 unmodified lines | ||
| 753 | 600 | lea r0, [r0+2*r1] |
| 754 | 601 | MMX_PRED_H_8X8_ONE_LINEE mm0, mm1, r2, r0+r1 |
| 755 | 602 | |
| 603 | + DEINIT_X86_32_PIC | |
| 756 | 604 | WELSEMMS |
| 757 | 605 | ret |
| 758 | 606 | |
| @@ -816,6 +664,7 @@ WELS_EXTERN WelsDecoderIChromaPredV_mmx · 57 unmodified lines | ||
| 816 | 664 | ;******************************************************************************* |
| 817 | 665 | WELS_EXTERN WelsDecoderI4x4LumaPredHD_mmx |
| 818 | 666 | %assign push_num 0 |
| 667 | + INIT_X86_32_PIC r3 | |
| 819 | 668 | LOAD_2_PARA |
| 820 | 669 | SIGN_EXTENSION r1, r1d |
| 821 | 670 | mov r2, r0 |
| @@ -841,18 +690,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredHD_mmx · 19 unmodified lines | ||
| 841 | 690 | pavgb mm1, mm0 |
| 842 | 691 | |
| 843 | 692 | pxor mm4, mm0 ; find odd value in the lowest bit of each byte |
| 844 | −%ifdef X86_32_PICASM | |
| 845 | − push r0 | |
| 846 | − mov r0, esp | |
| 847 | − and esp, 0xfffffff0 | |
| 848 | − push 0x01010101 | |
| 849 | − push 0x01010101 | |
| 850 | − pand mm4, [esp] | |
| 851 | − mov esp, r0 | |
| 852 | − pop r0 | |
| 853 | −%else | |
| 854 | − pand mm4, [mmx_01bytes] ; set the odd bit | |
| 855 | −%endif | |
| 693 | + pand mm4, [pic(mmx_01bytes)] ; set the odd bit | |
| 856 | 694 | psubusb mm1, mm4 ; decrease 1 from odd bytes |
| 857 | 695 | |
| 858 | 696 | pavgb mm2, mm1 ; mm2 = [xx xx d c b f h j] |
| @@ -876,6 +714,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredHD_mmx · 17 unmodified lines | ||
| 876 | 714 | movd [r0+2*r1], mm3 |
| 877 | 715 | psrlq mm3, 10h |
| 878 | 716 | movd [r0+r1], mm3 |
| 717 | + DEINIT_X86_32_PIC | |
| 879 | 718 | WELSEMMS |
| 880 | 719 | ret |
| 881 | 720 | |
| @@ -909,6 +748,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredHD_mmx · 27 unmodified lines | ||
| 909 | 748 | ;******************************************************************************* |
| 910 | 749 | WELS_EXTERN WelsDecoderI4x4LumaPredHU_mmx |
| 911 | 750 | %assign push_num 0 |
| 751 | + INIT_X86_32_PIC r3 | |
| 912 | 752 | LOAD_2_PARA |
| 913 | 753 | SIGN_EXTENSION r1, r1d |
| 914 | 754 | mov r2, r0 |
| @@ -937,18 +777,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredHU_mmx · 22 unmodified lines | ||
| 937 | 777 | pavgb mm2, mm0 |
| 938 | 778 | |
| 939 | 779 | pxor mm5, mm0 ; find odd value in the lowest bit of each byte |
| 940 | −%ifdef X86_32_PICASM | |
| 941 | − push r0 | |
| 942 | − mov r0, esp | |
| 943 | − and esp, 0xfffffff0 | |
| 944 | − push 0x01010101 | |
| 945 | − push 0x01010101 | |
| 946 | − pand mm5, [esp] ; set the odd bit | |
| 947 | − mov esp, r0 | |
| 948 | − pop r0 | |
| 949 | −%else | |
| 950 | − pand mm5, [mmx_01bytes] ; set the odd bit | |
| 951 | −%endif | |
| 780 | + pand mm5, [pic(mmx_01bytes)] ; set the odd bit | |
| 952 | 781 | psubusb mm2, mm5 ; decrease 1 from odd bytes |
| 953 | 782 | |
| 954 | 783 | pavgb mm2, mm3 ; mm2 = [f d b xx xx xx xx xx] |
| @@ -970,6 +799,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredHU_mmx · 15 unmodified lines | ||
| 970 | 799 | movd [r0+r1], mm1 |
| 971 | 800 | psrlq mm1, 10h |
| 972 | 801 | movd [r0+2*r1], mm1 |
| 802 | + DEINIT_X86_32_PIC | |
| 973 | 803 | WELSEMMS |
| 974 | 804 | ret |
| 975 | 805 | |
| @@ -1005,6 +835,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredHU_mmx · 29 unmodified lines | ||
| 1005 | 835 | ;******************************************************************************* |
| 1006 | 836 | WELS_EXTERN WelsDecoderI4x4LumaPredVR_mmx |
| 1007 | 837 | %assign push_num 0 |
| 838 | + INIT_X86_32_PIC r3 | |
| 1008 | 839 | LOAD_2_PARA |
| 1009 | 840 | SIGN_EXTENSION r1, r1d |
| 1010 | 841 | mov r2, r0 |
| @@ -1030,18 +861,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredVR_mmx · 19 unmodified lines | ||
| 1030 | 861 | pavgb mm2, mm0 |
| 1031 | 862 | |
| 1032 | 863 | pxor mm3, mm0 ; find odd value in the lowest bit of each byte |
| 1033 | −%ifdef X86_32_PICASM | |
| 1034 | − push r0 | |
| 1035 | − mov r0, esp | |
| 1036 | − and esp, 0xfffffff0 | |
| 1037 | − push 0x01010101 | |
| 1038 | − push 0x01010101 | |
| 1039 | − pand mm3, [esp] ; set the odd bit | |
| 1040 | − mov esp, r0 | |
| 1041 | − pop r0 | |
| 1042 | −%else | |
| 1043 | − pand mm3, [mmx_01bytes] ; set the odd bit | |
| 1044 | −%endif | |
| 864 | + pand mm3, [pic(mmx_01bytes)] ; set the odd bit | |
| 1045 | 865 | psubusb mm2, mm3 ; decrease 1 from odd bytes |
| 1046 | 866 | |
| 1047 | 867 | movq mm3, mm0 |
| @@ -1071,6 +891,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredVR_mmx · 23 unmodified lines | ||
| 1071 | 891 | pxor mm5, mm2 ; mm5 = [xx xx xx xx g f e j] |
| 1072 | 892 | lea r0, [r0+2*r1] |
| 1073 | 893 | movd [r0+r1], mm5 |
| 894 | + DEINIT_X86_32_PIC | |
| 1074 | 895 | WELSEMMS |
| 1075 | 896 | ret |
| 1076 | 897 | |
| @@ -1102,6 +923,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredVR_mmx · 25 unmodified lines | ||
| 1102 | 923 | ;******************************************************************************* |
| 1103 | 924 | WELS_EXTERN WelsDecoderI4x4LumaPredDDL_mmx |
| 1104 | 925 | %assign push_num 0 |
| 926 | + INIT_X86_32_PIC r3 | |
| 1105 | 927 | LOAD_2_PARA |
| 1106 | 928 | SIGN_EXTENSION r1, r1d |
| 1107 | 929 | mov r2, r0 |
| @@ -1121,18 +943,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredDDL_mmx · 13 unmodified lines | ||
| 1121 | 943 | movq mm3, mm1 |
| 1122 | 944 | pavgb mm1, mm2 |
| 1123 | 945 | pxor mm3, mm2 ; find odd value in the lowest bit of each byte |
| 1124 | −%ifdef X86_32_PICASM | |
| 1125 | − push r0 | |
| 1126 | − mov r0, esp | |
| 1127 | − and esp, 0xfffffff0 | |
| 1128 | − push 0x01010101 | |
| 1129 | − push 0x01010101 | |
| 1130 | − pand mm3, [esp] ; set the odd bit | |
| 1131 | − mov esp, r0 | |
| 1132 | − pop r0 | |
| 1133 | −%else | |
| 1134 | − pand mm3, [mmx_01bytes] ; set the odd bit | |
| 1135 | −%endif | |
| 946 | + pand mm3, [pic(mmx_01bytes)] ; set the odd bit | |
| 1136 | 947 | psubusb mm1, mm3 ; decrease 1 from odd bytes |
| 1137 | 948 | |
| 1138 | 949 | pavgb mm0, mm1 ; mm0 = [g f e d c b a xx] |
| @@ -1146,6 +957,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredDDL_mmx · 7 unmodified lines | ||
| 1146 | 957 | psrlq mm0, 8h |
| 1147 | 958 | lea r0, [r0+2*r1] |
| 1148 | 959 | movd [r0+r1], mm0 |
| 960 | + DEINIT_X86_32_PIC | |
| 1149 | 961 | WELSEMMS |
| 1150 | 962 | ret |
| 1151 | 963 | |
| @@ -1181,6 +993,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredDDL_mmx · 29 unmodified lines | ||
| 1181 | 993 | ;******************************************************************************* |
| 1182 | 994 | WELS_EXTERN WelsDecoderI4x4LumaPredVL_mmx |
| 1183 | 995 | %assign push_num 0 |
| 996 | + INIT_X86_32_PIC r3 | |
| 1184 | 997 | LOAD_2_PARA |
| 1185 | 998 | SIGN_EXTENSION r1, r1d |
| 1186 | 999 | mov r2, r0 |
| @@ -1199,18 +1012,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredVL_mmx · 12 unmodified lines | ||
| 1199 | 1012 | movq mm4, mm2 |
| 1200 | 1013 | pavgb mm2, mm0 |
| 1201 | 1014 | pxor mm4, mm0 ; find odd value in the lowest bit of each byte |
| 1202 | −%ifdef X86_32_PICASM | |
| 1203 | − push r0 | |
| 1204 | − mov r0, esp | |
| 1205 | − and esp, 0xfffffff0 | |
| 1206 | − push 0x01010101 | |
| 1207 | − push 0x01010101 | |
| 1208 | − pand mm4, [esp] ; set the odd bit | |
| 1209 | − mov esp, r0 | |
| 1210 | − pop r0 | |
| 1211 | −%else | |
| 1212 | − pand mm4, [mmx_01bytes] ; set the odd bit | |
| 1213 | −%endif | |
| 1015 | + pand mm4, [pic(mmx_01bytes)] ; set the odd bit | |
| 1214 | 1016 | psubusb mm2, mm4 ; decrease 1 from odd bytes |
| 1215 | 1017 | |
| 1216 | 1018 | pavgb mm2, mm1 ; mm2 = [xx xx xx j h g f e] |
| @@ -1223,6 +1025,7 @@ WELS_EXTERN WelsDecoderI4x4LumaPredVL_mmx · 6 unmodified lines | ||
| 1223 | 1025 | psrlq mm2, 8h |
| 1224 | 1026 | lea r0, [r0+2*r1] |
| 1225 | 1027 | movd [r0+r1], mm2 |
| 1028 | + DEINIT_X86_32_PIC | |
| 1226 | 1029 | WELSEMMS |
| 1227 | 1030 | ret |
| 1228 | 1031 | |
| @@ -1234,6 +1037,7 @@ WELS_EXTERN WelsDecoderIChromaPredDc_sse2 · 5 unmodified lines | ||
| 1234 | 1037 | push r3 |
| 1235 | 1038 | push r4 |
| 1236 | 1039 | %assign push_num 2 |
| 1040 | + INIT_X86_32_PIC r5 | |
| 1237 | 1041 | LOAD_2_PARA |
| 1238 | 1042 | SIGN_EXTENSION r1, r1d |
| 1239 | 1043 | mov r4, r0 |
| @@ -1275,18 +1079,7 @@ WELS_EXTERN WelsDecoderIChromaPredDc_sse2 · 35 unmodified lines | ||
| 1275 | 1079 | movq mm1, mm2 |
| 1276 | 1080 | paddq mm1, mm0; ; sum1 = mm3, sum2 = mm0, sum3 = mm2, sum4 = mm1 |
| 1277 | 1081 | |
| 1278 | −%ifdef X86_32_PICASM | |
| 1279 | − push r0 | |
| 1280 | − mov r0, esp | |
| 1281 | − and esp, 0xfffffff0 | |
| 1282 | − push 0x00000000 | |
| 1283 | − push 0x00000002 | |
| 1284 | − movq mm4, [esp] | |
| 1285 | − mov esp, r0 | |
| 1286 | − pop r0 | |
| 1287 | −%else | |
| 1288 | − movq mm4, [mmx_0x02] | |
| 1289 | −%endif | |
| 1082 | + movq mm4, [pic(mmx_0x02)] | |
| 1290 | 1083 | |
| 1291 | 1084 | paddq mm0, mm4 |
| 1292 | 1085 | psrlq mm0, 0x02 |
| @@ -1302,30 +1095,13 @@ WELS_EXTERN WelsDecoderIChromaPredDc_sse2 · 9 unmodified lines | ||
| 1302 | 1095 | paddq mm1, mm4 |
| 1303 | 1096 | psrlq mm1, 0x03 |
| 1304 | 1097 | |
| 1305 | −%ifdef X86_32_PICASM | |
| 1306 | − push r5 | |
| 1307 | − mov r5, esp | |
| 1308 | − and esp, 0xfffffff0 | |
| 1309 | − push 0x01010101 | |
| 1310 | − push 0x01010101 | |
| 1311 | − pmuludq mm0, [esp] | |
| 1312 | − pmuludq mm3, [esp] | |
| 1313 | −%else | |
| 1314 | − pmuludq mm0, [mmx_01bytes] | |
| 1315 | − pmuludq mm3, [mmx_01bytes] | |
| 1316 | −%endif | |
| 1098 | + pmuludq mm0, [pic(mmx_01bytes)] | |
| 1099 | + pmuludq mm3, [pic(mmx_01bytes)] | |
| 1317 | 1100 | psllq mm0, 0x20 |
| 1318 | 1101 | pxor mm0, mm3 ; mm0 = m_up |
| 1319 | 1102 | |
| 1320 | −%ifdef X86_32_PICASM | |
| 1321 | − pmuludq mm2, [esp] | |
| 1322 | − pmuludq mm1, [esp] | |
| 1323 | − mov esp, r5 | |
| 1324 | − pop r5 | |
| 1325 | −%else | |
| 1326 | − pmuludq mm2, [mmx_01bytes] | |
| 1327 | − pmuludq mm1, [mmx_01bytes] | |
| 1328 | −%endif | |
| 1103 | + pmuludq mm2, [pic(mmx_01bytes)] | |
| 1104 | + pmuludq mm1, [pic(mmx_01bytes)] | |
| 1329 | 1105 | psllq mm1, 0x20 |
| 1330 | 1106 | pxor mm1, mm2 ; mm2 = m_down |
| 1331 | 1107 | |
| @@ -1342,6 +1118,7 @@ WELS_EXTERN WelsDecoderIChromaPredDc_sse2 · 10 unmodified lines | ||
| 1342 | 1118 | lea r4, [r4+2*r1] |
| 1343 | 1119 | movq [r4+r1], mm1 |
| 1344 | 1120 | |
| 1121 | + DEINIT_X86_32_PIC | |
| 1345 | 1122 | pop r4 |
| 1346 | 1123 | pop r3 |
| 1347 | 1124 | WELSEMMS |
| @@ -1357,6 +1134,7 @@ WELS_EXTERN WelsDecoderI16x16LumaPredDc_sse2 · 9 unmodified lines | ||
| 1357 | 1134 | push r3 |
| 1358 | 1135 | push r4 |
| 1359 | 1136 | %assign push_num 2 |
| 1137 | + INIT_X86_32_PIC r5 | |
| 1360 | 1138 | LOAD_2_PARA |
| 1361 | 1139 | SIGN_EXTENSION r1, r1d |
| 1362 | 1140 | mov r4, r0 |
| @@ -1385,20 +1163,7 @@ WELS_EXTERN WelsDecoderI16x16LumaPredDc_sse2 · 22 unmodified lines | ||
| 1385 | 1163 | movd xmm1, r2d |
| 1386 | 1164 | paddw xmm0, xmm1 |
| 1387 | 1165 | psrld xmm0, 0x05 |
| 1388 | −%ifdef X86_32_PICASM | |
| 1389 | − push r0 | |
| 1390 | − mov r0, esp | |
| 1391 | − and esp, 0xfffffff0 | |
| 1392 | − push 0x01010101 | |
| 1393 | − push 0x01010101 | |
| 1394 | − push 0x01010101 | |
| 1395 | − push 0x01010101 | |
| 1396 | − pmuludq xmm0, [esp] | |
| 1397 | − mov esp, r0 | |
| 1398 | − pop r0 | |
| 1399 | −%else | |
| 1400 | − pmuludq xmm0, [mmx_01bytes] | |
| 1401 | −%endif | |
| 1166 | + pmuludq xmm0, [pic(mmx_01bytes)] | |
| 1402 | 1167 | pshufd xmm0, xmm0, 0 |
| 1403 | 1168 | |
| 1404 | 1169 | movdqa [r4], xmm0 |
| @@ -1432,6 +1197,7 @@ WELS_EXTERN WelsDecoderI16x16LumaPredDc_sse2 · 27 unmodified lines | ||
| 1432 | 1197 | |
| 1433 | 1198 | movdqa [r4+r1], xmm0 |
| 1434 | 1199 | |
| 1200 | + DEINIT_X86_32_PIC | |
| 1435 | 1201 | pop r4 |
| 1436 | 1202 | pop r3 |
| 1437 | 1203 | |
| @@ -1518,24 +1284,12 @@ WELS_EXTERN WelsDecoderI16x16LumaPredDcTop_sse2 · 80 unmodified lines | ||
| 1518 | 1284 | ;******************************************************************************* |
| 1519 | 1285 | WELS_EXTERN WelsDecoderI16x16LumaPredDcNA_sse2 |
| 1520 | 1286 | %assign push_num 0 |
| 1287 | + INIT_X86_32_PIC r3 | |
| 1521 | 1288 | LOAD_2_PARA |
| 1522 | 1289 | SIGN_EXTENSION r1, r1d |
| 1523 | 1290 | lea r2, [2*r1+r1] ; 3*kiStride |
| 1524 | 1291 | |
| 1525 | −%ifdef X86_32_PICASM | |
| 1526 | − push r0 | |
| 1527 | − mov r0, esp | |
| 1528 | − and esp, 0xfffffff0 | |
| 1529 | − push 0x80808080 | |
| 1530 | − push 0x80808080 | |
| 1531 | − push 0x80808080 | |
| 1532 | − push 0x80808080 | |
| 1533 | − movdqa xmm0, [esp] | |
| 1534 | − mov esp, r0 | |
| 1535 | − pop r0 | |
| 1536 | −%else | |
| 1537 | − movdqa xmm0, [sse2_dc_0x80] | |
| 1538 | −%endif | |
| 1292 | + movdqa xmm0, [pic(sse2_dc_0x80)] | |
| 1539 | 1293 | movdqa xmm1, xmm0 |
| 1540 | 1294 | movdqa [r0], xmm0 |
| 1541 | 1295 | movdqa [r0+r1], xmm1 |
| @@ -1557,6 +1311,7 @@ WELS_EXTERN WelsDecoderI16x16LumaPredDcNA_sse2 · 15 unmodified lines | ||
| 1557 | 1311 | movdqa [r0+2*r1], xmm0 |
| 1558 | 1312 | movdqa [r0+r2], xmm1 |
| 1559 | 1313 | |
| 1314 | + DEINIT_X86_32_PIC | |
| 1560 | 1315 | ret |
| 1561 | 1316 | |
| 1562 | 1317 | ;******************************************************************************* |
| @@ -1680,21 +1435,11 @@ WELS_EXTERN WelsDecoderIChromaPredDcTop_sse2 · 117 unmodified lines | ||
| 1680 | 1435 | ;******************************************************************************* |
| 1681 | 1436 | WELS_EXTERN WelsDecoderIChromaPredDcNA_mmx |
| 1682 | 1437 | %assign push_num 0 |
| 1438 | + INIT_X86_32_PIC r3 | |
| 1683 | 1439 | LOAD_2_PARA |
| 1684 | 1440 | SIGN_EXTENSION r1, r1d |
| 1685 | 1441 | lea r2, [2*r1+r1] |
| 1686 | −%ifdef X86_32_PICASM | |
| 1687 | − push r0 | |
| 1688 | − mov r0, esp | |
| 1689 | − and esp, 0xfffffff0 | |
| 1690 | − push 0x80808080 | |
| 1691 | − push 0x80808080 | |
| 1692 | − movq mm0, [esp] | |
| 1693 | − mov esp, r0 | |
| 1694 | − pop r0 | |
| 1695 | −%else | |
| 1696 | − movq mm0, [sse2_dc_0x80] | |
| 1697 | −%endif | |
| 1442 | + movq mm0, [pic(sse2_dc_0x80)] | |
| 1698 | 1443 | movq mm1, mm0 |
| 1699 | 1444 | movq [r0], mm0 |
| 1700 | 1445 | movq [r0+r1], mm1 |
| @@ -1705,6 +1450,7 @@ WELS_EXTERN WelsDecoderIChromaPredDcNA_mmx · 4 unmodified lines | ||
| 1705 | 1450 | movq [r0+r1], mm1 |
| 1706 | 1451 | movq [r0+2*r1], mm0 |
| 1707 | 1452 | movq [r0+r2], mm1 |
| 1453 | + DEINIT_X86_32_PIC | |
| 1708 | 1454 | emms |
| 1709 | 1455 | ret |
| 1710 | 1456 | |