[FFmpeg-devel] [PATCH] Get rid of unused PREFETCHW and prefer MMX2 over 3DNow!

Zuxy Meng zuxy.meng
Sat Jan 9 15:57:19 CET 2010


2010/1/9 Michael Niedermayer <michaelni at gmx.at>:
> On Sat, Jan 09, 2010 at 10:47:31PM +0800, Zuxy Meng wrote:
>> 2010/1/9 Michael Niedermayer <michaelni at gmx.at>:
>> > On Sat, Jan 09, 2010 at 10:22:59PM +0800, Zuxy Meng wrote:
>> >> 2010/1/8 Michael Niedermayer <michaelni at gmx.at>:
>> >> > On Fri, Jan 08, 2010 at 11:37:17AM +0800, Zuxy Meng wrote:
>> >> >> Hi,
>> >> >>
>> >> >> We never used PREFETCHW in libswscale, and MMX2's prefetchnta is
>> >> >> preferrable than 3DNow!'s prefetch due to the former's non temporal
>> >> >> hint.
>> >> >>
>> >> >> --
>> >> >> Zuxy
>> >> >> Beauty is truth,
>> >> >> While truth is beauty.
>> >> >> PGP KeyID: E8555ED6
>> >> >
>> >> >> ?rgb2rgb_template.c | ? 12 ++++--------
>> >> >> ?swscale_template.c | ? 10 +++-------
>> >> >> ?2 files changed, 7 insertions(+), 15 deletions(-)
>> >> >> 596c1966a2582e14b7eec570fd57db77da8d8386 ?prefetch.diff
>> >> >> Index: libswscale/swscale_template.c
>> >> >> ===================================================================
>> >> >> --- libswscale/swscale_template.c ? ? (?? 30234)
>> >> >> +++ libswscale/swscale_template.c ? ? (??????)
>> >> >> @@ -25,17 +25,13 @@
>> >> >> ?#undef MOVNTQ
>> >> >> ?#undef PAVGB
>> >> >> ?#undef PREFETCH
>> >> >> -#undef PREFETCHW
>> >> >>
>> >> >> -#if COMPILE_TEMPLATE_AMD3DNOW
>> >> >> -#define PREFETCH ?"prefetch"
>> >> >> -#define PREFETCHW "prefetchw"
>> >> >> -#elif COMPILE_TEMPLATE_MMX2
>> >> >> +#if COMPILE_TEMPLATE_MMX2
>> >> >> ?#define PREFETCH "prefetchnta"
>> >> >> -#define PREFETCHW "prefetcht0"
>> >> >> +#elif COMPILE_TEMPLATE_AMD3DNOW
>> >> >> +#define PREFETCH ?"prefetch"
>> >> >> ?#else
>> >> >> ?#define PREFETCH ?" # nop"
>> >> >> -#define PREFETCHW " # nop"
>> >> >> ?#endif
>> >> >
>> >> > you are mixing 2 unrelated changes in one patch (which makes it unreadable)
>> >>
>> >> So the updated one that removes PREFETCHW only.
>> >> --
>> >> Zuxy
>> >> Beauty is truth,
>> >> While truth is beauty.
>> >> PGP KeyID: E8555ED6
>> >
>> >> ?rgb2rgb_template.c | ? ?4 ----
>> >> ?swscale_template.c | ? ?4 ----
>> >> ?2 files changed, 8 deletions(-)
>> >> 84258f05157cab9ee37b40695f974cc9bcf7a6cc ?prefetch.diff
>> >
>> > ok
>>
>> Applied. Now the other part that prefers MMX2 over 3DNow! because the
>> former's prefetchnta has a non temporal hint that is suitable to be
>> used with movntq.
>
> needs benchmark on a system where it makes a differences

Hmm I don't have an AMD CPU now but I guess the original intention was
to use a prefetch with non temporal hint, otherwise we'd use
prefetcht0 instead.
-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the ffmpeg-devel mailing list