• Home
  • Raw
  • Download

Lines Matching refs:int128

484   absl::int128 nonnegative_signed_values[] = {  in TEST()
491 for (absl::int128 value : nonnegative_signed_values) { in TEST()
492 EXPECT_EQ(value, absl::int128(absl::uint128(value))); in TEST()
496 EXPECT_EQ(value, absl::int128(assigned_value)); in TEST()
499 absl::int128 negative_values[] = { in TEST()
503 for (absl::int128 value : negative_values) { in TEST()
518 static_assert(std::is_constructible<absl::int128, TypeParam>::value, in TYPED_TEST()
520 static_assert(std::is_assignable<absl::int128&, TypeParam>::value, in TYPED_TEST()
522 static_assert(!std::is_assignable<TypeParam&, absl::int128>::value, in TYPED_TEST()
532 static_assert(std::is_constructible<absl::int128, TypeParam>::value, in TYPED_TEST()
534 static_assert(!std::is_assignable<absl::int128&, TypeParam>::value, in TYPED_TEST()
536 static_assert(!std::is_assignable<TypeParam&, absl::int128>::value, in TYPED_TEST()
544 static_assert(std::is_constructible<absl::int128, __int128>::value, in TEST()
546 static_assert(std::is_assignable<absl::int128&, __int128>::value, in TEST()
548 static_assert(!std::is_assignable<__int128&, absl::int128>::value, in TEST()
551 static_assert(std::is_constructible<absl::int128, unsigned __int128>::value, in TEST()
553 static_assert(!std::is_assignable<absl::int128&, unsigned __int128>::value, in TEST()
555 static_assert(!std::is_assignable<unsigned __int128&, absl::int128>::value, in TEST()
561 static_assert(absl::is_trivially_default_constructible<absl::int128>::value, in TEST()
563 static_assert(absl::is_trivially_copy_constructible<absl::int128>::value, ""); in TEST()
564 static_assert(absl::is_trivially_copy_assignable<absl::int128>::value, ""); in TEST()
565 static_assert(std::is_trivially_destructible<absl::int128>::value, ""); in TEST()
569 EXPECT_FALSE(absl::int128(0)); in TEST()
578 EXPECT_EQ(absl::int128(1), absl::int128(true)); in TEST()
579 EXPECT_EQ(absl::int128(0), absl::int128(false)); in TEST()
588 EXPECT_EQ(TypeParam{0}, static_cast<TypeParam>(absl::int128(0))); in TYPED_TEST()
591 absl::int128(std::numeric_limits<TypeParam>::min()))); in TYPED_TEST()
594 absl::int128(std::numeric_limits<TypeParam>::max()))); in TYPED_TEST()
609 absl::int128 int_value = absl::int128(0x9f5b) << i; in TYPED_TEST()
613 EXPECT_EQ(int_value, absl::int128(float_value)); in TYPED_TEST()
614 EXPECT_EQ(-int_value, absl::int128(-float_value)); in TYPED_TEST()
628 EXPECT_DOUBLE_EQ(fvalue, static_cast<TypeParam>(absl::int128(fvalue))); in TYPED_TEST()
629 EXPECT_DOUBLE_EQ(-fvalue, static_cast<TypeParam>(-absl::int128(fvalue))); in TYPED_TEST()
630 EXPECT_DOUBLE_EQ(-fvalue, static_cast<TypeParam>(absl::int128(-fvalue))); in TYPED_TEST()
631 EXPECT_DOUBLE_EQ(fvalue, static_cast<TypeParam>(-absl::int128(-fvalue))); in TYPED_TEST()
636 absl::int128 large_values[] = { in TYPED_TEST()
641 for (absl::int128 value : large_values) { in TYPED_TEST()
646 value |= absl::int128(1) << (std::numeric_limits<TypeParam>::digits - 1); in TYPED_TEST()
649 absl::int128 int_value = value << i; in TYPED_TEST()
651 static_cast<absl::int128>(static_cast<TypeParam>(int_value))); in TYPED_TEST()
653 static_cast<absl::int128>(static_cast<TypeParam>(-int_value))); in TYPED_TEST()
658 EXPECT_EQ(0, absl::int128(TypeParam(0.1))); in TYPED_TEST()
659 EXPECT_EQ(17, absl::int128(TypeParam(17.8))); in TYPED_TEST()
660 EXPECT_EQ(0, absl::int128(TypeParam(-0.8))); in TYPED_TEST()
661 EXPECT_EQ(-53, absl::int128(TypeParam(-53.1))); in TYPED_TEST()
662 EXPECT_EQ(0, absl::int128(TypeParam(0.5))); in TYPED_TEST()
663 EXPECT_EQ(0, absl::int128(TypeParam(-0.5))); in TYPED_TEST()
665 EXPECT_EQ(0, absl::int128(just_lt_one)); in TYPED_TEST()
667 EXPECT_EQ(0, absl::int128(just_gt_minus_one)); in TYPED_TEST()
677 EXPECT_EQ(absl::int128(-1), absl::MakeInt128(-1, -1)); in TEST()
678 EXPECT_EQ(absl::int128(-31), absl::MakeInt128(-1, -31)); in TEST()
679 EXPECT_EQ(absl::int128(std::numeric_limits<int64_t>::min()), in TEST()
681 EXPECT_EQ(absl::int128(0), absl::MakeInt128(0, 0)); in TEST()
682 EXPECT_EQ(absl::int128(1), absl::MakeInt128(0, 1)); in TEST()
683 EXPECT_EQ(absl::int128(std::numeric_limits<int64_t>::max()), in TEST()
694 absl::int128 value = absl::MakeInt128(pair.high, pair.low); in TEST()
710 absl::int128 custom = in TEST()
713 EXPECT_EQ(custom, absl::int128(intrinsic)); in TEST()
719 constexpr absl::int128 zero = absl::int128(); in TEST()
720 constexpr absl::int128 one = 1; in TEST()
721 constexpr absl::int128 minus_two = -2; in TEST()
722 constexpr absl::int128 min = absl::Int128Min(); in TEST()
723 constexpr absl::int128 max = absl::Int128Max(); in TEST()
724 EXPECT_EQ(zero, absl::int128(0)); in TEST()
725 EXPECT_EQ(one, absl::int128(1)); in TEST()
733 absl::int128 smaller; in TEST()
734 absl::int128 larger; in TEST()
737 {absl::int128(0), absl::int128(123)}, in TEST()
778 EXPECT_EQ(absl::int128(-value), -absl::int128(value)); in TEST()
779 EXPECT_EQ(absl::int128(value), -absl::int128(-value)); in TEST()
786 EXPECT_TRUE(!absl::int128(0)); in TEST()
813 EXPECT_EQ(absl::int128(pair.first + pair.second), in TEST()
814 absl::int128(pair.first) + absl::int128(pair.second)); in TEST()
815 EXPECT_EQ(absl::int128(pair.second + pair.first), in TEST()
816 absl::int128(pair.second) += absl::int128(pair.first)); in TEST()
818 EXPECT_EQ(absl::int128(pair.first - pair.second), in TEST()
819 absl::int128(pair.first) - absl::int128(pair.second)); in TEST()
820 EXPECT_EQ(absl::int128(pair.second - pair.first), in TEST()
821 absl::int128(pair.second) -= absl::int128(pair.first)); in TEST()
845 absl::int128 value = 0; in TEST()
861 absl::int128 a = absl::int128(1) << i; in TEST()
862 absl::int128 b = absl::int128(1) << j; in TEST()
863 absl::int128 c = absl::int128(1) << (i + j); in TEST()
870 EXPECT_EQ(c, absl::int128(a) *= b); in TEST()
871 EXPECT_EQ(-c, absl::int128(-a) *= b); in TEST()
872 EXPECT_EQ(-c, absl::int128(a) *= -b); in TEST()
873 EXPECT_EQ(c, absl::int128(-a) *= -b); in TEST()
888 EXPECT_EQ(absl::int128(pair.first * pair.second), in TEST()
889 absl::int128(pair.first) * absl::int128(pair.second)); in TEST()
890 EXPECT_EQ(absl::int128(pair.first * pair.second), in TEST()
891 absl::int128(pair.first) *= absl::int128(pair.second)); in TEST()
894 absl::MakeInt128(pair.first, 0) * absl::int128(pair.second)); in TEST()
896 absl::MakeInt128(pair.first, 0) *= absl::int128(pair.second)); in TEST()
910 absl::int128 a = absl::int128(pair.first << 32); in TEST()
911 absl::int128 b = absl::int128(pair.second << 32); in TEST()
912 absl::int128 c = absl::MakeInt128(pair.first * pair.second, 0); in TEST()
919 EXPECT_EQ(c, absl::int128(a) *= b); in TEST()
920 EXPECT_EQ(-c, absl::int128(-a) *= b); in TEST()
921 EXPECT_EQ(-c, absl::int128(a) *= -b); in TEST()
922 EXPECT_EQ(c, absl::int128(-a) *= -b); in TEST()
926 absl::int128 large_values[] = { in TEST()
932 for (absl::int128 value : large_values) { in TEST()
935 EXPECT_EQ(0, absl::int128(0) *= value); in TEST()
940 EXPECT_EQ(value, absl::int128(1) *= value); in TEST()
945 EXPECT_EQ(-value, absl::int128(-1) *= value); in TEST()
964 absl::int128(0xa9b98a8ddf66bc) *= in TEST()
967 absl::int128(-0x3e39341147) *= in TEST()
984 absl::int128 dividend = pair.first; in TEST()
985 absl::int128 divisor = pair.second; in TEST()
990 EXPECT_EQ(quotient, absl::int128(dividend) /= divisor); in TEST()
992 EXPECT_EQ(remainder, absl::int128(dividend) %= divisor); in TEST()
997 absl::int128 values[] = { in TEST()
1003 for (absl::int128 value : values) { in TEST()
1007 EXPECT_EQ(0, absl::int128(0) /= value); in TEST()
1009 EXPECT_EQ(0, absl::int128(0) %= value); in TEST()
1012 EXPECT_EQ(value, absl::int128(value) /= 1); in TEST()
1014 EXPECT_EQ(0, absl::int128(value) %= 1); in TEST()
1017 EXPECT_EQ(-value, absl::int128(value) /= -1); in TEST()
1019 EXPECT_EQ(0, absl::int128(value) %= -1); in TEST()
1029 absl::int128 positive_values[] = { in TEST()
1035 for (absl::int128 value : positive_values) { in TEST()
1039 absl::int128 power_of_two = absl::int128(1) << i; in TEST()
1042 EXPECT_EQ(value >> i, absl::int128(value) /= power_of_two); in TEST()
1045 absl::int128(value) %= power_of_two); in TEST()
1051 absl::int128 dividend; in TEST()
1052 absl::int128 divisor; in TEST()
1053 absl::int128 quotient; in TEST()
1054 absl::int128 remainder; in TEST()
1071 absl::int128(test_case.dividend) /= test_case.divisor); in TEST()
1074 absl::int128(test_case.dividend) %= test_case.divisor); in TEST()
1079 EXPECT_EQ(absl::int128(-1), ~absl::int128(0)); in TEST()
1081 absl::int128 values[]{ in TEST()
1084 for (absl::int128 value : values) { in TEST()
1091 EXPECT_EQ(value, absl::int128(value) |= value); in TEST()
1092 EXPECT_EQ(value, absl::int128(value) &= value); in TEST()
1093 EXPECT_EQ(0, absl::int128(value) ^= value); in TEST()
1099 EXPECT_EQ(absl::int128(-1), value | absl::int128(-1)); in TEST()
1100 EXPECT_EQ(value, value & absl::int128(-1)); in TEST()
1101 EXPECT_EQ(~value, value ^ absl::int128(-1)); in TEST()
1122 EXPECT_EQ(absl::int128(pair.first & pair.second), in TEST()
1123 absl::int128(pair.first) & absl::int128(pair.second)); in TEST()
1124 EXPECT_EQ(absl::int128(pair.first | pair.second), in TEST()
1125 absl::int128(pair.first) | absl::int128(pair.second)); in TEST()
1126 EXPECT_EQ(absl::int128(pair.first ^ pair.second), in TEST()
1127 absl::int128(pair.first) ^ absl::int128(pair.second)); in TEST()
1129 EXPECT_EQ(absl::int128(pair.first & pair.second), in TEST()
1130 absl::int128(pair.first) &= absl::int128(pair.second)); in TEST()
1131 EXPECT_EQ(absl::int128(pair.first | pair.second), in TEST()
1132 absl::int128(pair.first) |= absl::int128(pair.second)); in TEST()
1133 EXPECT_EQ(absl::int128(pair.first ^ pair.second), in TEST()
1134 absl::int128(pair.first) ^= absl::int128(pair.second)); in TEST()
1163 EXPECT_EQ(uint64_t{1} << i, absl::int128(uint64_t{1} << j) << (i - j)); in TEST()
1164 EXPECT_EQ(uint64_t{1} << i, absl::int128(uint64_t{1} << j) <<= (i - j)); in TEST()
1172 absl::int128(uint64_t{1} << j) << (i + 64 - j)); in TEST()
1174 absl::int128(uint64_t{1} << j) <<= (i + 64 - j)); in TEST()
1190 EXPECT_EQ(uint64_t{1} << i, absl::int128(uint64_t{1} << j) >> (j - i)); in TEST()
1191 EXPECT_EQ(uint64_t{1} << i, absl::int128(uint64_t{1} << j) >>= (j - i)); in TEST()
1215 static_assert(std::numeric_limits<absl::int128>::is_specialized, ""); in TEST()
1216 static_assert(std::numeric_limits<absl::int128>::is_signed, ""); in TEST()
1217 static_assert(std::numeric_limits<absl::int128>::is_integer, ""); in TEST()
1219 std::numeric_limits<absl::int128>::digits10); in TEST()
1220 EXPECT_EQ(absl::Int128Min(), std::numeric_limits<absl::int128>::min()); in TEST()
1221 EXPECT_EQ(absl::Int128Min(), std::numeric_limits<absl::int128>::lowest()); in TEST()
1222 EXPECT_EQ(absl::Int128Max(), std::numeric_limits<absl::int128>::max()); in TEST()