| July 2, 2009 12:00 AM PDT | |
Cause:
It is usually incorrect for MMX code to be followed by x87 code without an intervening EMMS instruction. Usually this will result in x87 stack overflow and unpredictable results at runtime. When the compiler sees MMX code followed by a call or return without an intervening EMMS instruction, it has no way of knowing whether there is x87 code inside the call or after the return. So it issues this warning.
Example:
#include <iostream>
#include <emmintrin.h>
int main()
{
__m64 m0 = _mm_cvtsi32_si64 (1);
__m64 m1 = _mm_cvtsi32_si64 (2);
__m64 m2 = _mm_cvtsi32_si64 (4);
m2 = _mm_add_pi8(m0, m1);
int value = _mm_cvtsi64_si32(m2);
//_mm_empty();
return value;
}
> icl -c diag963.cpp
Intel(R) C++ Compiler for applications running on IA-32, Version 10.1 Build 2
0080602 Package ID: w_cc_p_10.1.022
Copyright (C) 1985-2008 Intel Corporation. All rights reserved.
diag963.cpp
diag963.cpp(14) (col. 9): warning #963: no EMMS instruction before return
Resolution:
Use the EMMS instruction (e.g. by calling the _mm_empty() intrinsic ) after the MMX instructions before the return to restore the Floating-point status on the CPU.
It is usually incorrect for MMX code to be followed by x87 code without an intervening EMMS instruction. Usually this will result in x87 stack overflow and unpredictable results at runtime. When the compiler sees MMX code followed by a call or return without an intervening EMMS instruction, it has no way of knowing whether there is x87 code inside the call or after the return. So it issues this warning.
Example:
#include <iostream>
#include <emmintrin.h>
int main()
{
__m64 m0 = _mm_cvtsi32_si64 (1);
__m64 m1 = _mm_cvtsi32_si64 (2);
__m64 m2 = _mm_cvtsi32_si64 (4);
m2 = _mm_add_pi8(m0, m1);
int value = _mm_cvtsi64_si32(m2);
//_mm_empty();
return value;
}
> icl -c diag963.cpp
Intel(R) C++ Compiler for applications running on IA-32, Version 10.1 Build 2
0080602 Package ID: w_cc_p_10.1.022
Copyright (C) 1985-2008 Intel Corporation. All rights reserved.
diag963.cpp
diag963.cpp(14) (col. 9): warning #963: no EMMS instruction before return
Resolution:
Use the EMMS instruction (e.g. by calling the _mm_empty() intrinsic ) after the MMX instructions before the return to restore the Floating-point status on the CPU.
Do you need more help?
This article applies to: Intel® C++ Compiler for Linux* Knowledge Base, Intel® C++ Compiler for Mac OS X* Knowledge Base, Intel® C++ Compiler for Windows* Knowledge Base, Intel® Parallel Composer Knowledge Base
For more complete information about compiler optimizations, see our Optimization Notice.
Comments (0) 
Trackbacks (0)
Leave a comment 
To obtain technical support, please go to Software Support.
Author
Jennifer Jiang (Intel)
| ||
Mark Sabahi (Intel)
|

