View Single Post
Old 26th March 2007, 23:39   #1  |  Link
morph166955
Registered User
 
Join Date: Mar 2006
Posts: 443
ffmpeg/libavcodec assembly DOES NOT WORK FOR CORE2!

I have now spent about a month rebuilding and reworking gcc and every other possible thing to get mplayer/mencoder to compile libavcodec with march/mtune being set to core2...it DOESNT WORK. I have searched through everything I can and I have come to the conclusion that the assembly code in libavcodec is incompatibile with the core2's design. The core2 architecture utilizes technology that has up until now not been utilized (such as 128 bit execution channels as opposed to the 64 bit ones that have been used on all the previous processors) and I believe that is the case that we are seeing here.

I found a bug on gcc's bugzilla here http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203 which directly discusses the offending file/function and it has a post as recent as feb 2007 (the thread was originally started in 2004). I've posted bug reports up on the bugzilla for ffmpeg/mplayer and they have been closed because they were supposedly "problems with the compiler".

Being that this is the new processor architecture and that mplayer/mencoder/ffmpeg is a pretty important piece of software, I come here to ask anyone who knows what their doing in assembly to give me a hand in fixing this so that we can use the benefits of the core2. I have had significant experience in writing C/C++ programs, I have not however had any experience (other then the limited experience from the past month) in handling assembly (specifically assembly involving mmx specific calls) inside of C. I have written programs in raw assembly (very basic stuff, had a class on it a few years back while getting my degree) so I understand what its trying to do, I just am not sure how its doing it all.

The problem lies as best as I can tell in libavcodec/i386/dsputil_mmx.c around line 636 with the assembly in function transpose4x4(). the failure occurs when it is called by h264_h_loop_filter_luma_mmx2 (or h264_loop_filter_luma_mmx2 depending on what optimization setting I use in gcc) in libavcodec/i386h264dsp_mmx.c on line 449. The error that gcc spits out is:

Code:
i386/h264dsp_mmx.c: In function 'h264_h_loop_filter_luma_mmx2':
i386/dsputil_mmx.c:636: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i386/dsputil_mmx.c:636: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/h264dsp_mmx.c:393: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/h264dsp_mmx.c:393: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
i386/dsputil_mmx.c:636: error: 'asm' operand has impossible constraints
Everything else that I have compiled with gcc 4.3 that has core2 enabled has worked with out a problem (x264 being a prime example of this since the h264 function is whats failing). I am asking anyone who knows what their doing to take a look at this because I have hit the limit of what I can do with this and what I can spend time wise in getting this to work.

Thank you in advance.
morph166955 is offline   Reply With Quote