[FFmpeg-devel] [PATCH] detect support for 10 operands in configure

Michael Niedermayer michaelni
Mon Feb 9 21:55:15 CET 2009


On Mon, Feb 09, 2009 at 01:50:58PM +0100, Diego Biurrun wrote:
> I think this is the proper solution for the gcc 2.95 breakage that just
> occurred.  Probably there is a better way to write the check, but it
> seems to work and I know no Assembler.
> 
> Note that the -O1 flag is necessary, otherwise gcc throws one of its
> dreaded GENERAL_REGS errors.
> 
> Diego

> Index: configure
> ===================================================================
> --- configure	(revision 17097)
> +++ configure	(working copy)
> @@ -898,6 +900,7 @@
>      sys_select_h
>      sys_soundcard_h
>      sys_videoio_h
> +    ten_operands
>      termios_h
>      threads
>      truncf
> @@ -1778,6 +1782,20 @@
>      # check wether EBX is available on x86
>      check_asm ebx_available '"":::"%ebx"'
>  
> +    # check whether more than 10 operands are supported
> +    check_cc -O1 <<EOF && enable ten_operands
> +int main(void)
> +{
> +    int x=0;
> +    __asm__ volatile(
> +        "nop\n"
> +        :"+&q"(x), "+&q"(x), "=&r"(x), "=&q"(x), "+&r"(x)
> +        :"r"(x), "r"(x), "rm"(x)
> +    );
> +    return 0;

just one small comment
i know there are gcc versions (3.?) that accept more than 10 but will
miscompile silently so IMHO this check is useless
iam not rejecting it just saying a gcc <3.4 will be more reliable and no
i dont remember which 3. version miscompiled such code ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090209/691b0d94/attachment.pgp>



More information about the ffmpeg-devel mailing list