Handle AVX transitions correctly; massive speed improvements in some ASM code. Simplify some ASM using x86inc macros.