xref: /aosp_15_r20/external/FP16/test/alt-to-fp32x2-psimd.cc (revision 5f32b7105932ea8520a0e8811c640f936367d707)
1*5f32b710SXin Li #include <gtest/gtest.h>
2*5f32b710SXin Li 
3*5f32b710SXin Li #include <cstdint>
4*5f32b710SXin Li 
5*5f32b710SXin Li #include <fp16.h>
6*5f32b710SXin Li #include <fp16/psimd.h>
7*5f32b710SXin Li 
8*5f32b710SXin Li 
TEST(FP16_ALT_TO_FP32x2_PSIMD,positive_normalized_values)9*5f32b710SXin Li TEST(FP16_ALT_TO_FP32x2_PSIMD, positive_normalized_values) {
10*5f32b710SXin Li 	const uint32_t exponentBias = 15;
11*5f32b710SXin Li 	for (int32_t e = -14; e <= 16; e++) {
12*5f32b710SXin Li 		for (uint16_t h = 0; h < 0x0400; h += 8) {
13*5f32b710SXin Li 			const psimd_u16 fp16 = {
14*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0),
15*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 1),
16*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 2),
17*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 3),
18*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 4),
19*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 5),
20*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 6),
21*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 7)
22*5f32b710SXin Li 			};
23*5f32b710SXin Li 			const psimd_u32x2 fp32 =
24*5f32b710SXin Li 				psimd_cast_f32x2_u32x2(fp16_alt_to_fp32x2_psimd(fp16));
25*5f32b710SXin Li 
26*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[0]), fp32.lo[0]) <<
27*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
28*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[0] << ", " <<
29*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[0] << ", " <<
30*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[0]);
31*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[1]), fp32.lo[1]) <<
32*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
33*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[1] << ", " <<
34*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[1] << ", " <<
35*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[1]);
36*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[2]), fp32.lo[2]) <<
37*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
38*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[2] << ", " <<
39*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[2] << ", " <<
40*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[2]);
41*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[3]), fp32.lo[3]) <<
42*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
43*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[3] << ", " <<
44*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[3] << ", " <<
45*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[3]);
46*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[4]), fp32.hi[0]) <<
47*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
48*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[4] << ", " <<
49*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[0] << ", " <<
50*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[4]);
51*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[5]), fp32.hi[1]) <<
52*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
53*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[5] << ", " <<
54*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[1] << ", " <<
55*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[5]);
56*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[6]), fp32.hi[2]) <<
57*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
58*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[6] << ", " <<
59*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[2] << ", " <<
60*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[6]);
61*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[7]), fp32.hi[3]) <<
62*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
63*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[7] << ", " <<
64*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[3] << ", " <<
65*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[7]);
66*5f32b710SXin Li 		}
67*5f32b710SXin Li 	}
68*5f32b710SXin Li }
69*5f32b710SXin Li 
TEST(FP16_ALT_TO_FP32x2_PSIMD,negative_normalized_values)70*5f32b710SXin Li TEST(FP16_ALT_TO_FP32x2_PSIMD, negative_normalized_values) {
71*5f32b710SXin Li 	const uint32_t exponentBias = 15;
72*5f32b710SXin Li 	for (int32_t e = -14; e <= 16; e++) {
73*5f32b710SXin Li 		for (uint16_t h = 0; h < 0x0400; h += 8) {
74*5f32b710SXin Li 			const psimd_u16 fp16 = {
75*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8000),
76*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8001),
77*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8002),
78*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8003),
79*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8004),
80*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8005),
81*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8006),
82*5f32b710SXin Li 				(uint16_t) (h + ((e + exponentBias) << 10) + 0x8007)
83*5f32b710SXin Li 			};
84*5f32b710SXin Li 			const psimd_u32x2 fp32 =
85*5f32b710SXin Li 				psimd_cast_f32x2_u32x2(fp16_alt_to_fp32x2_psimd(fp16));
86*5f32b710SXin Li 
87*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[0]), fp32.lo[0]) <<
88*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
89*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[0] << ", " <<
90*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[0] << ", " <<
91*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[0]);
92*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[1]), fp32.lo[1]) <<
93*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
94*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[1] << ", " <<
95*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[1] << ", " <<
96*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[1]);
97*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[2]), fp32.lo[2]) <<
98*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
99*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[2] << ", " <<
100*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[2] << ", " <<
101*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[2]);
102*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[3]), fp32.lo[3]) <<
103*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
104*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[3] << ", " <<
105*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.lo[3] << ", " <<
106*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[3]);
107*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[4]), fp32.hi[0]) <<
108*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
109*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[4] << ", " <<
110*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[0] << ", " <<
111*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[4]);
112*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[5]), fp32.hi[1]) <<
113*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
114*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[5] << ", " <<
115*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[1] << ", " <<
116*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[5]);
117*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[6]), fp32.hi[2]) <<
118*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
119*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[6] << ", " <<
120*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[2] << ", " <<
121*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[6]);
122*5f32b710SXin Li 			EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[7]), fp32.hi[3]) <<
123*5f32b710SXin Li 				std::hex << std::uppercase << std::setfill('0') <<
124*5f32b710SXin Li 				"F16 = 0x" << std::setw(4) << fp16[7] << ", " <<
125*5f32b710SXin Li 				"F32(F16) = 0x" << std::setw(8) << fp32.hi[3] << ", " <<
126*5f32b710SXin Li 				"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[7]);
127*5f32b710SXin Li 		}
128*5f32b710SXin Li 	}
129*5f32b710SXin Li }
130*5f32b710SXin Li 
TEST(FP16_ALT_TO_FP32x2_PSIMD,positive_denormalized_values)131*5f32b710SXin Li TEST(FP16_ALT_TO_FP32x2_PSIMD, positive_denormalized_values) {
132*5f32b710SXin Li 	for (uint16_t h = 0; h < 0x0400; h += 8) {
133*5f32b710SXin Li 		const psimd_u16 fp16 = {
134*5f32b710SXin Li 			(uint16_t) (h + 0),
135*5f32b710SXin Li 			(uint16_t) (h + 1),
136*5f32b710SXin Li 			(uint16_t) (h + 2),
137*5f32b710SXin Li 			(uint16_t) (h + 3),
138*5f32b710SXin Li 			(uint16_t) (h + 4),
139*5f32b710SXin Li 			(uint16_t) (h + 5),
140*5f32b710SXin Li 			(uint16_t) (h + 6),
141*5f32b710SXin Li 			(uint16_t) (h + 7)
142*5f32b710SXin Li 		};
143*5f32b710SXin Li 		const psimd_u32x2 fp32 =
144*5f32b710SXin Li 			psimd_cast_f32x2_u32x2(fp16_alt_to_fp32x2_psimd(fp16));
145*5f32b710SXin Li 
146*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[0]), fp32.lo[0]) <<
147*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
148*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[0] << ", " <<
149*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[0] << ", " <<
150*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[0]);
151*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[1]), fp32.lo[1]) <<
152*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
153*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[1] << ", " <<
154*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[1] << ", " <<
155*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[1]);
156*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[2]), fp32.lo[2]) <<
157*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
158*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[2] << ", " <<
159*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[2] << ", " <<
160*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[2]);
161*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[3]), fp32.lo[3]) <<
162*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
163*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[3] << ", " <<
164*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[3] << ", " <<
165*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[3]);
166*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[4]), fp32.hi[0]) <<
167*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
168*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[4] << ", " <<
169*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[0] << ", " <<
170*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[4]);
171*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[5]), fp32.hi[1]) <<
172*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
173*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[5] << ", " <<
174*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[1] << ", " <<
175*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[5]);
176*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[6]), fp32.hi[2]) <<
177*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
178*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[6] << ", " <<
179*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[2] << ", " <<
180*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[6]);
181*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[7]), fp32.hi[3]) <<
182*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
183*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[7] << ", " <<
184*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[3] << ", " <<
185*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[7]);
186*5f32b710SXin Li 	}
187*5f32b710SXin Li }
188*5f32b710SXin Li 
TEST(FP16_ALT_TO_FP32x2_PSIMD,negative_denormalized_values)189*5f32b710SXin Li TEST(FP16_ALT_TO_FP32x2_PSIMD, negative_denormalized_values) {
190*5f32b710SXin Li 	for (uint16_t h = 0; h < 0x0400; h += 8) {
191*5f32b710SXin Li 		const psimd_u16 fp16 = {
192*5f32b710SXin Li 			(uint16_t) (h + 0x8000),
193*5f32b710SXin Li 			(uint16_t) (h + 0x8001),
194*5f32b710SXin Li 			(uint16_t) (h + 0x8002),
195*5f32b710SXin Li 			(uint16_t) (h + 0x8003),
196*5f32b710SXin Li 			(uint16_t) (h + 0x8004),
197*5f32b710SXin Li 			(uint16_t) (h + 0x8005),
198*5f32b710SXin Li 			(uint16_t) (h + 0x8006),
199*5f32b710SXin Li 			(uint16_t) (h + 0x8007)
200*5f32b710SXin Li 		};
201*5f32b710SXin Li 		const psimd_u32x2 fp32 =
202*5f32b710SXin Li 			psimd_cast_f32x2_u32x2(fp16_alt_to_fp32x2_psimd(fp16));
203*5f32b710SXin Li 
204*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[0]), fp32.lo[0]) <<
205*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
206*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[0] << ", " <<
207*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[0] << ", " <<
208*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[0]);
209*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[1]), fp32.lo[1]) <<
210*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
211*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[1] << ", " <<
212*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[1] << ", " <<
213*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[1]);
214*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[2]), fp32.lo[2]) <<
215*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
216*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[2] << ", " <<
217*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[2] << ", " <<
218*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[2]);
219*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[3]), fp32.lo[3]) <<
220*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
221*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[3] << ", " <<
222*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.lo[3] << ", " <<
223*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[3]);
224*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[4]), fp32.hi[0]) <<
225*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
226*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[4] << ", " <<
227*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[0] << ", " <<
228*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[4]);
229*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[5]), fp32.hi[1]) <<
230*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
231*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[5] << ", " <<
232*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[1] << ", " <<
233*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[5]);
234*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[6]), fp32.hi[2]) <<
235*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
236*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[6] << ", " <<
237*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[2] << ", " <<
238*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[6]);
239*5f32b710SXin Li 		EXPECT_EQ(fp16_alt_to_fp32_bits(fp16[7]), fp32.hi[3]) <<
240*5f32b710SXin Li 			std::hex << std::uppercase << std::setfill('0') <<
241*5f32b710SXin Li 			"F16 = 0x" << std::setw(4) << fp16[7] << ", " <<
242*5f32b710SXin Li 			"F32(F16) = 0x" << std::setw(8) << fp32.hi[3] << ", " <<
243*5f32b710SXin Li 			"F32 = 0x" << std::setw(8) << fp16_alt_to_fp32_bits(fp16[7]);
244*5f32b710SXin Li 	}
245*5f32b710SXin Li }
246