[x264-devel] x86inc: Correctly warn on use of SSE2 instructions in SSE functions

Christophe Gisquet git at videolan.org
Tue Feb 24 20:37:44 CET 2015


x264 | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Tue Feb  3 20:40:41 2015 +0100| [a95584945dd9ce3acc66c6cd8f6796bc4404d40d] | committer: Anton Mitrofanov

x86inc: Correctly warn on use of SSE2 instructions in SSE functions

SSE2 instructions that are XMM-implementations of pre-existing MMX/MMX2
instructions did not issue warnings when used in SSE functions. Handle
it by also checking the register type when such instructions are used.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=a95584945dd9ce3acc66c6cd8f6796bc4404d40d
---

 common/x86/x86inc.asm |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/x86/x86inc.asm b/common/x86/x86inc.asm
index c7ac95b..d897fa4 100644
--- a/common/x86/x86inc.asm
+++ b/common/x86/x86inc.asm
@@ -1070,6 +1070,8 @@ INIT_XMM
         %ifdef cpuname
             %if notcpuflag(%2)
                 %error use of ``%1'' %2 instruction in cpuname function: current_function
+            %elif cpuflags_%2 < cpuflags_sse && notcpuflag(sse2) && __sizeofreg > 8
+                %error use of ``%1'' sse2 instruction in cpuname function: current_function
             %endif
         %endif
     %endif
@@ -1206,7 +1208,7 @@ AVX_INSTR minsd, sse2, 1, 0, 1
 AVX_INSTR minss, sse, 1, 0, 1
 AVX_INSTR movapd, sse2
 AVX_INSTR movaps, sse
-AVX_INSTR movd
+AVX_INSTR movd, mmx
 AVX_INSTR movddup, sse3
 AVX_INSTR movdqa, sse2
 AVX_INSTR movdqu, sse2
@@ -1222,7 +1224,7 @@ AVX_INSTR movntdq, sse2
 AVX_INSTR movntdqa, sse4
 AVX_INSTR movntpd, sse2
 AVX_INSTR movntps, sse
-AVX_INSTR movq
+AVX_INSTR movq, mmx
 AVX_INSTR movsd, sse2, 1, 0, 0
 AVX_INSTR movshdup, sse3
 AVX_INSTR movsldup, sse3



More information about the x264-devel mailing list