[FFmpeg-cvslog] x86 cpuid: set vendor union members separately

Sean McGovern git at videolan.org
Fri Dec 9 00:18:55 CET 2011


ffmpeg | branch: master | Sean McGovern <gseanmcg at gmail.com> | Wed Dec  7 21:51:28 2011 +0000| [be0675ce672b7788b0f1277704be663f415d6498] | committer: Janne Grunau

x86 cpuid: set vendor union members separately

Solaris Studio (suncc) has difficulty with filling in
members of a union. Instead, let's retrieve and store the
cpuid() results separately. This is still a compiler bug,
however this fix does not cause a regression on other platforms.

Signed-off-by: Janne Grunau <janne-libav at jannau.net>

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

 libavutil/x86/cpu.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
index 3975e68..2424fe4 100644
--- a/libavutil/x86/cpu.c
+++ b/libavutil/x86/cpu.c
@@ -74,7 +74,10 @@ int ff_get_cpu_flags_x86(void)
         return 0; /* CPUID not supported */
 #endif
 
-    cpuid(0, max_std_level, vendor.i[0], vendor.i[2], vendor.i[1]);
+    cpuid(0, max_std_level, ebx, ecx, edx);
+    vendor.i[0] = ebx;
+    vendor.i[1] = edx;
+    vendor.i[2] = ecx;
 
     if(max_std_level >= 1){
         cpuid(1, eax, ebx, ecx, std_caps);



More information about the ffmpeg-cvslog mailing list