Ticket #5911: goom-mmxext-amd64-fix.patch

File goom-mmxext-amd64-fix.patch, 1.8 KB (added by foobum@…, 15 years ago)
  • mythplugins/mythmusic/mythmusic/goom/zoom_filter_xmmx.c

    diff --git a/mythplugins/mythmusic/mythmusic/goom/zoom_filter_xmmx.c b/mythplugins/mythmusic/mythmusic/goom/zoom_filter_xmmx.c
    index 3e257fb..53e351f 100644
    a b  
    11#include <mythtv/mythconfig.h>
    22
    3 #if defined(MMX) && !defined(ARCH_X86_64)
     3#if defined(MMX)
    44/* a definir pour avoir exactement le meme resultat que la fonction C
    55 * (un chouillat plus lent)
    66 */
     
    1717// faire : a / sqrtperte <=> a >> PERTEDEC
    1818#define PERTEDEC 4
    1919
     20#ifdef ARCH_X86_64
     21#define REG_c "rcx"
     22#define REG_a "rax"
     23#elif
     24#define REG_c "ecx"
     25#define REG_a "eax"
     26#endif
    2027
    2128//#define MMX_TRACE
    2229#include "mmx.h"
    void zoom_filter_xmmx (int prevX, int prevY, 
    115122                                "movd %%mm0,%%ecx\n"
    116123                                "movq %%mm0,%%mm1\n"
    117124
    118                                 "andl $15,%%ecx\n"
     125                                "and $15,%%"REG_c"\n"
    119126                                "psrlq $32,%%mm1\n"
    120127
    121                                 "shll $6,%%ecx\n"
     128                                "shl $6,%%"REG_c"\n"
    122129                                "movd %%mm1,%%eax\n"
    123130
    124                                 "addl %0,%%ecx\n"
    125                                 "andl $15,%%eax\n"
     131                                "add %0,%%"REG_c"\n"
     132                                "and $15,%%"REG_a"\n"
    126133
    127                                 "movd (%%ecx,%%eax,4),%%mm3\n"
     134                                "movd (%%"REG_c",%%"REG_a",4),%%mm3\n"
    128135                                /* ::"X"(precalCoef):"eax","ecx"); */
    129                                 ::"m"(precalCoef):"eax","ecx");
     136                                ::"m"(precalCoef):REG_a,REG_c);
    130137                               
    131138
    132139                        /*
    void zoom_filter_xmmx (int prevX, int prevY, 
    171178                                /*^*/ "movq %%mm3,%%mm4\n"       /*^*/
    172179                                /*^*/ "movq %%mm3,%%mm5\n"       /*^*/
    173180
    174                                 "movl %0,%%ecx\n"
     181                                "mov %0,%%"REG_c"\n"
    175182                                /*^*/ "punpcklbw %%mm5,%%mm3\n"  /*^*/
    176183
    177                                 "movq (%%ecx,%%eax,4),%%mm0\n"
     184                                "movq (%%"REG_c",%%"REG_a",4),%%mm0\n"
    178185                                /*^*/ "punpckhbw %%mm5,%%mm4\n"  /*^*/
    179186
    180187                                "addl %1,%%eax\n"
    181                                 "movq (%%ecx,%%eax,4),%%mm2\n"
     188                                "movq (%%"REG_c",%%"REG_a",4),%%mm2\n"
    182189                               
    183190                                : : "X"(expix1), "X"(prevX):"eax","ecx"
    184191                                );