rewrite some MMX code to intrinsics