Ticket #1352: cpu-detect-0.19.patch

File cpu-detect-0.19.patch, 1.6 KB (added by dlesco@…, 18 years ago)

patch for x86_64 mmx cpu detection

  • .19/libs/libmythmpeg2/cpu_accel.c

    diff -r -u -x '*.o' mythtv-0.19/libs/libmythmpeg2/cpu_accel.c edited-mythtv-0.19/libs/libmythmpeg2/cpu_accel.c
    old new  
    212212
    213213    accel = 0;
    214214#ifdef ACCEL_DETECT
    215 #if defined (ARCH_X86) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
     215#if defined (ARCH_X86_64)
     216    accel = MPEG2_ACCEL_X86_MMX|MPEG2_ACCEL_X86_MMXEXT;
     217#elif defined (ARCH_X86) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC)
    216218    accel = arch_accel ();
    217219#endif
    218220#endif
  • .19/libs/libmythsoundtouch/cpu_detect_x86_gcc.cpp

    diff -r -u -x '*.o' mythtv-0.19/libs/libmythsoundtouch/cpu_detect_x86_gcc.cpp edited-mythtv-0.19/libs/libmythsoundtouch/cpu_detect_x86_gcc.cpp
    old new  
    7272/// Checks which instruction set extensions are supported by the CPU.
    7373uint detectCPUextensions(void)
    7474{
    75 #ifndef __i386__
     75#if defined(__SSE2__)
     76    // If compiled for x86_64 or an -march that has SSE2.
     77    // The cpu detect code here currently doesn't work on x86_64,
     78    // but x86_64 always has these instructions:
     79    return SUPPORT_SSE2|SUPPORT_SSE|SUPPORT_MMX;
     80#elif defined(__SSE__)
     81    // If compiled for -march supporting SSE.
     82    return SUPPORT_SSE|SUPPORT_MMX;
     83#elif ! defined(MMX)
    7684    return 0; // always disable extensions on non-x86 platforms.
    7785#else
    7886    uint res = 0;