move simd min common code to common file, fix includes