| @@ -47,10 +47,6 @@ struc FFTContext · 46 unmodified lines |
| 47 | .mdctbits: resd 1 | 47 | .mdctbits: resd 1 |
| 48 | .tcos: pointer 1 | 48 | .tcos: pointer 1 |
| 49 | .tsin: pointer 1 | 49 | .tsin: pointer 1 |
| 50 | .fftperm: pointer 1 | | |
| 51 | .fftcalc: pointer 1 | | |
| 52 | .imdctcalc:pointer 1 | | |
| 53 | .imdcthalf:pointer 1 | | |
| 54 | endstruc | 50 | endstruc |
| 55 | | 51 | |
| 56 | %define M_SQRT1_2 0.70710678118654752440 | 52 | %define M_SQRT1_2 0.70710678118654752440 |
| @@ -69,7 +65,6 @@ perm1: dd 0x00, 0x02, 0x03, 0x01, 0x03, 0x00, 0x02, 0x01 · 12 unmodified lines |
| 69 | perm2: dd 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x03 | 65 | perm2: dd 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x03 |
| 70 | ps_p1p1m1p1root2: dd 1.0, 1.0, -1.0, 1.0, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2 | 66 | ps_p1p1m1p1root2: dd 1.0, 1.0, -1.0, 1.0, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2, M_SQRT1_2 |
| 71 | ps_m1m1p1m1p1m1m1m1: dd 1<<31, 1<<31, 0, 1<<31, 0, 1<<31, 1<<31, 1<<31 | 67 | ps_m1m1p1m1p1m1m1m1: dd 1<<31, 1<<31, 0, 1<<31, 0, 1<<31, 1<<31, 1<<31 |
| 72 | ps_m1m1m1m1: times 4 dd 1<<31 | | |
| 73 | ps_m1p1: dd 1<<31, 0 | 68 | ps_m1p1: dd 1<<31, 0 |
| 74 | | 69 | |
| 75 | %assign i 16 | 70 | %assign i 16 |
| @@ -538,16 +533,6 @@ DEFINE_ARGS z, w, n, o1, o3 · 462 unmodified lines |
| 538 | rep ret | 533 | rep ret |
| 539 | %endmacro | 534 | %endmacro |
| 540 | | 535 | |
| 541 | %macro FFT_DISPATCH 2; clobbers 5 GPRs, 8 XMMs | | |
| 542 | lea r2, [dispatch_tab%1] | | |
| 543 | mov r2, [r2 + (%2q-2)*gprsize] | | |
| 544 | %ifdef PIC | | |
| 545 | lea r3, [$$] | | |
| 546 | add r2, r3 | | |
| 547 | %endif | | |
| 548 | call r2 | | |
| 549 | %endmacro ; FFT_DISPATCH | | |
| 550 | | | |
| 551 | INIT_YMM avx | 536 | INIT_YMM avx |
| 552 | | 537 | |
| 553 | %if HAVE_AVX | 538 | %if HAVE_AVX |
| @@ -564,14 +549,6 @@ INIT_YMM avx · 10 unmodified lines |
| 564 | | 549 | |
| 565 | DECL_PASS pass_avx, PASS_BIG 1 | 550 | DECL_PASS pass_avx, PASS_BIG 1 |
| 566 | DECL_PASS pass_interleave_avx, PASS_BIG 0 | 551 | DECL_PASS pass_interleave_avx, PASS_BIG 0 |
| 567 | | | |
| 568 | cglobal fft_calc, 2,5,8 | | |
| 569 | mov r3d, [r0 + FFTContext.nbits] | | |
| 570 | mov r0, r1 | | |
| 571 | mov r1, r3 | | |
| 572 | FFT_DISPATCH _interleave %+ SUFFIX, r1 | | |
| 573 | REP_RET | | |
| 574 | | | |
| 575 | %endif | 552 | %endif |
| 576 | | 553 | |
| 577 | INIT_XMM sse | 554 | INIT_XMM sse |
| @@ -589,112 +566,6 @@ INIT_XMM sse · 11 unmodified lines |
| 589 | DECL_PASS pass_sse, PASS_BIG 1 | 566 | DECL_PASS pass_sse, PASS_BIG 1 |
| 590 | DECL_PASS pass_interleave_sse, PASS_BIG 0 | 567 | DECL_PASS pass_interleave_sse, PASS_BIG 0 |
| 591 | | 568 | |
| 592 | cglobal fft_calc, 2,5,8 | | |
| 593 | mov r3d, [r0 + FFTContext.nbits] | | |
| 594 | PUSH r1 | | |
| 595 | PUSH r3 | | |
| 596 | mov r0, r1 | | |
| 597 | mov r1, r3 | | |
| 598 | FFT_DISPATCH _interleave %+ SUFFIX, r1 | | |
| 599 | POP rcx | | |
| 600 | POP r4 | | |
| 601 | cmp rcx, 4 | | |
| 602 | jg .end | | |
| 603 | mov r2, -1 | | |
| 604 | add rcx, 3 | | |
| 605 | shl r2, cl | | |
| 606 | sub r4, r2 | | |
| 607 | .loop | | |
| 608 | movaps xmm0, [r4 + r2] | | |
| 609 | movaps xmm1, xmm0 | | |
| 610 | unpcklps xmm0, [r4 + r2 + 16] | | |
| 611 | unpckhps xmm1, [r4 + r2 + 16] | | |
| 612 | movaps [r4 + r2], xmm0 | | |
| 613 | movaps [r4 + r2 + 16], xmm1 | | |
| 614 | add r2, 32 | | |
| 615 | jl .loop | | |
| 616 | .end: | | |
| 617 | REP_RET | | |
| 618 | | | |
| 619 | cextern_naked memcpy | | |
| 620 | | | |
| 621 | cglobal fft_permute, 2,7,1 | | |
| 622 | mov r4, [r0 + FFTContext.revtab] | | |
| 623 | mov r5, [r0 + FFTContext.tmpbuf] | | |
| 624 | mov ecx, [r0 + FFTContext.nbits] | | |
| 625 | mov r2, 1 | | |
| 626 | shl r2, cl | | |
| 627 | xor r0, r0 | | |
| 628 | %if ARCH_X86_32 | | |
| 629 | mov r1, r1m | | |
| 630 | %endif | | |
| 631 | .loop: | | |
| 632 | movaps xmm0, [r1 + 8*r0] | | |
| 633 | movzx r6, word [r4 + 2*r0] | | |
| 634 | movzx r3, word [r4 + 2*r0 + 2] | | |
| 635 | movlps [r5 + 8*r6], xmm0 | | |
| 636 | movhps [r5 + 8*r3], xmm0 | | |
| 637 | add r0, 2 | | |
| 638 | cmp r0, r2 | | |
| 639 | jl .loop | | |
| 640 | shl r2, 3 | | |
| 641 | %if ARCH_X86_64 | | |
| 642 | mov r0, r1 | | |
| 643 | mov r1, r5 | | |
| 644 | %else | | |
| 645 | push r2 | | |
| 646 | push r5 | | |
| 647 | push r1 | | |
| 648 | %endif | | |
| 649 | %if ARCH_X86_64 && WIN64 == 0 | | |
| 650 | jmp memcpy | | |
| 651 | %else | | |
| 652 | call memcpy | | |
| 653 | %if ARCH_X86_32 | | |
| 654 | add esp, 12 | | |
| 655 | %endif | | |
| 656 | REP_RET | | |
| 657 | %endif | | |
| 658 | | | |
| 659 | cglobal imdct_calc, 3,5,3 | | |
| 660 | mov r3d, [r0 + FFTContext.mdctsize] | | |
| 661 | mov r4, [r0 + FFTContext.imdcthalf] | | |
| 662 | add r1, r3 | | |
| 663 | PUSH r3 | | |
| 664 | PUSH r1 | | |
| 665 | %if ARCH_X86_32 | | |
| 666 | push r2 | | |
| 667 | push r1 | | |
| 668 | push r0 | | |
| 669 | %else | | |
| 670 | sub rsp, 8 | | |
| 671 | %endif | | |
| 672 | call r4 | | |
| 673 | %if ARCH_X86_32 | | |
| 674 | add esp, 12 | | |
| 675 | %else | | |
| 676 | add rsp, 8 | | |
| 677 | %endif | | |
| 678 | POP r1 | | |
| 679 | POP r3 | | |
| 680 | lea r0, [r1 + 2*r3] | | |
| 681 | mov r2, r3 | | |
| 682 | sub r3, 16 | | |
| 683 | neg r2 | | |
| 684 | movaps xmm2, [ps_m1m1m1m1] | | |
| 685 | .loop: | | |
| 686 | movaps xmm0, [r1 + r3] | | |
| 687 | movaps xmm1, [r0 + r2] | | |
| 688 | shufps xmm0, xmm0, 0x1b | | |
| 689 | shufps xmm1, xmm1, 0x1b | | |
| 690 | xorps xmm0, xmm2 | | |
| 691 | movaps [r0 + r3], xmm1 | | |
| 692 | movaps [r1 + r2], xmm0 | | |
| 693 | sub r3, 16 | | |
| 694 | add r2, 16 | | |
| 695 | jl .loop | | |
| 696 | REP_RET | | |
| 697 | | | |
| 698 | INIT_MMX 3dnow | 569 | INIT_MMX 3dnow |
| 699 | %define mulps pfmul | 570 | %define mulps pfmul |
| 700 | %define addps pfadd | 571 | %define addps pfadd |
| @@ -712,6 +583,16 @@ DECL_PASS pass_interleave_3dnow, PASS_BIG 0 · 11 unmodified lines |
| 712 | %define SECTION_REL | 583 | %define SECTION_REL |
| 713 | %endif | 584 | %endif |
| 714 | | 585 | |
| | 586 | %macro FFT_DISPATCH 2; clobbers 5 GPRs, 8 XMMs |
| | 587 | lea r2, [dispatch_tab%1] |
| | 588 | mov r2, [r2 + (%2q-2)*gprsize] |
| | 589 | %ifdef PIC |
| | 590 | lea r3, [$$] |
| | 591 | add r2, r3 |
| | 592 | %endif |
| | 593 | call r2 |
| | 594 | %endmacro ; FFT_DISPATCH |
| | 595 | |
| 715 | %macro DECL_FFT 1-2 ; nbits, suffix | 596 | %macro DECL_FFT 1-2 ; nbits, suffix |
| 716 | %ifidn %0, 1 | 597 | %ifidn %0, 1 |
| 717 | %xdefine fullsuffix SUFFIX | 598 | %xdefine fullsuffix SUFFIX |