X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=common%2Fosdep.c;h=d3bcd417110232971e1c6d2696a49d5405b079ce;hb=3902ae02a0edede5d6c44cb3ee9e24e618c66e6a;hp=e97aaeda11cd734f53bca0f9d9c4e08f8066ca14;hpb=807aeaaae7351e4c2c536463e69dacaac218bccb;p=x264 diff --git a/common/osdep.c b/common/osdep.c index e97aaeda..d3bcd417 100644 --- a/common/osdep.c +++ b/common/osdep.c @@ -1,7 +1,7 @@ /***************************************************************************** * osdep.c: platform-specific code ***************************************************************************** - * Copyright (C) 2003-2014 x264 project + * Copyright (C) 2003-2015 x264 project * * Authors: Steven Walters * Laurent Aimar @@ -94,51 +94,6 @@ int x264_threading_init( void ) } #endif -#if HAVE_MMX -#ifdef __INTEL_COMPILER -/* Agner's patch to Intel's CPU dispatcher from pages 131-132 of - * http://agner.org/optimize/optimizing_cpp.pdf (2011-01-30) - * adapted to x264's cpu schema. */ - -// Global variable indicating cpu -int __intel_cpu_indicator = 0; -// CPU dispatcher function -void x264_intel_cpu_indicator_init( void ) -{ - unsigned int cpu = x264_cpu_detect(); - if( cpu&X264_CPU_AVX ) - __intel_cpu_indicator = 0x20000; - else if( cpu&X264_CPU_SSE42 ) - __intel_cpu_indicator = 0x8000; - else if( cpu&X264_CPU_SSE4 ) - __intel_cpu_indicator = 0x2000; - else if( cpu&X264_CPU_SSSE3 ) - __intel_cpu_indicator = 0x1000; - else if( cpu&X264_CPU_SSE3 ) - __intel_cpu_indicator = 0x800; - else if( cpu&X264_CPU_SSE2 && !(cpu&X264_CPU_SSE2_IS_SLOW) ) - __intel_cpu_indicator = 0x200; - else if( cpu&X264_CPU_SSE ) - __intel_cpu_indicator = 0x80; - else if( cpu&X264_CPU_MMX2 ) - __intel_cpu_indicator = 8; - else - __intel_cpu_indicator = 1; -} - -/* __intel_cpu_indicator_init appears to have a non-standard calling convention that - * assumes certain registers aren't preserved, so we'll route it through a function - * that backs up all the registers. */ -void __intel_cpu_indicator_init( void ) -{ - x264_safe_intel_cpu_indicator_init(); -} -#else -void x264_intel_cpu_indicator_init( void ) -{} -#endif -#endif - #ifdef _WIN32 /* Functions for dealing with Unicode on Windows. */ FILE *x264_fopen( const char *filename, const char *mode ) @@ -186,8 +141,12 @@ int x264_vfprintf( FILE *stream, const char *format, va_list arg ) { char buf[4096]; wchar_t buf_utf16[4096]; + va_list arg2; + + va_copy( arg2, arg ); + int length = vsnprintf( buf, sizeof(buf), format, arg2 ); + va_end( arg2 ); - int length = vsnprintf( buf, sizeof(buf), format, arg ); if( length > 0 && length < sizeof(buf) ) { /* WriteConsoleW is the most reliable way to output Unicode to a console. */