[MPlayer-dev-eng] RPMs for MPlayer-0.50
Arpi
arpi at thot.banki.hu
Fri Oct 19 00:51:56 CEST 2001
Hi,
> Okay, some changes came in after my cvs update, and I didn't update again
> before the diff. I'll fix things up and get the new code changed over. I
> see the macro/3dnow issues you were talking about, and I'm cleaning that up.
and, you should keep the option of cpu selection at compile time!
(it was discussed earlier - using #ifdefs)
when it's hard to separate code, it's better to change code to template,
and include it many times with different cpu flags set and changing
function name. good example is postprocessing code.
for example:
xxx.c:
#ifdef RUNTIME_CPU_DETECT
#define FUNC xxx_func_c
#undef HAVE_MMX
#undef HAVE_MMX2
#undef HAVE_3DNOW
#include "xxx_tmpl.h"
#define FUNC xxx_func_mmx
#define HAVE_MMX
#undef HAVE_SSE
#undef HAVE_3DNOW
#include "xxx_tmpl.h"
#define FUNC xxx_func_sse
#define HAVE_MMX
#define HAVE_SSE
#undef HAVE_3DNOW
#include "xxx_tmpl.h"
#define FUNC xxx_func_3dnow
#define HAVE_MMX
#undef HAVE_SSE
#define HAVE_3DNOW
#include "xxx_tmpl.h"
// define and set up function pointer to the right one depending on cpudetect
...
#else
#include "config.h"
#define FUNC xxx_func
#include "xxx_tmpl.h"
#endif
xxx_tmpl.h:
int FUNC_NAME(int a,int b){
...
#ifdef HAVE_3DNOW
...
...
#endif
...
...
}
i'm sure it's the cleanest way to solve this.
many projects uses it, for example MESA.
note: if you gonna do it this way - it needs more that a patch.
it may requires renaming files in the CVS to keep log history.
A'rpi / Astral & ESP-team
--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu
More information about the MPlayer-dev-eng
mailing list