[CPU] Fix f16 pack rounding and SHORT_2 test input

Add round-to-nearest-even to the fast float16 pack path by folding a
0xFFF rounding bias into XMMF16PackLCPI0 and extracting bit 13 of the
source as the tie-breaker, matching the software fallback behavior.

Fix PACK_SHORT_2 test to use pre-biased float input (0x40400000 = 3.0)
as the hardware expects, rather than raw 0.0f which is out of range.
This commit is contained in:
Herman S.
2026-02-12 09:59:58 +09:00
parent bb70e5c651
commit 11815400cd
3 changed files with 20 additions and 10 deletions

View File

@@ -1152,8 +1152,8 @@ static const vec128_t xmm_consts[] = {
*/
vec128q(0x7fe000007fe000ULL),
/* XMMF16PackLCPI0*/
vec128i(0x8000000),
/* XMMF16PackLCPI0 (bias + round-half-down) */
vec128i(0x8000FFF),
/*XMMF16PackLCPI2*/
vec128i(0x47ffe000),
/*XMMF16PackLCPI3*/