In the traditional PC games and multimedia applications, lots of SIMD code has been used for performance improvement. SIMD（Single Instruction Multiple Data）can copy multiple data, in a synchronous manner, execute the same instructions at the same time. It particularly suitable for data intensive computing such as multimedia applications，SIMD has implement by AMD and INTEL such as 3DNow!、SSE。
But if porting these SIMD improvement codes to android x86 platform, most code we have to give up，the reason is：NDK has no NASM compiler(it only supports AT&T)。
Yasm is a complete rewrite of the NASM assembler under the “new” BSD License (some portions are under other licenses, see COPYING for details).
Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats.
The official Yasm address is http://yasm.tortall.net
Yasm also provides some commonly used mathematical functions, such as FFT transformation, developer only needs to directly call these functions in order to obtain the best performance. The well-known open source projects which use yasm compiler are：FFMPEG，X264，MPC-HC.
In the case of FFMPEG porting, generally it needs to add -disable-yasm option, if compiling arm version，it’s right and must（arm using neon）. But if compiling x86 version, disable-yasm will discard a large number of optimized code which will significantly reduce performance. We are need adding ASM assembly support on android ndk in urgent.
We use the windows version of ndk-r8 as an example, the mainly modification part is “android-ndk-r8\build\core”.
all_source_extensions := .c .s .S $(LOCAL_CPP_EXTENSION) =>
all_source_extensions := .c .s .asm .S $(LOCAL_CPP_EXTENSION)
add compile-asm-source after # Build the sources to object files
New compile-asm-source (can reference compile-c-source)
Add .asm in “get-object-name”
Add LOCAL_YASMFLAGS，it the same with LOCAL_C_FLAGS, but for .asm file while not .c file
Add TARGET_ASM = $(TOOLCHAIN_PREFIX)yasm
Download yasm compiler in http://yasm.tortall.net，if you use windows ndkbuild，you can download win32 yasm compiler. Otherwise, you can download linux version yasm compiler.
If using win32 yasm compiler, rename it to yasm.exe and copy it to android-ndk-r8\toolchains\x86-4.4.3\prebuilt\windows\i686-android-linux\bin,and also rename it to i686-android-linux-yasm.exe , copy it to android-ndk-r8\toolchains\x86-4.4.3\prebuilt\ windows\bin。
3. recompile ffmpeg using yasm compiler
do not add –disbale-yasm, reconfigure ffmpeg. You can see in config.h, #define HAVE_YASM 1; in config.mk contains HAVE_YASM=yes.
Define LOCAL_YASMFLAGS = -DANDROID -DPIC -DHAVE_AV_CONFIG_H -DARCH_X86_32 and then do ndk-build. You can get full optimization lib the same as PC x86 version.