Fixed reference SIMD code to work with MSVC

Also noted minor issue with rounding to even. Using rint would be
preferable, but that's even harder to work around on MSVC.

Change-Id: I495cf2d43cf0b33cc0896958f15703ba8632c7e4