[FFmpeg-devel] Patch: Inline asm fixes for Intel compiler on Windows

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Feb 9 08:43:58 CET 2014


Matt Oliver <protogonoi <at> gmail.com> writes:

> Patch 1: add missing external declarations (unmodified from 
> previous)

> + extern uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63];

Is including cabac_functions.h an alternative?

> //Declared in swscale_mmx.c (and referenced from rgb2rgb_template.c)

s/swscale_mmx.c/swscale.c

> Patch 3: Asm direct symbol reference check and support 
> (rebased with minor addition to yuv2rgb_template.c that 
> fixes previous Patch 5 issue)

> +check_cc <<EOF && enable inline_asm_direct_symbol_refs
> +void foo(void){ int test; __asm__ volatile("movl test, %eax"); }
> +EOF

Please simplify as discussed.

> Patch 4: Workaround for "register allocation failed" errors 
> found in intel compiler  (unmodified from previous)

+#if   (defined(__INTEL_COMPILER) && defined(_MSC_VER))
+#       define BROKEN_REGISTER_ALLOCATION 1
+#else
+#       define BROKEN_REGISTER_ALLOCATION 0
+#endif

+#if   (defined(__INTEL_COMPILER) && defined(_MSC_VER) && ARCH_X86_64)
+#       define BROKEN_REGISTER_ALLOCATION 1
+#else
+#       define BROKEN_REGISTER_ALLOCATION 0
+#endif

I still wonder why this has to be duplicated.

> Patch 5: Fixed 64bit conformance with movzbl. Fixes 
> "Unsupported instruction form in asm instruction movzbl" 
> found in intel compiler.

(I probably just don't understand this patch:)

> -        "movzb %%al, %%"REG_a"          \n\t" // last_non_zero_p1
> +        "movzbl %%al, %%eax             \n\t" // last_non_zero_p1

Why isn't the new line also using '%%"REG_a"'?

Carl Eugen



More information about the ffmpeg-devel mailing list