Lines Matching refs:FloatProxy

29 using spvutils::FloatProxy;
37 ::testing::TestWithParam<std::pair<FloatProxy<float>, std::string>>;
39 ::testing::TestWithParam<std::pair<std::string, FloatProxy<float>>>;
41 ::testing::TestWithParam<std::pair<FloatProxy<double>, std::string>>;
43 ::testing::TestWithParam<std::pair<std::string, FloatProxy<double>>>;
66 FloatProxy<T> Decode(const std::string& str) { in Decode()
67 spvutils::HexFloat<FloatProxy<T>> decoded(0.f); in Decode()
82 ::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
134 ::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
153 std::vector<std::pair<FloatProxy<double>, std::string>>({
226 std::pair<FloatProxy<double>, std::string>>({
245 << FloatProxy<float>(uint32_t(0xFF800100)) << " " << std::setw(4) << 9; in TEST()
252 << FloatProxy<double>(uint64_t(0x7FF0F00000000000LL)) << " " << std::setw(4) in TEST()
267 ::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
289 ::testing::ValuesIn(std::vector<std::pair<std::string, FloatProxy<float>>>({
300 std::vector<std::pair<std::string, FloatProxy<double>>>({
323 std::vector<std::pair<std::string, FloatProxy<double>>>({
331 TEST(FloatProxy, ValidConversion) { in TEST() argument
332 EXPECT_THAT(FloatProxy<float>(1.f).getAsFloat(), Eq(1.0f)); in TEST()
333 EXPECT_THAT(FloatProxy<float>(32.f).getAsFloat(), Eq(32.0f)); in TEST()
334 EXPECT_THAT(FloatProxy<float>(-1.f).getAsFloat(), Eq(-1.0f)); in TEST()
335 EXPECT_THAT(FloatProxy<float>(0.f).getAsFloat(), Eq(0.0f)); in TEST()
336 EXPECT_THAT(FloatProxy<float>(-0.f).getAsFloat(), Eq(-0.0f)); in TEST()
337 EXPECT_THAT(FloatProxy<float>(1.2e32f).getAsFloat(), Eq(1.2e32f)); in TEST()
339 EXPECT_TRUE(std::isinf(FloatProxy<float>(uint32_t(0xFF800000)).getAsFloat())); in TEST()
340 EXPECT_TRUE(std::isinf(FloatProxy<float>(uint32_t(0x7F800000)).getAsFloat())); in TEST()
341 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0xFFC00000)).getAsFloat())); in TEST()
342 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0xFF800100)).getAsFloat())); in TEST()
343 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0xFF800c00)).getAsFloat())); in TEST()
344 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0xFF80F000)).getAsFloat())); in TEST()
345 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0xFFFFFFFF)).getAsFloat())); in TEST()
346 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0x7FC00000)).getAsFloat())); in TEST()
347 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0x7F800100)).getAsFloat())); in TEST()
348 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0x7f800c00)).getAsFloat())); in TEST()
349 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0x7F80F000)).getAsFloat())); in TEST()
350 EXPECT_TRUE(std::isnan(FloatProxy<float>(uint32_t(0x7FFFFFFF)).getAsFloat())); in TEST()
352 EXPECT_THAT(FloatProxy<float>(uint32_t(0xFF800000)).data(), Eq(0xFF800000u)); in TEST()
353 EXPECT_THAT(FloatProxy<float>(uint32_t(0x7F800000)).data(), Eq(0x7F800000u)); in TEST()
354 EXPECT_THAT(FloatProxy<float>(uint32_t(0xFFC00000)).data(), Eq(0xFFC00000u)); in TEST()
355 EXPECT_THAT(FloatProxy<float>(uint32_t(0xFF800100)).data(), Eq(0xFF800100u)); in TEST()
356 EXPECT_THAT(FloatProxy<float>(uint32_t(0xFF800c00)).data(), Eq(0xFF800c00u)); in TEST()
357 EXPECT_THAT(FloatProxy<float>(uint32_t(0xFF80F000)).data(), Eq(0xFF80F000u)); in TEST()
358 EXPECT_THAT(FloatProxy<float>(uint32_t(0xFFFFFFFF)).data(), Eq(0xFFFFFFFFu)); in TEST()
359 EXPECT_THAT(FloatProxy<float>(uint32_t(0x7FC00000)).data(), Eq(0x7FC00000u)); in TEST()
360 EXPECT_THAT(FloatProxy<float>(uint32_t(0x7F800100)).data(), Eq(0x7F800100u)); in TEST()
361 EXPECT_THAT(FloatProxy<float>(uint32_t(0x7f800c00)).data(), Eq(0x7f800c00u)); in TEST()
362 EXPECT_THAT(FloatProxy<float>(uint32_t(0x7F80F000)).data(), Eq(0x7F80F000u)); in TEST()
363 EXPECT_THAT(FloatProxy<float>(uint32_t(0x7FFFFFFF)).data(), Eq(0x7FFFFFFFu)); in TEST()
366 TEST(FloatProxy, Nan) { in TEST() argument
367 EXPECT_TRUE(FloatProxy<float>(uint32_t(0xFFC00000)).isNan()); in TEST()
368 EXPECT_TRUE(FloatProxy<float>(uint32_t(0xFF800100)).isNan()); in TEST()
369 EXPECT_TRUE(FloatProxy<float>(uint32_t(0xFF800c00)).isNan()); in TEST()
370 EXPECT_TRUE(FloatProxy<float>(uint32_t(0xFF80F000)).isNan()); in TEST()
371 EXPECT_TRUE(FloatProxy<float>(uint32_t(0xFFFFFFFF)).isNan()); in TEST()
372 EXPECT_TRUE(FloatProxy<float>(uint32_t(0x7FC00000)).isNan()); in TEST()
373 EXPECT_TRUE(FloatProxy<float>(uint32_t(0x7F800100)).isNan()); in TEST()
374 EXPECT_TRUE(FloatProxy<float>(uint32_t(0x7f800c00)).isNan()); in TEST()
375 EXPECT_TRUE(FloatProxy<float>(uint32_t(0x7F80F000)).isNan()); in TEST()
376 EXPECT_TRUE(FloatProxy<float>(uint32_t(0x7FFFFFFF)).isNan()); in TEST()
379 TEST(FloatProxy, Negation) { in TEST() argument
380 EXPECT_THAT((-FloatProxy<float>(1.f)).getAsFloat(), Eq(-1.0f)); in TEST()
381 EXPECT_THAT((-FloatProxy<float>(0.f)).getAsFloat(), Eq(-0.0f)); in TEST()
383 EXPECT_THAT((-FloatProxy<float>(-1.f)).getAsFloat(), Eq(1.0f)); in TEST()
384 EXPECT_THAT((-FloatProxy<float>(-0.f)).getAsFloat(), Eq(0.0f)); in TEST()
386 EXPECT_THAT((-FloatProxy<float>(32.f)).getAsFloat(), Eq(-32.0f)); in TEST()
387 EXPECT_THAT((-FloatProxy<float>(-32.f)).getAsFloat(), Eq(32.0f)); in TEST()
389 EXPECT_THAT((-FloatProxy<float>(1.2e32f)).getAsFloat(), Eq(-1.2e32f)); in TEST()
390 EXPECT_THAT((-FloatProxy<float>(-1.2e32f)).getAsFloat(), Eq(1.2e32f)); in TEST()
393 (-FloatProxy<float>(std::numeric_limits<float>::infinity())).getAsFloat(), in TEST()
395 EXPECT_THAT((-FloatProxy<float>(-std::numeric_limits<float>::infinity())) in TEST()
407 ::testing::TestWithParam<std::pair<FloatProxy<float>, std::string>>;
409 ::testing::TestWithParam<std::pair<FloatProxy<double>, std::string>>;
470 ::testing::ValuesIn(std::vector<std::pair<FloatProxy<float>, std::string>>({
493 {FloatProxy<float>(uint32_t(0xFFC00000)), "-0x1.8p+128"},
494 {FloatProxy<float>(uint32_t(0xFF800100)), "-0x1.0002p+128"},
503 std::vector<std::pair<FloatProxy<double>, std::string>>({
540 return spvutils::HexFloat<spvutils::FloatProxy<float>>( in unbiased_exponent()
545 return spvutils::HexFloat<spvutils::FloatProxy<spvutils::Float16>>(f) in unbiased_half_exponent()
595 return spvutils::HexFloat<spvutils::FloatProxy<float>>( in normalized_significand()
648 spvutils::HexFloat<spvutils::FloatProxy<float>> f(0.f); in set_from_sign()
689 using HF = spvutils::HexFloat<spvutils::FloatProxy<float>>; in TEST()
738 using HF = spvutils::HexFloat<spvutils::FloatProxy<float>>; in TEST_P()
739 using HF16 = spvutils::HexFloat<spvutils::FloatProxy<spvutils::Float16>>; in TEST_P()
807 using HF = spvutils::HexFloat<spvutils::FloatProxy<float>>; in TEST_P()
808 using HF16 = spvutils::HexFloat<spvutils::FloatProxy<spvutils::Float16>>; in TEST_P()
866 using HF = spvutils::HexFloat<spvutils::FloatProxy<float>>; in TEST_P()
867 using HF16 = spvutils::HexFloat<spvutils::FloatProxy<spvutils::Float16>>; in TEST_P()
926 using HF = spvutils::HexFloat<spvutils::FloatProxy<float>>; in TEST_P()
927 using HF16 = spvutils::HexFloat<spvutils::FloatProxy<spvutils::Float16>>; in TEST_P()
971 using HF = spvutils::HexFloat<spvutils::FloatProxy<float>>; in TEST()
972 using HF16 = spvutils::HexFloat<spvutils::FloatProxy<spvutils::Float16>>; in TEST()
1007 HexFloat<FloatProxy<T>> expected_value;
1014 HexFloat<FloatProxy<float>> parsed_value(0.0f); in TEST_P()
1030 HexFloat<FloatProxy<T>> proxy_expected_value(expected_value); in BadFloatParseCase()
1038 HexFloat<FloatProxy<T>> proxy_expected_value(expected_value); in GoodFloatParseCase()
1081 HexFloat<FloatProxy<Float16>> parsed_value(0); in TEST_P()
1132 HexFloat<FloatProxy<float>> value(0.0f); in TEST_P()
1159 HexFloat<FloatProxy<double>> value(0.0); in TEST_P()
1186 HexFloat<FloatProxy<Float16>> value(0); in TEST_P()
1212 TEST(FloatProxy, Max) { in TEST() argument
1213 EXPECT_THAT(FloatProxy<Float16>::max().getAsFloat().get_value(), in TEST()
1215 EXPECT_THAT(FloatProxy<float>::max().getAsFloat(), in TEST()
1217 EXPECT_THAT(FloatProxy<double>::max().getAsFloat(), in TEST()
1221 TEST(FloatProxy, Lowest) { in TEST() argument
1222 EXPECT_THAT(FloatProxy<Float16>::lowest().getAsFloat().get_value(), in TEST()
1224 EXPECT_THAT(FloatProxy<float>::lowest().getAsFloat(), in TEST()
1226 EXPECT_THAT(FloatProxy<double>::lowest().getAsFloat(), in TEST()