Use stable rounding mode for lower color precision

to_half uses rounding to the nearest int (ties to even), which matches
the IEEE behavior, so should be consistent with the scalar float to
half conversions even if __F16C__ is defined and someone has changed
the mm round mode.

Sk4f_toL32 switches lrint out for just adding .5. The pin now happens
as a floating-point pin, but we can't move it to after the byte cast
since we don't want 255.5+ to overflow and wrap. This will hopefully
restore some lost performance when we switched to always rounding
and pinning as part of SkNx->SkVx.

Bug: skia:13341
Change-Id: Ie584ddd14d46a0eb9ff6f2ef366ea683a0595572
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557616
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2 files changed