History

Merge pull request #519 from mstorsjo/push-xmm-registers

Backup/restore the xmm6-xmm15 SSE registers within asm functions on win64 Reviewed by zhiliang

volvet committed 12 years ago

Commit fb1958a2 parents b7b01fa 463362624 files · +213 −117Browse files

Showing the changes to codec/processing/src (4 of 24 files). Show all

Unified · Split

4 files
  1. codec/processing/src/adaptivequantization/AdaptiveQuantization.cpp +0 −6
  2. codec/processing/src/adaptivequantization/AdaptiveQuantization.h +0 −1
  3. codec/processing/src/asm/denoisefilter.asm +2 −0
  4. codec/processing/src/asm/vaa.asm +12 −0
codec/processing/src/adaptivequantization/AdaptiveQuantization.cpp+0−6
@@ -49,11 +49,9 @@ CAdaptiveQuantization::CAdaptiveQuantization (int32_t iCpuFlag) { · 48 unmodified lines
4949 m_pfVar = NULL;
5050 WelsMemset (&m_sAdaptiveQuantParam, 0, sizeof (m_sAdaptiveQuantParam));
5151 WelsInitVarFunc (m_pfVar, m_CPUFlag);
52− XMMREG_PROTECT_INIT(AdaptiveQuantization);
5352 }
5453
5554 CAdaptiveQuantization::~CAdaptiveQuantization() {
56− XMMREG_PROTECT_UNINIT(AdaptiveQuantization);
5755 }
5856
5957 EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) {
@@ -102,7 +100,6 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 42 unmodified lines
102100 pRefFrameTmp = pRefFrameY;
103101 pCurFrameTmp = pCurFrameY;
104102 for (i = 0; i < iMbWidth; i++) {
105− XMMREG_PROTECT_STORE(AdaptiveQuantization);
106103 iSumDiff = pVaaCalcResults->pSad8x8[iMbIndex][0];
107104 iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][1];
108105 iSumDiff += pVaaCalcResults->pSad8x8[iMbIndex][2];
@@ -111,7 +108,6 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 2 unmodified lines
111108 iSQDiff = pVaaCalcResults->pSsd16x16[iMbIndex];
112109 uiSum = pVaaCalcResults->pSum16x16[iMbIndex];
113110 iSQSum = pVaaCalcResults->pSumOfSquare16x16[iMbIndex];
114− XMMREG_PROTECT_LOAD(AdaptiveQuantization);
115111
116112 iSumDiff = iSumDiff >> 8;
117113 pMotionTexture->uiMotionIndex = (iSQDiff >> 8) - (iSumDiff * iSumDiff);
@@ -134,9 +130,7 @@ EResult CAdaptiveQuantization::Process (int32_t iType, SPixMap* pSrcPixMap, SPix · 16 unmodified lines
134130 pRefFrameTmp = pRefFrameY;
135131 pCurFrameTmp = pCurFrameY;
136132 for (i = 0; i < iMbWidth; i++) {
137− XMMREG_PROTECT_STORE(AdaptiveQuantization);
138133 m_pfVar (pRefFrameTmp, iRefStride, pCurFrameTmp, iCurStride, pMotionTexture);
139− XMMREG_PROTECT_LOAD(AdaptiveQuantization);
140134 dAverageMotionIndex += pMotionTexture->uiMotionIndex;
141135 dAverageTextureIndex += pMotionTexture->uiTextureIndex;
142136 pMotionTexture++;
codec/processing/src/adaptivequantization/AdaptiveQuantization.h+0−1
@@ -84,7 +84,6 @@ class CAdaptiveQuantization : public IStrategy { · 83 unmodified lines
8484 PVarFunc m_pfVar;
8585 int32_t m_CPUFlag;
8686 SAdaptiveQuantizationParam m_sAdaptiveQuantParam;
87− XMMREG_PROTECT_DECLARE(AdaptiveQuantization);
8887 };
8988
9089 WELSVP_NAMESPACE_END
codec/processing/src/asm/denoisefilter.asm+2−0
@@ -176,6 +176,7 @@ WELS_EXTERN BilateralLumaFilter8_sse2 · 175 unmodified lines
176176 push r3
177177 %assign push_num 1
178178 LOAD_2_PARA
179+ PUSH_XMM 8
179180
180181 pxor xmm7, xmm7
181182
@@ -212,6 +213,7 @@ WELS_EXTERN BilateralLumaFilter8_sse2 · 30 unmodified lines
212213 movq [r3], xmm5
213214
214215
216+ POP_XMM
215217 pop r3
216218 %assign push_num 0
217219
codec/processing/src/asm/vaa.asm+12−0
@@ -452,6 +452,7 @@ WELS_EXTERN SampleVariance16x16_sse2 · 451 unmodified lines
452452 push r15
453453 %assign push_num 4
454454 LOAD_5_PARA
455+ PUSH_XMM 8
455456 SIGN_EXTENSION r1,r1d
456457 SIGN_EXTENSION r3,r3d
457458
@@ -521,6 +522,7 @@ WELS_EXTERN SampleVariance16x16_sse2 · 63 unmodified lines
521522 sub r1, r0
522523 mov [r4+2], r1w ; to store uiTextureIndex
523524
525+ POP_XMM
524526 LOAD_5_PARA_POP
525527 pop r15
526528 pop r14
@@ -552,6 +554,7 @@ WELS_EXTERN VAACalcSad_sse2 · 25 unmodified lines
552554 push r13
553555 %assign push_num 2
554556 LOAD_7_PARA
557+ PUSH_XMM 8
555558 SIGN_EXTENSION r2,r2d
556559 SIGN_EXTENSION r3,r3d
557560 SIGN_EXTENSION r4,r4d
@@ -619,6 +622,7 @@ width_loop: · 61 unmodified lines
619622 %undef psadframe
620623 %undef psad8x8
621624 %undef pushsize
625+ POP_XMM
622626 LOAD_7_PARA_POP
623627 pop r13
624628 pop r12
@@ -785,6 +789,7 @@ WELS_EXTERN VAACalcSadVar_sse2 · 160 unmodified lines
785789 push r14
786790 push r15
787791 %assign push_num 4
792+ PUSH_XMM 8
788793
789794 %ifdef WIN64
790795 mov r4, arg5 ;iPicStride
@@ -880,6 +885,7 @@ var_width_loop: · 89 unmodified lines
880885 paddd xmm7, xmm5
881886 movd [r15], xmm7
882887
888+ POP_XMM
883889 pop r15
884890 pop r14
885891 pop r13
@@ -1082,6 +1088,7 @@ WELS_EXTERN VAACalcSadSsd_sse2 · 196 unmodified lines
10821088 push r14
10831089 push r15
10841090 %assign push_num 4
1091+ PUSH_XMM 10
10851092
10861093 %ifdef WIN64
10871094 mov r4,arg5
@@ -1192,6 +1199,7 @@ sqdiff_width_loop: · 104 unmodified lines
11921199 mov r13, psadframe
11931200 movd [r13], xmm8
11941201
1202+ POP_XMM
11951203 pop r15
11961204 pop r14
11971205 pop r13
@@ -1648,6 +1656,7 @@ WELS_EXTERN VAACalcSadBgd_sse2 · 450 unmodified lines
16481656 push r14
16491657 push r15
16501658 %assign push_num 4
1659+ PUSH_XMM 10
16511660 %ifdef WIN64
16521661 mov r4,arg5
16531662 ; mov r5,arg6
@@ -1773,6 +1782,7 @@ bgd_width_loop: · 119 unmodified lines
17731782 mov r13, psadframe
17741783 movd [r13], xmm8
17751784
1785+ POP_XMM
17761786 pop r15
17771787 pop r14
17781788 pop r13
@@ -1821,6 +1831,7 @@ WELS_EXTERN VAACalcSadSsdBgd_sse2 · 42 unmodified lines
18211831 push r14
18221832 push r15
18231833 %assign push_num 4
1834+ PUSH_XMM 10
18241835 %ifdef WIN64
18251836 mov r4,arg5
18261837 ;mov r5,arg6
@@ -1993,6 +2004,7 @@ sqdiff_bgd_width_loop: · 166 unmodified lines
19932004 mov r14, psadframe
19942005 movd [r14], xmm8
19952006
2007+ POP_XMM
19962008 pop r15
19972009 pop r14
19982010 pop r13

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t