• Home
  • Raw
  • Download

Lines Matching refs:EXPECT_EQ

37   EXPECT_EQ(neg_one, neg_one.ashr(7));  in TEST()
42 EXPECT_EQ(126u, Minus3.countLeadingOnes()); in TEST()
43 EXPECT_EQ(-3, Minus3.getSExtValue()); in TEST()
46 EXPECT_EQ(0u, Minus1.countLeadingZeros()); in TEST()
47 EXPECT_EQ(128u, Minus1.countLeadingOnes()); in TEST()
48 EXPECT_EQ(128u, Minus1.getActiveBits()); in TEST()
49 EXPECT_EQ(0u, Minus1.countTrailingZeros()); in TEST()
50 EXPECT_EQ(128u, Minus1.countTrailingOnes()); in TEST()
51 EXPECT_EQ(128u, Minus1.countPopulation()); in TEST()
52 EXPECT_EQ(-1, Minus1.getSExtValue()); in TEST()
57 EXPECT_EQ(0u, i33minus2.countLeadingZeros()); in TEST()
58 EXPECT_EQ(32u, i33minus2.countLeadingOnes()); in TEST()
59 EXPECT_EQ(33u, i33minus2.getActiveBits()); in TEST()
60 EXPECT_EQ(1u, i33minus2.countTrailingZeros()); in TEST()
61 EXPECT_EQ(32u, i33minus2.countPopulation()); in TEST()
62 EXPECT_EQ(-2, i33minus2.getSExtValue()); in TEST()
63 EXPECT_EQ(((uint64_t)-2)&((1ull<<33) -1), i33minus2.getZExtValue()); in TEST()
68 EXPECT_EQ(45u, i61.countLeadingZeros()); in TEST()
69 EXPECT_EQ(0u, i61.countLeadingOnes()); in TEST()
70 EXPECT_EQ(16u, i61.getActiveBits()); in TEST()
71 EXPECT_EQ(15u, i61.countTrailingZeros()); in TEST()
72 EXPECT_EQ(1u, i61.countPopulation()); in TEST()
73 EXPECT_EQ(static_cast<int64_t>(1 << 15), i61.getSExtValue()); in TEST()
74 EXPECT_EQ(static_cast<uint64_t>(1 << 15), i61.getZExtValue()); in TEST()
77 EXPECT_EQ(42u, i61.countLeadingZeros()); in TEST()
78 EXPECT_EQ(0u, i61.countLeadingOnes()); in TEST()
79 EXPECT_EQ(19u, i61.getActiveBits()); in TEST()
80 EXPECT_EQ(8u, i61.countTrailingZeros()); in TEST()
81 EXPECT_EQ(11u, i61.countPopulation()); in TEST()
82 EXPECT_EQ(static_cast<int64_t>((1 << 19) - (1 << 8)), i61.getSExtValue()); in TEST()
83 EXPECT_EQ(static_cast<uint64_t>((1 << 19) - (1 << 8)), i61.getZExtValue()); in TEST()
88 EXPECT_EQ(65u, i65.countLeadingZeros()); in TEST()
89 EXPECT_EQ(0u, i65.countLeadingOnes()); in TEST()
90 EXPECT_EQ(0u, i65.getActiveBits()); in TEST()
91 EXPECT_EQ(1u, i65.getActiveWords()); in TEST()
92 EXPECT_EQ(65u, i65.countTrailingZeros()); in TEST()
93 EXPECT_EQ(0u, i65.countPopulation()); in TEST()
97 EXPECT_EQ(0u, i65minus.countLeadingZeros()); in TEST()
98 EXPECT_EQ(1u, i65minus.countLeadingOnes()); in TEST()
99 EXPECT_EQ(65u, i65minus.getActiveBits()); in TEST()
100 EXPECT_EQ(64u, i65minus.countTrailingZeros()); in TEST()
101 EXPECT_EQ(1u, i65minus.countPopulation()); in TEST()
106 EXPECT_EQ(128u, u128max.countLeadingOnes()); in TEST()
107 EXPECT_EQ(0u, u128max.countLeadingZeros()); in TEST()
108 EXPECT_EQ(128u, u128max.getActiveBits()); in TEST()
109 EXPECT_EQ(0u, u128max.countTrailingZeros()); in TEST()
110 EXPECT_EQ(128u, u128max.countTrailingOnes()); in TEST()
111 EXPECT_EQ(128u, u128max.countPopulation()); in TEST()
114 EXPECT_EQ(64u, u64max.countLeadingZeros()); in TEST()
115 EXPECT_EQ(0u, u64max.countLeadingOnes()); in TEST()
116 EXPECT_EQ(64u, u64max.getActiveBits()); in TEST()
117 EXPECT_EQ(0u, u64max.countTrailingZeros()); in TEST()
118 EXPECT_EQ(64u, u64max.countTrailingOnes()); in TEST()
119 EXPECT_EQ(64u, u64max.countPopulation()); in TEST()
120 EXPECT_EQ((uint64_t)~0ull, u64max.getZExtValue()); in TEST()
123 EXPECT_EQ(128u, zero.countLeadingZeros()); in TEST()
124 EXPECT_EQ(0u, zero.countLeadingOnes()); in TEST()
125 EXPECT_EQ(0u, zero.getActiveBits()); in TEST()
126 EXPECT_EQ(128u, zero.countTrailingZeros()); in TEST()
127 EXPECT_EQ(0u, zero.countTrailingOnes()); in TEST()
128 EXPECT_EQ(0u, zero.countPopulation()); in TEST()
129 EXPECT_EQ(0u, zero.getSExtValue()); in TEST()
130 EXPECT_EQ(0u, zero.getZExtValue()); in TEST()
133 EXPECT_EQ(127u, one.countLeadingZeros()); in TEST()
134 EXPECT_EQ(0u, one.countLeadingOnes()); in TEST()
135 EXPECT_EQ(1u, one.getActiveBits()); in TEST()
136 EXPECT_EQ(0u, one.countTrailingZeros()); in TEST()
137 EXPECT_EQ(1u, one.countTrailingOnes()); in TEST()
138 EXPECT_EQ(1u, one.countPopulation()); in TEST()
139 EXPECT_EQ(1, one.getSExtValue()); in TEST()
140 EXPECT_EQ(1u, one.getZExtValue()); in TEST()
143 EXPECT_EQ(126u, s128.countLeadingZeros()); in TEST()
144 EXPECT_EQ(0u, s128.countLeadingOnes()); in TEST()
145 EXPECT_EQ(2u, s128.getActiveBits()); in TEST()
146 EXPECT_EQ(1u, s128.countTrailingZeros()); in TEST()
147 EXPECT_EQ(0u, s128.countTrailingOnes()); in TEST()
148 EXPECT_EQ(1u, s128.countPopulation()); in TEST()
149 EXPECT_EQ(2, s128.getSExtValue()); in TEST()
150 EXPECT_EQ(2u, s128.getZExtValue()); in TEST()
154 EXPECT_EQ(126u, s128.countLeadingZeros()); in TEST()
155 EXPECT_EQ(0u, s128.countLeadingOnes()); in TEST()
156 EXPECT_EQ(2u, s128.getActiveBits()); in TEST()
157 EXPECT_EQ(1u, s128.countTrailingZeros()); in TEST()
158 EXPECT_EQ(0u, s128.countTrailingOnes()); in TEST()
159 EXPECT_EQ(1u, s128.countPopulation()); in TEST()
160 EXPECT_EQ(2, s128.getSExtValue()); in TEST()
161 EXPECT_EQ(2u, s128.getZExtValue()); in TEST()
164 EXPECT_EQ(96u, s128.countLeadingZeros()); in TEST()
165 EXPECT_EQ(0u, s128.countLeadingOnes()); in TEST()
166 EXPECT_EQ(32u, s128.getActiveBits()); in TEST()
167 EXPECT_EQ(33u, s128.getMinSignedBits()); in TEST()
168 EXPECT_EQ(1u, s128.countTrailingZeros()); in TEST()
169 EXPECT_EQ(0u, s128.countTrailingOnes()); in TEST()
170 EXPECT_EQ(30u, s128.countPopulation()); in TEST()
171 EXPECT_EQ(static_cast<uint32_t>((~0u << 3) | 2), s128.getZExtValue()); in TEST()
174 EXPECT_EQ(0u, s128.countLeadingZeros()); in TEST()
175 EXPECT_EQ(66u, s128.countLeadingOnes()); in TEST()
176 EXPECT_EQ(128u, s128.getActiveBits()); in TEST()
177 EXPECT_EQ(63u, s128.getMinSignedBits()); in TEST()
178 EXPECT_EQ(1u, s128.countTrailingZeros()); in TEST()
179 EXPECT_EQ(0u, s128.countTrailingOnes()); in TEST()
180 EXPECT_EQ(96u, s128.countPopulation()); in TEST()
181 EXPECT_EQ(static_cast<int64_t>((3ull << 62) | in TEST()
188 EXPECT_EQ(252u, s256.countLeadingZeros()); in TEST()
189 EXPECT_EQ(0u, s256.countLeadingOnes()); in TEST()
190 EXPECT_EQ(4u, s256.getActiveBits()); in TEST()
191 EXPECT_EQ(0u, s256.countTrailingZeros()); in TEST()
192 EXPECT_EQ(4u, s256.countTrailingOnes()); in TEST()
193 EXPECT_EQ(4u, s256.countPopulation()); in TEST()
194 EXPECT_EQ(15, s256.getSExtValue()); in TEST()
195 EXPECT_EQ(15u, s256.getZExtValue()); in TEST()
198 EXPECT_EQ(190u, s256.countLeadingZeros()); in TEST()
199 EXPECT_EQ(0u, s256.countLeadingOnes()); in TEST()
200 EXPECT_EQ(66u, s256.getActiveBits()); in TEST()
201 EXPECT_EQ(67u, s256.getMinSignedBits()); in TEST()
202 EXPECT_EQ(0u, s256.countTrailingZeros()); in TEST()
203 EXPECT_EQ(4u, s256.countTrailingOnes()); in TEST()
204 EXPECT_EQ(8u, s256.countPopulation()); in TEST()
207 EXPECT_EQ(0u, s256.countLeadingZeros()); in TEST()
208 EXPECT_EQ(196u, s256.countLeadingOnes()); in TEST()
209 EXPECT_EQ(256u, s256.getActiveBits()); in TEST()
210 EXPECT_EQ(61u, s256.getMinSignedBits()); in TEST()
211 EXPECT_EQ(0u, s256.countTrailingZeros()); in TEST()
212 EXPECT_EQ(4u, s256.countTrailingOnes()); in TEST()
213 EXPECT_EQ(200u, s256.countPopulation()); in TEST()
214 EXPECT_EQ(static_cast<int64_t>((~0ull << 60) | 15), s256.getSExtValue()); in TEST()
224 EXPECT_EQ(0, neg_two.getSExtValue()); in TEST()
225 EXPECT_EQ(-1, neg_one.getSExtValue()); in TEST()
226 EXPECT_EQ(1u, neg_one.getZExtValue()); in TEST()
227 EXPECT_EQ(0u, zero.getZExtValue()); in TEST()
228 EXPECT_EQ(-1, one.getSExtValue()); in TEST()
229 EXPECT_EQ(1u, one.getZExtValue()); in TEST()
230 EXPECT_EQ(0u, two.getZExtValue()); in TEST()
231 EXPECT_EQ(0, two.getSExtValue()); in TEST()
234 EXPECT_EQ(zero, two); in TEST()
235 EXPECT_EQ(zero, neg_two); in TEST()
236 EXPECT_EQ(one, neg_one); in TEST()
237 EXPECT_EQ(two, neg_two); in TEST()
246 EXPECT_EQ(two, one + one); in TEST()
247 EXPECT_EQ(zero, neg_one + one); in TEST()
248 EXPECT_EQ(neg_two, neg_one + neg_one); in TEST()
251 EXPECT_EQ(neg_two, neg_one - one); in TEST()
252 EXPECT_EQ(two, one - neg_one); in TEST()
253 EXPECT_EQ(zero, one - one); in TEST()
256 EXPECT_EQ(zero, zero & zero); in TEST()
257 EXPECT_EQ(zero, one & zero); in TEST()
258 EXPECT_EQ(zero, zero & one); in TEST()
259 EXPECT_EQ(one, one & one); in TEST()
260 EXPECT_EQ(zero, zero & zero); in TEST()
261 EXPECT_EQ(zero, neg_one & zero); in TEST()
262 EXPECT_EQ(zero, zero & neg_one); in TEST()
263 EXPECT_EQ(neg_one, neg_one & neg_one); in TEST()
266 EXPECT_EQ(zero, zero | zero); in TEST()
267 EXPECT_EQ(one, one | zero); in TEST()
268 EXPECT_EQ(one, zero | one); in TEST()
269 EXPECT_EQ(one, one | one); in TEST()
270 EXPECT_EQ(zero, zero | zero); in TEST()
271 EXPECT_EQ(neg_one, neg_one | zero); in TEST()
272 EXPECT_EQ(neg_one, zero | neg_one); in TEST()
273 EXPECT_EQ(neg_one, neg_one | neg_one); in TEST()
276 EXPECT_EQ(zero, zero ^ zero); in TEST()
277 EXPECT_EQ(one, one ^ zero); in TEST()
278 EXPECT_EQ(one, zero ^ one); in TEST()
279 EXPECT_EQ(zero, one ^ one); in TEST()
280 EXPECT_EQ(zero, zero ^ zero); in TEST()
281 EXPECT_EQ(neg_one, neg_one ^ zero); in TEST()
282 EXPECT_EQ(neg_one, zero ^ neg_one); in TEST()
283 EXPECT_EQ(zero, neg_one ^ neg_one); in TEST()
286 EXPECT_EQ(zero, one << one); in TEST()
287 EXPECT_EQ(one, one << zero); in TEST()
288 EXPECT_EQ(zero, one.shl(1)); in TEST()
289 EXPECT_EQ(one, one.shl(0)); in TEST()
290 EXPECT_EQ(zero, one.lshr(1)); in TEST()
291 EXPECT_EQ(one, one.ashr(1)); in TEST()
294 EXPECT_EQ(one, one.rotl(0)); in TEST()
295 EXPECT_EQ(one, one.rotl(1)); in TEST()
296 EXPECT_EQ(one, one.rotr(0)); in TEST()
297 EXPECT_EQ(one, one.rotr(1)); in TEST()
300 EXPECT_EQ(neg_one, neg_one * one); in TEST()
301 EXPECT_EQ(neg_one, one * neg_one); in TEST()
302 EXPECT_EQ(one, neg_one * neg_one); in TEST()
303 EXPECT_EQ(one, one * one); in TEST()
306 EXPECT_EQ(neg_one, one.sdiv(neg_one)); in TEST()
307 EXPECT_EQ(neg_one, neg_one.sdiv(one)); in TEST()
308 EXPECT_EQ(one, neg_one.sdiv(neg_one)); in TEST()
309 EXPECT_EQ(one, one.sdiv(one)); in TEST()
311 EXPECT_EQ(neg_one, one.udiv(neg_one)); in TEST()
312 EXPECT_EQ(neg_one, neg_one.udiv(one)); in TEST()
313 EXPECT_EQ(one, neg_one.udiv(neg_one)); in TEST()
314 EXPECT_EQ(one, one.udiv(one)); in TEST()
317 EXPECT_EQ(zero, neg_one.srem(one)); in TEST()
318 EXPECT_EQ(zero, neg_one.urem(one)); in TEST()
319 EXPECT_EQ(zero, one.srem(neg_one)); in TEST()
330 EXPECT_EQ(nine.srem(two), one); in TEST()
331 EXPECT_EQ(nine.srem(-two), one); in TEST()
332 EXPECT_EQ((-nine).srem(two), -one); in TEST()
333 EXPECT_EQ((-nine).srem(-two), -one); in TEST()
336 EXPECT_EQ(four, q); in TEST()
337 EXPECT_EQ(one, r); in TEST()
339 EXPECT_EQ(-four, q); in TEST()
340 EXPECT_EQ(-one, r); in TEST()
342 EXPECT_EQ(-four, q); in TEST()
343 EXPECT_EQ(one, r); in TEST()
345 EXPECT_EQ(four, q); in TEST()
346 EXPECT_EQ(-one, r); in TEST()
366 EXPECT_EQ(uv1 < uv2, arg1.ult(arg2)); in TEST()
367 EXPECT_EQ(uv1 <= uv2, arg1.ule(arg2)); in TEST()
368 EXPECT_EQ(uv1 > uv2, arg1.ugt(arg2)); in TEST()
369 EXPECT_EQ(uv1 >= uv2, arg1.uge(arg2)); in TEST()
371 EXPECT_EQ(sv1 < sv2, arg1.slt(arg2)); in TEST()
372 EXPECT_EQ(sv1 <= sv2, arg1.sle(arg2)); in TEST()
373 EXPECT_EQ(sv1 > sv2, arg1.sgt(arg2)); in TEST()
374 EXPECT_EQ(sv1 >= sv2, arg1.sge(arg2)); in TEST()
376 EXPECT_EQ(uv1 < uv2, arg1.ult(uv2)); in TEST()
377 EXPECT_EQ(uv1 <= uv2, arg1.ule(uv2)); in TEST()
378 EXPECT_EQ(uv1 > uv2, arg1.ugt(uv2)); in TEST()
379 EXPECT_EQ(uv1 >= uv2, arg1.uge(uv2)); in TEST()
381 EXPECT_EQ(sv1 < sv2, arg1.slt(sv2)); in TEST()
382 EXPECT_EQ(sv1 <= sv2, arg1.sle(sv2)); in TEST()
383 EXPECT_EQ(sv1 > sv2, arg1.sgt(sv2)); in TEST()
384 EXPECT_EQ(sv1 >= sv2, arg1.sge(sv2)); in TEST()
548 EXPECT_EQ(A1 & E1, E1); in TEST()
549 EXPECT_EQ(A1 & 0, 0); in TEST()
550 EXPECT_EQ(A1 & 1, 1); in TEST()
551 EXPECT_EQ(A1 & 5, 5); in TEST()
552 EXPECT_EQ(A1 & UINT64_MAX, E1); in TEST()
554 EXPECT_EQ(A1 | E1, E1); in TEST()
555 EXPECT_EQ(A1 | 0, E1); in TEST()
556 EXPECT_EQ(A1 | 1, E1); in TEST()
557 EXPECT_EQ(A1 | 2, E1 | 2); in TEST()
558 EXPECT_EQ(A1 | UINT64_MAX, UINT64_MAX); in TEST()
560 EXPECT_EQ(A1 ^ E1, 0); in TEST()
561 EXPECT_EQ(A1 ^ 0, E1); in TEST()
562 EXPECT_EQ(A1 ^ 1, E1 ^ 1); in TEST()
563 EXPECT_EQ(A1 ^ 7, E1 ^ 7); in TEST()
564 EXPECT_EQ(A1 ^ UINT64_MAX, ~E1); in TEST()
576 EXPECT_EQ(A2 & N, N); in TEST()
577 EXPECT_EQ(A2 & 0, 0); in TEST()
578 EXPECT_EQ(A2 & 1, 1); in TEST()
579 EXPECT_EQ(A2 & 5, 1); in TEST()
580 EXPECT_EQ(A2 & UINT64_MAX, N); in TEST()
582 EXPECT_EQ(A2 | N, A2); in TEST()
583 EXPECT_EQ(A2 | 0, A2); in TEST()
584 EXPECT_EQ(A2 | 1, A2); in TEST()
585 EXPECT_EQ(A2 | 2, A2 + 2); in TEST()
586 EXPECT_EQ(A2 | UINT64_MAX, A2 - N + UINT64_MAX); in TEST()
588 EXPECT_EQ(A2 ^ N, A2 - N); in TEST()
589 EXPECT_EQ(A2 ^ 0, A2); in TEST()
590 EXPECT_EQ(A2 ^ 1, A2 - 1); in TEST()
591 EXPECT_EQ(A2 ^ 7, A2 + 5); in TEST()
592 EXPECT_EQ(A2 ^ UINT64_MAX, A2 - N + ~N); in TEST()
617 EXPECT_EQ(AddLL, Two); in TEST()
620 EXPECT_EQ(AddLR, Two); in TEST()
621 EXPECT_EQ(AddLR.getRawData(), RawDataR); in TEST()
624 EXPECT_EQ(AddRL, Two); in TEST()
625 EXPECT_EQ(AddRL.getRawData(), RawDataL); in TEST()
628 EXPECT_EQ(AddRR, Two); in TEST()
629 EXPECT_EQ(AddRR.getRawData(), RawDataR); in TEST()
633 EXPECT_EQ(AddLK, Two); in TEST()
636 EXPECT_EQ(AddKL, Two); in TEST()
640 EXPECT_EQ(AddRK, Two); in TEST()
641 EXPECT_EQ(AddRK.getRawData(), RawDataL); in TEST()
644 EXPECT_EQ(AddKR, Two); in TEST()
645 EXPECT_EQ(AddKR.getRawData(), RawDataR); in TEST()
654 EXPECT_EQ(AddLL, HighOneLowOne); in TEST()
657 EXPECT_EQ(AddLR, HighOneLowOne); in TEST()
658 EXPECT_EQ(AddLR.getRawData(), RawDataR); in TEST()
661 EXPECT_EQ(AddRL, HighOneLowOne); in TEST()
662 EXPECT_EQ(AddRL.getRawData(), RawDataL); in TEST()
666 EXPECT_EQ(AddRR, HighOneLowOne); in TEST()
667 EXPECT_EQ(AddRR.getRawData(), RawDataR); in TEST()
671 EXPECT_EQ(AddLK, HighOneLowOne); in TEST()
674 EXPECT_EQ(AddKL, HighOneLowOne); in TEST()
678 EXPECT_EQ(AddRK, HighOneLowOne); in TEST()
679 EXPECT_EQ(AddRK.getRawData(), RawDataL); in TEST()
682 EXPECT_EQ(AddKR, HighOneLowOne); in TEST()
683 EXPECT_EQ(AddKR.getRawData(), RawDataR); in TEST()
689 EXPECT_EQ(SubLL, One); in TEST()
692 EXPECT_EQ(SubLR, One); in TEST()
693 EXPECT_EQ(SubLR.getRawData(), RawDataR); in TEST()
696 EXPECT_EQ(SubRL, One); in TEST()
697 EXPECT_EQ(SubRL.getRawData(), RawDataL); in TEST()
700 EXPECT_EQ(SubRR, One); in TEST()
701 EXPECT_EQ(SubRR.getRawData(), RawDataR); in TEST()
705 EXPECT_EQ(SubLK, One); in TEST()
708 EXPECT_EQ(SubKL, One); in TEST()
712 EXPECT_EQ(SubRK, One); in TEST()
713 EXPECT_EQ(SubRK.getRawData(), RawDataL); in TEST()
716 EXPECT_EQ(SubKR, One); in TEST()
717 EXPECT_EQ(SubKR.getRawData(), RawDataR); in TEST()
726 EXPECT_EQ(SubLL, Two); in TEST()
730 EXPECT_EQ(SubLR, Two); in TEST()
731 EXPECT_EQ(SubLR.getRawData(), RawDataR); in TEST()
735 EXPECT_EQ(SubRL, Two); in TEST()
736 EXPECT_EQ(SubRL.getRawData(), RawDataL); in TEST()
740 EXPECT_EQ(SubRR, Two); in TEST()
741 EXPECT_EQ(SubRR.getRawData(), RawDataR); in TEST()
746 EXPECT_EQ(SubLK, AllOnes); in TEST()
750 EXPECT_EQ(SubKL, Three); in TEST()
755 EXPECT_EQ(SubRK, AllOnes); in TEST()
756 EXPECT_EQ(SubRK.getRawData(), RawDataL); in TEST()
759 EXPECT_EQ(SubKR, Three); in TEST()
760 EXPECT_EQ(SubKR.getRawData(), RawDataR); in TEST()
784 EXPECT_EQ(AndLL, 0x8); in TEST()
787 EXPECT_EQ(AndLR, 0x8); in TEST()
788 EXPECT_EQ(AndLR.getRawData(), RawDataR); in TEST()
791 EXPECT_EQ(AndRL, 0x8); in TEST()
792 EXPECT_EQ(AndRL.getRawData(), RawDataL); in TEST()
795 EXPECT_EQ(AndRR, 0x8); in TEST()
796 EXPECT_EQ(AndRR.getRawData(), RawDataR); in TEST()
800 EXPECT_EQ(AndLK, 0x8); in TEST()
803 EXPECT_EQ(AndKL, 0x8); in TEST()
807 EXPECT_EQ(AndRK, 0x8); in TEST()
808 EXPECT_EQ(AndRK.getRawData(), RawDataL); in TEST()
811 EXPECT_EQ(AndKR, 0x8); in TEST()
812 EXPECT_EQ(AndKR.getRawData(), RawDataR); in TEST()
818 EXPECT_EQ(OrLL, 0xe); in TEST()
821 EXPECT_EQ(OrLR, 0xe); in TEST()
822 EXPECT_EQ(OrLR.getRawData(), RawDataR); in TEST()
825 EXPECT_EQ(OrRL, 0xe); in TEST()
826 EXPECT_EQ(OrRL.getRawData(), RawDataL); in TEST()
829 EXPECT_EQ(OrRR, 0xe); in TEST()
830 EXPECT_EQ(OrRR.getRawData(), RawDataR); in TEST()
834 EXPECT_EQ(OrLK, 0xe); in TEST()
837 EXPECT_EQ(OrKL, 0xe); in TEST()
841 EXPECT_EQ(OrRK, 0xe); in TEST()
842 EXPECT_EQ(OrRK.getRawData(), RawDataL); in TEST()
845 EXPECT_EQ(OrKR, 0xe); in TEST()
846 EXPECT_EQ(OrKR.getRawData(), RawDataR); in TEST()
852 EXPECT_EQ(XorLL, 0x6); in TEST()
855 EXPECT_EQ(XorLR, 0x6); in TEST()
856 EXPECT_EQ(XorLR.getRawData(), RawDataR); in TEST()
859 EXPECT_EQ(XorRL, 0x6); in TEST()
860 EXPECT_EQ(XorRL.getRawData(), RawDataL); in TEST()
863 EXPECT_EQ(XorRR, 0x6); in TEST()
864 EXPECT_EQ(XorRR.getRawData(), RawDataR); in TEST()
868 EXPECT_EQ(XorLK, 0x6); in TEST()
871 EXPECT_EQ(XorKL, 0x6); in TEST()
875 EXPECT_EQ(XorRK, 0x6); in TEST()
876 EXPECT_EQ(XorRK.getRawData(), RawDataL); in TEST()
879 EXPECT_EQ(XorKR, 0x6); in TEST()
880 EXPECT_EQ(XorKR.getRawData(), RawDataR); in TEST()
901 EXPECT_EQ(NegL, NegativeTwo); in TEST()
904 EXPECT_EQ(NegR, NegativeTwo); in TEST()
905 EXPECT_EQ(NegR.getRawData(), RawData); in TEST()
918 EXPECT_EQ(b, q); in testDiv()
919 EXPECT_EQ(c, r); in testDiv()
921 EXPECT_EQ(b, q); in testDiv()
922 EXPECT_EQ(c, r); in testDiv()
925 EXPECT_EQ(b, q); in testDiv()
926 EXPECT_EQ(c, r); in testDiv()
928 EXPECT_EQ(b, q); in testDiv()
929 EXPECT_EQ(c, r); in testDiv()
934 EXPECT_EQ(a, q); in testDiv()
935 EXPECT_EQ(c, r); in testDiv()
937 EXPECT_EQ(a, q); in testDiv()
938 EXPECT_EQ(c, r); in testDiv()
941 EXPECT_EQ(a, q); in testDiv()
942 EXPECT_EQ(c, r); in testDiv()
944 EXPECT_EQ(a, q); in testDiv()
945 EXPECT_EQ(c, r); in testDiv()
1014 EXPECT_EQ(a, q); in testDiv()
1015 EXPECT_EQ(c, r); in testDiv()
1017 EXPECT_EQ(a, q); in testDiv()
1018 EXPECT_EQ(c, r); in testDiv()
1022 EXPECT_EQ(a, q); in testDiv()
1024 EXPECT_EQ(-c, -r); // Need to negate so the uint64_t compare will work. in testDiv()
1026 EXPECT_EQ(c, r); in testDiv()
1029 EXPECT_EQ(a, q); in testDiv()
1031 EXPECT_EQ(-c, -sr); // Need to negate so the uint64_t compare will work. in testDiv()
1033 EXPECT_EQ(c, sr); in testDiv()
1070 EXPECT_EQ(Q, APInt(65, 1)); in TEST()
1071 EXPECT_EQ(R, APInt(65, 0)); in TEST()
1073 EXPECT_EQ(Q, APInt(65, 1)); in TEST()
1074 EXPECT_EQ(R, APInt(65, 0)); in TEST()
1079 EXPECT_EQ(Q, APInt(65, 0)); in TEST()
1080 EXPECT_EQ(R, APInt(65, 0)); in TEST()
1082 EXPECT_EQ(Q, APInt(65, 0)); in TEST()
1083 EXPECT_EQ(R, APInt(65, 0)); in TEST()
1088 EXPECT_EQ(Q, A); in TEST()
1089 EXPECT_EQ(R, APInt(65, 0)); in TEST()
1091 EXPECT_EQ(Q, A); in TEST()
1092 EXPECT_EQ(R, APInt(65, 0)); in TEST()
1096 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 2)); in TEST()
1097 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 2)); in TEST()
1098 EXPECT_EQ(APInt(32, 2), APInt(32, "10", 2)); in TEST()
1099 EXPECT_EQ(APInt(32, 3), APInt(32, "11", 2)); in TEST()
1100 EXPECT_EQ(APInt(32, 4), APInt(32, "100", 2)); in TEST()
1102 EXPECT_EQ(APInt(32, 0), APInt(32, "+0", 2)); in TEST()
1103 EXPECT_EQ(APInt(32, 1), APInt(32, "+1", 2)); in TEST()
1104 EXPECT_EQ(APInt(32, 2), APInt(32, "+10", 2)); in TEST()
1105 EXPECT_EQ(APInt(32, 3), APInt(32, "+11", 2)); in TEST()
1106 EXPECT_EQ(APInt(32, 4), APInt(32, "+100", 2)); in TEST()
1108 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 2)); in TEST()
1109 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 2)); in TEST()
1110 EXPECT_EQ(APInt(32, uint64_t(-2LL)), APInt(32, "-10", 2)); in TEST()
1111 EXPECT_EQ(APInt(32, uint64_t(-3LL)), APInt(32, "-11", 2)); in TEST()
1112 EXPECT_EQ(APInt(32, uint64_t(-4LL)), APInt(32, "-100", 2)); in TEST()
1114 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 8)); in TEST()
1115 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 8)); in TEST()
1116 EXPECT_EQ(APInt(32, 7), APInt(32, "7", 8)); in TEST()
1117 EXPECT_EQ(APInt(32, 8), APInt(32, "10", 8)); in TEST()
1118 EXPECT_EQ(APInt(32, 15), APInt(32, "17", 8)); in TEST()
1119 EXPECT_EQ(APInt(32, 16), APInt(32, "20", 8)); in TEST()
1121 EXPECT_EQ(APInt(32, +0), APInt(32, "+0", 8)); in TEST()
1122 EXPECT_EQ(APInt(32, +1), APInt(32, "+1", 8)); in TEST()
1123 EXPECT_EQ(APInt(32, +7), APInt(32, "+7", 8)); in TEST()
1124 EXPECT_EQ(APInt(32, +8), APInt(32, "+10", 8)); in TEST()
1125 EXPECT_EQ(APInt(32, +15), APInt(32, "+17", 8)); in TEST()
1126 EXPECT_EQ(APInt(32, +16), APInt(32, "+20", 8)); in TEST()
1128 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 8)); in TEST()
1129 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 8)); in TEST()
1130 EXPECT_EQ(APInt(32, uint64_t(-7LL)), APInt(32, "-7", 8)); in TEST()
1131 EXPECT_EQ(APInt(32, uint64_t(-8LL)), APInt(32, "-10", 8)); in TEST()
1132 EXPECT_EQ(APInt(32, uint64_t(-15LL)), APInt(32, "-17", 8)); in TEST()
1133 EXPECT_EQ(APInt(32, uint64_t(-16LL)), APInt(32, "-20", 8)); in TEST()
1135 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 10)); in TEST()
1136 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 10)); in TEST()
1137 EXPECT_EQ(APInt(32, 9), APInt(32, "9", 10)); in TEST()
1138 EXPECT_EQ(APInt(32, 10), APInt(32, "10", 10)); in TEST()
1139 EXPECT_EQ(APInt(32, 19), APInt(32, "19", 10)); in TEST()
1140 EXPECT_EQ(APInt(32, 20), APInt(32, "20", 10)); in TEST()
1142 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 10)); in TEST()
1143 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 10)); in TEST()
1144 EXPECT_EQ(APInt(32, uint64_t(-9LL)), APInt(32, "-9", 10)); in TEST()
1145 EXPECT_EQ(APInt(32, uint64_t(-10LL)), APInt(32, "-10", 10)); in TEST()
1146 EXPECT_EQ(APInt(32, uint64_t(-19LL)), APInt(32, "-19", 10)); in TEST()
1147 EXPECT_EQ(APInt(32, uint64_t(-20LL)), APInt(32, "-20", 10)); in TEST()
1149 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 16)); in TEST()
1150 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 16)); in TEST()
1151 EXPECT_EQ(APInt(32, 15), APInt(32, "F", 16)); in TEST()
1152 EXPECT_EQ(APInt(32, 16), APInt(32, "10", 16)); in TEST()
1153 EXPECT_EQ(APInt(32, 31), APInt(32, "1F", 16)); in TEST()
1154 EXPECT_EQ(APInt(32, 32), APInt(32, "20", 16)); in TEST()
1156 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 16)); in TEST()
1157 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 16)); in TEST()
1158 EXPECT_EQ(APInt(32, uint64_t(-15LL)), APInt(32, "-F", 16)); in TEST()
1159 EXPECT_EQ(APInt(32, uint64_t(-16LL)), APInt(32, "-10", 16)); in TEST()
1160 EXPECT_EQ(APInt(32, uint64_t(-31LL)), APInt(32, "-1F", 16)); in TEST()
1161 EXPECT_EQ(APInt(32, uint64_t(-32LL)), APInt(32, "-20", 16)); in TEST()
1163 EXPECT_EQ(APInt(32, 0), APInt(32, "0", 36)); in TEST()
1164 EXPECT_EQ(APInt(32, 1), APInt(32, "1", 36)); in TEST()
1165 EXPECT_EQ(APInt(32, 35), APInt(32, "Z", 36)); in TEST()
1166 EXPECT_EQ(APInt(32, 36), APInt(32, "10", 36)); in TEST()
1167 EXPECT_EQ(APInt(32, 71), APInt(32, "1Z", 36)); in TEST()
1168 EXPECT_EQ(APInt(32, 72), APInt(32, "20", 36)); in TEST()
1170 EXPECT_EQ(APInt(32, uint64_t(-0LL)), APInt(32, "-0", 36)); in TEST()
1171 EXPECT_EQ(APInt(32, uint64_t(-1LL)), APInt(32, "-1", 36)); in TEST()
1172 EXPECT_EQ(APInt(32, uint64_t(-35LL)), APInt(32, "-Z", 36)); in TEST()
1173 EXPECT_EQ(APInt(32, uint64_t(-36LL)), APInt(32, "-10", 36)); in TEST()
1174 EXPECT_EQ(APInt(32, uint64_t(-71LL)), APInt(32, "-1Z", 36)); in TEST()
1175 EXPECT_EQ(APInt(32, uint64_t(-72LL)), APInt(32, "-20", 36)); in TEST()
1184 EXPECT_EQ(APInt(7, 100), AP_100.truncUSat(7)); in TEST()
1185 EXPECT_EQ(APInt(6, 63), AP_100.truncUSat(6)); in TEST()
1186 EXPECT_EQ(APInt(5, 31), AP_100.truncUSat(5)); in TEST()
1188 EXPECT_EQ(APInt(7, 127), AP_200.truncUSat(7)); in TEST()
1189 EXPECT_EQ(APInt(6, 63), AP_200.truncUSat(6)); in TEST()
1190 EXPECT_EQ(APInt(5, 31), AP_200.truncUSat(5)); in TEST()
1192 EXPECT_EQ(APInt(7, 42), AP_42.truncSSat(7)); in TEST()
1193 EXPECT_EQ(APInt(6, 31), AP_42.truncSSat(6)); in TEST()
1194 EXPECT_EQ(APInt(5, 15), AP_42.truncSSat(5)); in TEST()
1196 EXPECT_EQ(APInt(7, -56), AP_200.truncSSat(7)); in TEST()
1197 EXPECT_EQ(APInt(6, -32), AP_200.truncSSat(6)); in TEST()
1198 EXPECT_EQ(APInt(5, -16), AP_200.truncSSat(5)); in TEST()
1200 EXPECT_EQ(APInt(8, 200), AP_100.uadd_sat(AP_100)); in TEST()
1201 EXPECT_EQ(APInt(8, 255), AP_100.uadd_sat(AP_200)); in TEST()
1202 EXPECT_EQ(APInt(8, 255), APInt(8, 255).uadd_sat(APInt(8, 255))); in TEST()
1204 EXPECT_EQ(APInt(8, 110), AP_10.sadd_sat(AP_100)); in TEST()
1205 EXPECT_EQ(APInt(8, 127), AP_100.sadd_sat(AP_100)); in TEST()
1206 EXPECT_EQ(APInt(8, -128), (-AP_100).sadd_sat(-AP_100)); in TEST()
1207 EXPECT_EQ(APInt(8, -128), APInt(8, -128).sadd_sat(APInt(8, -128))); in TEST()
1209 EXPECT_EQ(APInt(8, 90), AP_100.usub_sat(AP_10)); in TEST()
1210 EXPECT_EQ(APInt(8, 0), AP_100.usub_sat(AP_200)); in TEST()
1211 EXPECT_EQ(APInt(8, 0), APInt(8, 0).usub_sat(APInt(8, 255))); in TEST()
1213 EXPECT_EQ(APInt(8, -90), AP_10.ssub_sat(AP_100)); in TEST()
1214 EXPECT_EQ(APInt(8, 127), AP_100.ssub_sat(-AP_100)); in TEST()
1215 EXPECT_EQ(APInt(8, -128), (-AP_100).ssub_sat(AP_100)); in TEST()
1216 EXPECT_EQ(APInt(8, -128), APInt(8, -128).ssub_sat(APInt(8, 127))); in TEST()
1218 EXPECT_EQ(APInt(8, 250), APInt(8, 50).umul_sat(APInt(8, 5))); in TEST()
1219 EXPECT_EQ(APInt(8, 255), APInt(8, 50).umul_sat(APInt(8, 6))); in TEST()
1220 EXPECT_EQ(APInt(8, 255), APInt(8, -128).umul_sat(APInt(8, 3))); in TEST()
1221 EXPECT_EQ(APInt(8, 255), APInt(8, 3).umul_sat(APInt(8, -128))); in TEST()
1222 EXPECT_EQ(APInt(8, 255), APInt(8, -128).umul_sat(APInt(8, -128))); in TEST()
1224 EXPECT_EQ(APInt(8, 125), APInt(8, 25).smul_sat(APInt(8, 5))); in TEST()
1225 EXPECT_EQ(APInt(8, 127), APInt(8, 25).smul_sat(APInt(8, 6))); in TEST()
1226 EXPECT_EQ(APInt(8, 127), APInt(8, 127).smul_sat(APInt(8, 127))); in TEST()
1227 EXPECT_EQ(APInt(8, -125), APInt(8, -25).smul_sat(APInt(8, 5))); in TEST()
1228 EXPECT_EQ(APInt(8, -125), APInt(8, 25).smul_sat(APInt(8, -5))); in TEST()
1229 EXPECT_EQ(APInt(8, 125), APInt(8, -25).smul_sat(APInt(8, -5))); in TEST()
1230 EXPECT_EQ(APInt(8, 125), APInt(8, 25).smul_sat(APInt(8, 5))); in TEST()
1231 EXPECT_EQ(APInt(8, -128), APInt(8, -25).smul_sat(APInt(8, 6))); in TEST()
1232 EXPECT_EQ(APInt(8, -128), APInt(8, 25).smul_sat(APInt(8, -6))); in TEST()
1233 EXPECT_EQ(APInt(8, 127), APInt(8, -25).smul_sat(APInt(8, -6))); in TEST()
1234 EXPECT_EQ(APInt(8, 127), APInt(8, 25).smul_sat(APInt(8, 6))); in TEST()
1236 EXPECT_EQ(APInt(8, 128), APInt(8, 4).ushl_sat(APInt(8, 5))); in TEST()
1237 EXPECT_EQ(APInt(8, 255), APInt(8, 4).ushl_sat(APInt(8, 6))); in TEST()
1238 EXPECT_EQ(APInt(8, 128), APInt(8, 1).ushl_sat(APInt(8, 7))); in TEST()
1239 EXPECT_EQ(APInt(8, 255), APInt(8, 1).ushl_sat(APInt(8, 8))); in TEST()
1240 EXPECT_EQ(APInt(8, 255), APInt(8, -128).ushl_sat(APInt(8, 2))); in TEST()
1241 EXPECT_EQ(APInt(8, 255), APInt(8, 64).ushl_sat(APInt(8, 2))); in TEST()
1242 EXPECT_EQ(APInt(8, 255), APInt(8, 64).ushl_sat(APInt(8, -2))); in TEST()
1244 EXPECT_EQ(APInt(8, 64), APInt(8, 4).sshl_sat(APInt(8, 4))); in TEST()
1245 EXPECT_EQ(APInt(8, 127), APInt(8, 4).sshl_sat(APInt(8, 5))); in TEST()
1246 EXPECT_EQ(APInt(8, 127), APInt(8, 1).sshl_sat(APInt(8, 8))); in TEST()
1247 EXPECT_EQ(APInt(8, -64), APInt(8, -4).sshl_sat(APInt(8, 4))); in TEST()
1248 EXPECT_EQ(APInt(8, -128), APInt(8, -4).sshl_sat(APInt(8, 5))); in TEST()
1249 EXPECT_EQ(APInt(8, -128), APInt(8, -4).sshl_sat(APInt(8, 6))); in TEST()
1250 EXPECT_EQ(APInt(8, -128), APInt(8, -1).sshl_sat(APInt(8, 7))); in TEST()
1251 EXPECT_EQ(APInt(8, -128), APInt(8, -1).sshl_sat(APInt(8, 8))); in TEST()
1255 EXPECT_EQ(APInt(32, uint64_t(1)), APInt(32, ArrayRef<uint64_t>(1))); in TEST()
1259 EXPECT_EQ(1U, APInt::getBitsNeeded( "0", 2)); in TEST()
1260 EXPECT_EQ(1U, APInt::getBitsNeeded( "1", 2)); in TEST()
1261 EXPECT_EQ(2U, APInt::getBitsNeeded( "10", 2)); in TEST()
1262 EXPECT_EQ(2U, APInt::getBitsNeeded( "11", 2)); in TEST()
1263 EXPECT_EQ(3U, APInt::getBitsNeeded("100", 2)); in TEST()
1265 EXPECT_EQ(1U, APInt::getBitsNeeded( "+0", 2)); in TEST()
1266 EXPECT_EQ(1U, APInt::getBitsNeeded( "+1", 2)); in TEST()
1267 EXPECT_EQ(2U, APInt::getBitsNeeded( "+10", 2)); in TEST()
1268 EXPECT_EQ(2U, APInt::getBitsNeeded( "+11", 2)); in TEST()
1269 EXPECT_EQ(3U, APInt::getBitsNeeded("+100", 2)); in TEST()
1271 EXPECT_EQ(2U, APInt::getBitsNeeded( "-0", 2)); in TEST()
1272 EXPECT_EQ(2U, APInt::getBitsNeeded( "-1", 2)); in TEST()
1273 EXPECT_EQ(3U, APInt::getBitsNeeded( "-10", 2)); in TEST()
1274 EXPECT_EQ(3U, APInt::getBitsNeeded( "-11", 2)); in TEST()
1275 EXPECT_EQ(4U, APInt::getBitsNeeded("-100", 2)); in TEST()
1279 EXPECT_EQ(3U, APInt::getBitsNeeded( "0", 8)); in TEST()
1280 EXPECT_EQ(3U, APInt::getBitsNeeded( "7", 8)); in TEST()
1281 EXPECT_EQ(6U, APInt::getBitsNeeded("10", 8)); in TEST()
1282 EXPECT_EQ(6U, APInt::getBitsNeeded("17", 8)); in TEST()
1283 EXPECT_EQ(6U, APInt::getBitsNeeded("20", 8)); in TEST()
1285 EXPECT_EQ(3U, APInt::getBitsNeeded( "+0", 8)); in TEST()
1286 EXPECT_EQ(3U, APInt::getBitsNeeded( "+7", 8)); in TEST()
1287 EXPECT_EQ(6U, APInt::getBitsNeeded("+10", 8)); in TEST()
1288 EXPECT_EQ(6U, APInt::getBitsNeeded("+17", 8)); in TEST()
1289 EXPECT_EQ(6U, APInt::getBitsNeeded("+20", 8)); in TEST()
1291 EXPECT_EQ(4U, APInt::getBitsNeeded( "-0", 8)); in TEST()
1292 EXPECT_EQ(4U, APInt::getBitsNeeded( "-7", 8)); in TEST()
1293 EXPECT_EQ(7U, APInt::getBitsNeeded("-10", 8)); in TEST()
1294 EXPECT_EQ(7U, APInt::getBitsNeeded("-17", 8)); in TEST()
1295 EXPECT_EQ(7U, APInt::getBitsNeeded("-20", 8)); in TEST()
1299 EXPECT_EQ(1U, APInt::getBitsNeeded( "0", 10)); in TEST()
1300 EXPECT_EQ(2U, APInt::getBitsNeeded( "3", 10)); in TEST()
1301 EXPECT_EQ(4U, APInt::getBitsNeeded( "9", 10)); in TEST()
1302 EXPECT_EQ(4U, APInt::getBitsNeeded("10", 10)); in TEST()
1303 EXPECT_EQ(5U, APInt::getBitsNeeded("19", 10)); in TEST()
1304 EXPECT_EQ(5U, APInt::getBitsNeeded("20", 10)); in TEST()
1306 EXPECT_EQ(1U, APInt::getBitsNeeded( "+0", 10)); in TEST()
1307 EXPECT_EQ(4U, APInt::getBitsNeeded( "+9", 10)); in TEST()
1308 EXPECT_EQ(4U, APInt::getBitsNeeded("+10", 10)); in TEST()
1309 EXPECT_EQ(5U, APInt::getBitsNeeded("+19", 10)); in TEST()
1310 EXPECT_EQ(5U, APInt::getBitsNeeded("+20", 10)); in TEST()
1312 EXPECT_EQ(2U, APInt::getBitsNeeded( "-0", 10)); in TEST()
1313 EXPECT_EQ(5U, APInt::getBitsNeeded( "-9", 10)); in TEST()
1314 EXPECT_EQ(5U, APInt::getBitsNeeded("-10", 10)); in TEST()
1315 EXPECT_EQ(6U, APInt::getBitsNeeded("-19", 10)); in TEST()
1316 EXPECT_EQ(6U, APInt::getBitsNeeded("-20", 10)); in TEST()
1318 EXPECT_EQ(1U, APInt::getBitsNeeded("-1", 10)); in TEST()
1319 EXPECT_EQ(2U, APInt::getBitsNeeded("-2", 10)); in TEST()
1320 EXPECT_EQ(3U, APInt::getBitsNeeded("-4", 10)); in TEST()
1321 EXPECT_EQ(4U, APInt::getBitsNeeded("-8", 10)); in TEST()
1322 EXPECT_EQ(5U, APInt::getBitsNeeded("-16", 10)); in TEST()
1323 EXPECT_EQ(6U, APInt::getBitsNeeded("-23", 10)); in TEST()
1324 EXPECT_EQ(6U, APInt::getBitsNeeded("-32", 10)); in TEST()
1325 EXPECT_EQ(7U, APInt::getBitsNeeded("-64", 10)); in TEST()
1326 EXPECT_EQ(8U, APInt::getBitsNeeded("-127", 10)); in TEST()
1327 EXPECT_EQ(8U, APInt::getBitsNeeded("-128", 10)); in TEST()
1328 EXPECT_EQ(9U, APInt::getBitsNeeded("-255", 10)); in TEST()
1329 EXPECT_EQ(9U, APInt::getBitsNeeded("-256", 10)); in TEST()
1330 EXPECT_EQ(10U, APInt::getBitsNeeded("-512", 10)); in TEST()
1331 EXPECT_EQ(11U, APInt::getBitsNeeded("-1024", 10)); in TEST()
1332 EXPECT_EQ(12U, APInt::getBitsNeeded("-1025", 10)); in TEST()
1336 EXPECT_EQ(4U, APInt::getBitsNeeded( "0", 16)); in TEST()
1337 EXPECT_EQ(4U, APInt::getBitsNeeded( "F", 16)); in TEST()
1338 EXPECT_EQ(8U, APInt::getBitsNeeded("10", 16)); in TEST()
1339 EXPECT_EQ(8U, APInt::getBitsNeeded("1F", 16)); in TEST()
1340 EXPECT_EQ(8U, APInt::getBitsNeeded("20", 16)); in TEST()
1342 EXPECT_EQ(4U, APInt::getBitsNeeded( "+0", 16)); in TEST()
1343 EXPECT_EQ(4U, APInt::getBitsNeeded( "+F", 16)); in TEST()
1344 EXPECT_EQ(8U, APInt::getBitsNeeded("+10", 16)); in TEST()
1345 EXPECT_EQ(8U, APInt::getBitsNeeded("+1F", 16)); in TEST()
1346 EXPECT_EQ(8U, APInt::getBitsNeeded("+20", 16)); in TEST()
1348 EXPECT_EQ(5U, APInt::getBitsNeeded( "-0", 16)); in TEST()
1349 EXPECT_EQ(5U, APInt::getBitsNeeded( "-F", 16)); in TEST()
1350 EXPECT_EQ(9U, APInt::getBitsNeeded("-10", 16)); in TEST()
1351 EXPECT_EQ(9U, APInt::getBitsNeeded("-1F", 16)); in TEST()
1352 EXPECT_EQ(9U, APInt::getBitsNeeded("-20", 16)); in TEST()
1360 EXPECT_EQ(std::string(S), "0b0"); in TEST()
1363 EXPECT_EQ(std::string(S), "00"); in TEST()
1366 EXPECT_EQ(std::string(S), "0"); in TEST()
1369 EXPECT_EQ(std::string(S), "0x0"); in TEST()
1372 EXPECT_EQ(std::string(S), "0"); in TEST()
1377 EXPECT_EQ(std::string(S), "0b11111111"); in TEST()
1380 EXPECT_EQ(std::string(S), "0377"); in TEST()
1383 EXPECT_EQ(std::string(S), "255"); in TEST()
1386 EXPECT_EQ(std::string(S), "0xFF"); in TEST()
1389 EXPECT_EQ(std::string(S), "73"); in TEST()
1394 EXPECT_EQ(std::string(S), "-0b1"); in TEST()
1397 EXPECT_EQ(std::string(S), "-01"); in TEST()
1400 EXPECT_EQ(std::string(S), "-1"); in TEST()
1403 EXPECT_EQ(std::string(S), "-0x1"); in TEST()
1406 EXPECT_EQ(std::string(S), "-1"); in TEST()
1411 EXPECT_EQ(APInt(15, 7).logBase2(), 2U); in TEST()
1412 EXPECT_EQ(APInt(15, 7).ceilLogBase2(), 3U); in TEST()
1413 EXPECT_EQ(APInt(15, 7).exactLogBase2(), -1); in TEST()
1414 EXPECT_EQ(APInt(15, 8).logBase2(), 3U); in TEST()
1415 EXPECT_EQ(APInt(15, 8).ceilLogBase2(), 3U); in TEST()
1416 EXPECT_EQ(APInt(15, 8).exactLogBase2(), 3); in TEST()
1417 EXPECT_EQ(APInt(15, 9).logBase2(), 3U); in TEST()
1418 EXPECT_EQ(APInt(15, 9).ceilLogBase2(), 4U); in TEST()
1419 EXPECT_EQ(APInt(15, 9).exactLogBase2(), -1); in TEST()
1423 EXPECT_EQ(APInt(32, 3).magic().m, APInt(32, "55555556", 16)); in TEST()
1424 EXPECT_EQ(APInt(32, 3).magic().s, 0U); in TEST()
1425 EXPECT_EQ(APInt(32, 5).magic().m, APInt(32, "66666667", 16)); in TEST()
1426 EXPECT_EQ(APInt(32, 5).magic().s, 1U); in TEST()
1427 EXPECT_EQ(APInt(32, 7).magic().m, APInt(32, "92492493", 16)); in TEST()
1428 EXPECT_EQ(APInt(32, 7).magic().s, 2U); in TEST()
1432 EXPECT_EQ(APInt(32, 3).magicu().m, APInt(32, "AAAAAAAB", 16)); in TEST()
1433 EXPECT_EQ(APInt(32, 3).magicu().s, 1U); in TEST()
1434 EXPECT_EQ(APInt(32, 5).magicu().m, APInt(32, "CCCCCCCD", 16)); in TEST()
1435 EXPECT_EQ(APInt(32, 5).magicu().s, 2U); in TEST()
1436 EXPECT_EQ(APInt(32, 7).magicu().m, APInt(32, "24924925", 16)); in TEST()
1437 EXPECT_EQ(APInt(32, 7).magicu().s, 3U); in TEST()
1438 EXPECT_EQ(APInt(64, 25).magicu(1).m, APInt(64, "A3D70A3D70A3D70B", 16)); in TEST()
1439 EXPECT_EQ(APInt(64, 25).magicu(1).s, 4U); in TEST()
1464 EXPECT_EQ(ValA.toString(10, false), ValC.toString(10, false)); in TEST()
1468 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotl(0)); in TEST()
1469 EXPECT_EQ(APInt(8, 2), APInt(8, 1).rotl(1)); in TEST()
1470 EXPECT_EQ(APInt(8, 4), APInt(8, 1).rotl(2)); in TEST()
1471 EXPECT_EQ(APInt(8, 16), APInt(8, 1).rotl(4)); in TEST()
1472 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotl(8)); in TEST()
1474 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotl(0)); in TEST()
1475 EXPECT_EQ(APInt(8, 32), APInt(8, 16).rotl(1)); in TEST()
1476 EXPECT_EQ(APInt(8, 64), APInt(8, 16).rotl(2)); in TEST()
1477 EXPECT_EQ(APInt(8, 1), APInt(8, 16).rotl(4)); in TEST()
1478 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotl(8)); in TEST()
1480 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(33)); in TEST()
1481 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(APInt(32, 33))); in TEST()
1483 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(33)); in TEST()
1484 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(APInt(32, 33))); in TEST()
1485 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(APInt(33, 33))); in TEST()
1486 EXPECT_EQ(APInt(32, (1 << 8)), APInt(32, 1).rotl(APInt(32, 40))); in TEST()
1487 EXPECT_EQ(APInt(32, (1 << 30)), APInt(32, 1).rotl(APInt(31, 30))); in TEST()
1488 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotl(APInt(31, 31))); in TEST()
1490 EXPECT_EQ(APInt(32, 1), APInt(32, 1).rotl(APInt(1, 0))); in TEST()
1491 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(APInt(1, 1))); in TEST()
1493 EXPECT_EQ(APInt(32, 16), APInt(32, 1).rotl(APInt(3, 4))); in TEST()
1495 EXPECT_EQ(APInt(32, 1), APInt(32, 1).rotl(APInt(64, 64))); in TEST()
1496 EXPECT_EQ(APInt(32, 2), APInt(32, 1).rotl(APInt(64, 65))); in TEST()
1498 EXPECT_EQ(APInt(7, 24), APInt(7, 3).rotl(APInt(7, 3))); in TEST()
1499 EXPECT_EQ(APInt(7, 24), APInt(7, 3).rotl(APInt(7, 10))); in TEST()
1500 EXPECT_EQ(APInt(7, 24), APInt(7, 3).rotl(APInt(5, 10))); in TEST()
1501 EXPECT_EQ(APInt(7, 6), APInt(7, 3).rotl(APInt(12, 120))); in TEST()
1503 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotr(0)); in TEST()
1504 EXPECT_EQ(APInt(8, 8), APInt(8, 16).rotr(1)); in TEST()
1505 EXPECT_EQ(APInt(8, 4), APInt(8, 16).rotr(2)); in TEST()
1506 EXPECT_EQ(APInt(8, 1), APInt(8, 16).rotr(4)); in TEST()
1507 EXPECT_EQ(APInt(8, 16), APInt(8, 16).rotr(8)); in TEST()
1509 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotr(0)); in TEST()
1510 EXPECT_EQ(APInt(8, 128), APInt(8, 1).rotr(1)); in TEST()
1511 EXPECT_EQ(APInt(8, 64), APInt(8, 1).rotr(2)); in TEST()
1512 EXPECT_EQ(APInt(8, 16), APInt(8, 1).rotr(4)); in TEST()
1513 EXPECT_EQ(APInt(8, 1), APInt(8, 1).rotr(8)); in TEST()
1515 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotr(33)); in TEST()
1516 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotr(APInt(32, 33))); in TEST()
1518 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotr(33)); in TEST()
1519 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotr(APInt(32, 33))); in TEST()
1520 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotr(APInt(33, 33))); in TEST()
1521 EXPECT_EQ(APInt(32, (1 << 24)), APInt(32, 1).rotr(APInt(32, 40))); in TEST()
1523 EXPECT_EQ(APInt(32, (1 << 2)), APInt(32, 1).rotr(APInt(31, 30))); in TEST()
1524 EXPECT_EQ(APInt(32, (1 << 1)), APInt(32, 1).rotr(APInt(31, 31))); in TEST()
1526 EXPECT_EQ(APInt(32, 1), APInt(32, 1).rotr(APInt(1, 0))); in TEST()
1527 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotr(APInt(1, 1))); in TEST()
1529 EXPECT_EQ(APInt(32, (1 << 28)), APInt(32, 1).rotr(APInt(3, 4))); in TEST()
1531 EXPECT_EQ(APInt(32, 1), APInt(32, 1).rotr(APInt(64, 64))); in TEST()
1532 EXPECT_EQ(APInt(32, (1 << 31)), APInt(32, 1).rotr(APInt(64, 65))); in TEST()
1534 EXPECT_EQ(APInt(7, 48), APInt(7, 3).rotr(APInt(7, 3))); in TEST()
1535 EXPECT_EQ(APInt(7, 48), APInt(7, 3).rotr(APInt(7, 10))); in TEST()
1536 EXPECT_EQ(APInt(7, 48), APInt(7, 3).rotr(APInt(5, 10))); in TEST()
1537 EXPECT_EQ(APInt(7, 65), APInt(7, 3).rotr(APInt(12, 120))); in TEST()
1541 EXPECT_EQ(Rot, Big.rotr(144)); in TEST()
1543 EXPECT_EQ(APInt(32, 8), APInt(32, 1).rotl(Big)); in TEST()
1544 EXPECT_EQ(APInt(32, (1 << 29)), APInt(32, 1).rotr(Big)); in TEST()
1549 EXPECT_EQ(ValA, APInt::getSplat(8, ValA)); in TEST()
1550 EXPECT_EQ(APInt(64, 0x0101010101010101ULL), APInt::getSplat(64, ValA)); in TEST()
1553 EXPECT_EQ(APInt(4, 0xD), APInt::getSplat(4, ValB)); in TEST()
1554 EXPECT_EQ(APInt(15, 0xDB6D), APInt::getSplat(15, ValB)); in TEST()
1564 EXPECT_EQ(carry, APInt::WordType(0)); in TEST()
1565 EXPECT_EQ(singleWord, ~APInt::WordType(0) >> 1); in TEST()
1572 EXPECT_EQ(carry, APInt::WordType(1)); in TEST()
1573 EXPECT_EQ(singleWord, ~APInt::WordType(0)); in TEST()
1583 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
1591 EXPECT_EQ(carry, APInt::WordType(0)); in TEST()
1592 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
1600 EXPECT_EQ(carry, APInt::WordType(0)); in TEST()
1601 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
1609 EXPECT_EQ(carry, APInt::WordType(0)); in TEST()
1610 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
1618 EXPECT_EQ(carry, APInt::WordType(1)); in TEST()
1619 EXPECT_EQ(APInt::tcCompare(test, expected, 4), 0); in TEST()
1628 EXPECT_EQ(bool(E1 & (1ULL << i)), in TEST()
1642 EXPECT_EQ(bool(E2[i] & (1ULL << j)), in TEST()
1662 EXPECT_EQ(A1.nearestLogBase2(), A1.ceilLogBase2()); in TEST()
1667 EXPECT_EQ(A2.nearestLogBase2(), A2.logBase2()); in TEST()
1672 EXPECT_EQ(A3.nearestLogBase2(), A3.ceilLogBase2()); in TEST()
1679 EXPECT_EQ(A4.nearestLogBase2(), A4.ceilLogBase2()); in TEST()
1684 EXPECT_EQ(A5.nearestLogBase2(), A5.logBase2()); in TEST()
1689 EXPECT_EQ(A6.nearestLogBase2(), A6.ceilLogBase2()); in TEST()
1693 EXPECT_EQ(A7.nearestLogBase2(), 0ULL); in TEST()
1695 EXPECT_EQ(A8.nearestLogBase2(), UINT32_MAX); in TEST()
1700 EXPECT_EQ(A9.nearestLogBase2(), UINT32_MAX); in TEST()
1800 EXPECT_EQ(32u, X.getBitWidth()); in TEST()
1801 EXPECT_EQ(0xdeadbeefULL, X.getLimitedValue()); in TEST()
1806 EXPECT_EQ(128u, Y.getBitWidth()); in TEST()
1807 EXPECT_EQ(~0ULL, Y.getLimitedValue()); in TEST()
1809 EXPECT_EQ(2u, Y.getNumWords()); in TEST()
1810 EXPECT_EQ(0xdeadbeefdeadbeefULL, Raw[0]); in TEST()
1811 EXPECT_EQ(0xdeadbeefdeadbeefULL, Raw[1]); in TEST()
1820 EXPECT_EQ(0x00000000, APInt(16, 0x0000).byteSwap()); in TEST()
1821 EXPECT_EQ(0x0000010f, APInt(16, 0x0f01).byteSwap()); in TEST()
1822 EXPECT_EQ(0x00ff8000, APInt(24, 0x0080ff).byteSwap()); in TEST()
1823 EXPECT_EQ(0x117700ff, APInt(32, 0xff007711).byteSwap()); in TEST()
1824 EXPECT_EQ(0x228811aaffULL, APInt(40, 0xffaa118822ULL).byteSwap()); in TEST()
1825 EXPECT_EQ(0x050403020100ULL, APInt(48, 0x000102030405ULL).byteSwap()); in TEST()
1826 EXPECT_EQ(0xff050403020100ULL, APInt(56, 0x000102030405ffULL).byteSwap()); in TEST()
1827 EXPECT_EQ(0xff050403020100aaULL, APInt(64, 0xaa000102030405ffULL).byteSwap()); in TEST()
1834 EXPECT_EQ(Y, X.byteSwap()); in TEST()
1835 EXPECT_EQ(X, Y.byteSwap()); in TEST()
1841 EXPECT_EQ(1, APInt(1, 1).reverseBits()); in TEST()
1842 EXPECT_EQ(0, APInt(1, 0).reverseBits()); in TEST()
1844 EXPECT_EQ(3, APInt(2, 3).reverseBits()); in TEST()
1845 EXPECT_EQ(3, APInt(2, 3).reverseBits()); in TEST()
1847 EXPECT_EQ(0xb, APInt(4, 0xd).reverseBits()); in TEST()
1848 EXPECT_EQ(0xd, APInt(4, 0xb).reverseBits()); in TEST()
1849 EXPECT_EQ(0xf, APInt(4, 0xf).reverseBits()); in TEST()
1851 EXPECT_EQ(0x30, APInt(7, 0x6).reverseBits()); in TEST()
1852 EXPECT_EQ(0x5a, APInt(7, 0x2d).reverseBits()); in TEST()
1854 EXPECT_EQ(0x0f, APInt(8, 0xf0).reverseBits()); in TEST()
1855 EXPECT_EQ(0xf0, APInt(8, 0x0f).reverseBits()); in TEST()
1857 EXPECT_EQ(0x0f0f, APInt(16, 0xf0f0).reverseBits()); in TEST()
1858 EXPECT_EQ(0xf0f0, APInt(16, 0x0f0f).reverseBits()); in TEST()
1860 EXPECT_EQ(0x0f0f0f0f, APInt(32, 0xf0f0f0f0).reverseBits()); in TEST()
1861 EXPECT_EQ(0xf0f0f0f0, APInt(32, 0x0f0f0f0f).reverseBits()); in TEST()
1863 EXPECT_EQ(0x402880a0 >> 1, APInt(31, 0x05011402).reverseBits()); in TEST()
1865 EXPECT_EQ(0x0f0f0f0f, APInt(32, 0xf0f0f0f0).reverseBits()); in TEST()
1866 EXPECT_EQ(0xf0f0f0f0, APInt(32, 0x0f0f0f0f).reverseBits()); in TEST()
1868 EXPECT_EQ(0x0f0f0f0f0f0f0f0f, APInt(64, 0xf0f0f0f0f0f0f0f0).reverseBits()); in TEST()
1869 EXPECT_EQ(0xf0f0f0f0f0f0f0f0, APInt(64, 0x0f0f0f0f0f0f0f0f).reverseBits()); in TEST()
1876 EXPECT_EQ(Y, X.reverseBits()); in TEST()
1877 EXPECT_EQ(X, Y.reverseBits()); in TEST()
1888 EXPECT_EQ(static_cast<int64_t>(0x00123456ull), i31.getSExtValue()); in TEST()
1893 EXPECT_EQ(static_cast<int64_t>(0x012345600123456Full), i63.getSExtValue()); in TEST()
1898 EXPECT_EQ(static_cast<int64_t>(0xFFFFFF80123456FFull), i120.getSExtValue()); in TEST()
1903 EXPECT_EQ(i127.extractBits(64, 0).getZExtValue(), 0x3456FFFFFFFFFFFFull); in TEST()
1904 EXPECT_EQ(i127.extractBits(63, 64).getZExtValue(), 0x7FFFFFFFFFFF8012ull); in TEST()
1910 EXPECT_EQ(-1, i128.getSExtValue()); in TEST()
1916 EXPECT_EQ(0u, i256.getSExtValue()); in TEST()
1920 EXPECT_EQ(i257.extractBits(64, 0).getZExtValue(), 0x0000000000000000ull); in TEST()
1921 EXPECT_EQ(i257.extractBits(64, 64).getZExtValue(), 0xFFFFFFFFFFFFFFFFull); in TEST()
1922 EXPECT_EQ(i257.extractBits(64, 128).getZExtValue(), 0x00000000FFFFFFFFull); in TEST()
1923 EXPECT_EQ(i257.extractBits(65, 192).getZExtValue(), 0x0000000000000000ull); in TEST()
1928 EXPECT_EQ(i260.extractBits(64, 0).getZExtValue(), 0x8000000000007FFFull); in TEST()
1929 EXPECT_EQ(i260.extractBits(64, 64).getZExtValue(), 0x0000000000000000ull); in TEST()
1930 EXPECT_EQ(i260.extractBits(64, 128).getZExtValue(), 0xFFFFFFFFFFFF0000ull); in TEST()
1931 EXPECT_EQ(i260.extractBits(64, 192).getZExtValue(), 0xFFFFFFFFFFFFFFFFull); in TEST()
1932 EXPECT_EQ(i260.extractBits(4, 256).getZExtValue(), 0x000000000000000Full); in TEST()
1942 EXPECT_EQ(static_cast<int64_t>(0x00123456ull), i31.getSExtValue()); in TEST()
1947 EXPECT_EQ(static_cast<int64_t>(0x012345600123456Full), i63.getSExtValue()); in TEST()
1952 EXPECT_EQ(static_cast<int64_t>(0xFFFFFF80123456FFull), i120.getSExtValue()); in TEST()
1957 EXPECT_EQ(i127.extractBits(64, 0).getZExtValue(), 0x3456FFFFFFFFFFFFull); in TEST()
1958 EXPECT_EQ(i127.extractBits(63, 64).getZExtValue(), 0x7FFFFFFFFFFF8012ull); in TEST()
1964 EXPECT_EQ(-1, i128.getSExtValue()); in TEST()
1973 EXPECT_EQ(0u, i256.getSExtValue()); in TEST()
1977 EXPECT_EQ(i257.extractBitsAsZExtValue(64, 0), 0x0000000000000000ull); in TEST()
1978 EXPECT_EQ(i257.extractBitsAsZExtValue(64, 64), 0xFFFFFFFFFFFFFFFFull); in TEST()
1979 EXPECT_EQ(i257.extractBitsAsZExtValue(64, 128), 0x00000000FFFFFFFFull); in TEST()
1980 EXPECT_EQ(i257.extractBitsAsZExtValue(64, 192), 0x0000000000000000ull); in TEST()
1981 EXPECT_EQ(i257.extractBitsAsZExtValue(1, 256), 0x0000000000000000ull); in TEST()
1986 EXPECT_EQ(i260.extractBitsAsZExtValue(64, 0), 0x8000000000007FFFull); in TEST()
1987 EXPECT_EQ(i260.extractBitsAsZExtValue(64, 64), 0x0000000000000000ull); in TEST()
1988 EXPECT_EQ(i260.extractBitsAsZExtValue(64, 128), 0xFFFFFFFFFFFF0000ull); in TEST()
1989 EXPECT_EQ(i260.extractBitsAsZExtValue(64, 192), 0xFFFFFFFFFFFFFFFFull); in TEST()
1990 EXPECT_EQ(i260.extractBitsAsZExtValue(4, 256), 0x000000000000000Full); in TEST()
1995 EXPECT_EQ(0x3456, i32.extractBits(16, 4)); in TEST()
1998 EXPECT_EQ(0xFFFFFFFF, i64.extractBits(32, 0)); in TEST()
1999 EXPECT_EQ(0xFFFFFFFF, i64.trunc(32)); in TEST()
2000 EXPECT_EQ(0x01234567, i64.extractBits(32, 32)); in TEST()
2001 EXPECT_EQ(0x01234567, i64.lshr(32).trunc(32)); in TEST()
2004 EXPECT_EQ(0xFFu, i257.extractBits(16, 0)); in TEST()
2005 EXPECT_EQ(0xFFu, i257.lshr(0).trunc(16)); in TEST()
2006 EXPECT_EQ((0xFFu >> 1), i257.extractBits(16, 1)); in TEST()
2007 EXPECT_EQ((0xFFu >> 1), i257.lshr(1).trunc(16)); in TEST()
2008 EXPECT_EQ(-1, i257.extractBits(32, 64).getSExtValue()); in TEST()
2009 EXPECT_EQ(-1, i257.lshr(64).trunc(32).getSExtValue()); in TEST()
2010 EXPECT_EQ(-1, i257.extractBits(128, 128).getSExtValue()); in TEST()
2011 EXPECT_EQ(-1, i257.lshr(128).trunc(128).getSExtValue()); in TEST()
2012 EXPECT_EQ(-1, i257.extractBits(66, 191).getSExtValue()); in TEST()
2013 EXPECT_EQ(-1, i257.lshr(191).trunc(66).getSExtValue()); in TEST()
2014 EXPECT_EQ(static_cast<int64_t>(0xFFFFFFFFFF80007Full), in TEST()
2016 EXPECT_EQ(static_cast<int64_t>(0xFFFFFFFFFF80007Full), in TEST()
2018 EXPECT_EQ(static_cast<int64_t>(0xFFFFFFFFFF80007Full), in TEST()
2020 EXPECT_EQ(static_cast<int64_t>(0xFFFFFFFFFF80007Full), in TEST()
2023 EXPECT_EQ(APInt(48, 0), in TEST()
2025 EXPECT_EQ(APInt(48, 0), in TEST()
2027 EXPECT_EQ(APInt(48, 0x0000ffffffffffffull), in TEST()
2029 EXPECT_EQ(APInt(48, 0x0000ffffffffffffull), in TEST()
2031 EXPECT_EQ(APInt(48, 0x00007fffffffffffull), in TEST()
2033 EXPECT_EQ(APInt(48, 0x00007fffffffffffull), in TEST()
2040 EXPECT_EQ(0x3456u, i32.extractBitsAsZExtValue(16, 4)); in TEST()
2043 EXPECT_EQ(0xFFu, i257.extractBitsAsZExtValue(16, 0)); in TEST()
2044 EXPECT_EQ((0xFFu >> 1), i257.extractBitsAsZExtValue(16, 1)); in TEST()
2045 EXPECT_EQ(0xFFFFFFFFull, i257.extractBitsAsZExtValue(32, 64)); in TEST()
2046 EXPECT_EQ(0xFFFFFFFFFFFFFFFFull, i257.extractBitsAsZExtValue(64, 128)); in TEST()
2047 EXPECT_EQ(0xFFFFFFFFFFFFFFFFull, i257.extractBitsAsZExtValue(64, 192)); in TEST()
2048 EXPECT_EQ(0xFFFFFFFFFFFFFFFFull, i257.extractBitsAsZExtValue(64, 191)); in TEST()
2049 EXPECT_EQ(0x3u, i257.extractBitsAsZExtValue(2, 255)); in TEST()
2050 EXPECT_EQ(0xFFFFFFFFFF80007Full, i257.extractBitsAsZExtValue(64, 1)); in TEST()
2051 EXPECT_EQ(0xFFFFFFFFFFFFFFFFull, i257.extractBitsAsZExtValue(64, 65)); in TEST()
2052 EXPECT_EQ(0xFFFFFFFFFF80007Full, i257.extractBitsAsZExtValue(64, 1)); in TEST()
2053 EXPECT_EQ(0xFFFFFFFFFFFFFFFFull, i257.extractBitsAsZExtValue(64, 65)); in TEST()
2054 EXPECT_EQ(0x1ull, i257.extractBitsAsZExtValue(1, 129)); in TEST()
2056 EXPECT_EQ(APInt(48, 0), in TEST()
2058 EXPECT_EQ(APInt(48, 0x0000ffffffffffffull), in TEST()
2060 EXPECT_EQ(APInt(48, 0x00007fffffffffffull), in TEST()
2066 EXPECT_EQ(0u, i128lo64.countLeadingOnes()); in TEST()
2067 EXPECT_EQ(64u, i128lo64.countLeadingZeros()); in TEST()
2068 EXPECT_EQ(64u, i128lo64.getActiveBits()); in TEST()
2069 EXPECT_EQ(0u, i128lo64.countTrailingZeros()); in TEST()
2070 EXPECT_EQ(64u, i128lo64.countTrailingOnes()); in TEST()
2071 EXPECT_EQ(64u, i128lo64.countPopulation()); in TEST()
2076 EXPECT_EQ(0u, i64hi1lo1.countLeadingOnes()); in TEST()
2077 EXPECT_EQ(1u, i64hi1lo1.countLeadingZeros()); in TEST()
2078 EXPECT_EQ(63u, i64hi1lo1.getActiveBits()); in TEST()
2079 EXPECT_EQ(1u, i64hi1lo1.countTrailingZeros()); in TEST()
2080 EXPECT_EQ(0u, i64hi1lo1.countTrailingOnes()); in TEST()
2081 EXPECT_EQ(62u, i64hi1lo1.countPopulation()); in TEST()
2084 EXPECT_EQ(0u, i127hi1lo1.countLeadingOnes()); in TEST()
2085 EXPECT_EQ(1u, i127hi1lo1.countLeadingZeros()); in TEST()
2086 EXPECT_EQ(126u, i127hi1lo1.getActiveBits()); in TEST()
2087 EXPECT_EQ(1u, i127hi1lo1.countTrailingZeros()); in TEST()
2088 EXPECT_EQ(0u, i127hi1lo1.countTrailingOnes()); in TEST()
2089 EXPECT_EQ(125u, i127hi1lo1.countPopulation()); in TEST()
2094 EXPECT_EQ(0u, i64hi1lo1.countLeadingOnes()); in TEST()
2095 EXPECT_EQ(1u, i64hi1lo1.countLeadingZeros()); in TEST()
2096 EXPECT_EQ(63u, i64hi1lo1.getActiveBits()); in TEST()
2097 EXPECT_EQ(1u, i64hi1lo1.countTrailingZeros()); in TEST()
2098 EXPECT_EQ(0u, i64hi1lo1.countTrailingOnes()); in TEST()
2099 EXPECT_EQ(62u, i64hi1lo1.countPopulation()); in TEST()
2102 EXPECT_EQ(0u, i127hi1lo1.countLeadingOnes()); in TEST()
2103 EXPECT_EQ(1u, i127hi1lo1.countLeadingZeros()); in TEST()
2104 EXPECT_EQ(126u, i127hi1lo1.getActiveBits()); in TEST()
2105 EXPECT_EQ(1u, i127hi1lo1.countTrailingZeros()); in TEST()
2106 EXPECT_EQ(0u, i127hi1lo1.countTrailingOnes()); in TEST()
2107 EXPECT_EQ(125u, i127hi1lo1.countPopulation()); in TEST()
2110 EXPECT_EQ(1u, i64hi1lo1wrap.countLeadingOnes()); in TEST()
2111 EXPECT_EQ(0u, i64hi1lo1wrap.countLeadingZeros()); in TEST()
2112 EXPECT_EQ(64u, i64hi1lo1wrap.getActiveBits()); in TEST()
2113 EXPECT_EQ(0u, i64hi1lo1wrap.countTrailingZeros()); in TEST()
2114 EXPECT_EQ(1u, i64hi1lo1wrap.countTrailingOnes()); in TEST()
2115 EXPECT_EQ(2u, i64hi1lo1wrap.countPopulation()); in TEST()
2118 EXPECT_EQ(1u, i127hi1lo1wrap.countLeadingOnes()); in TEST()
2119 EXPECT_EQ(0u, i127hi1lo1wrap.countLeadingZeros()); in TEST()
2120 EXPECT_EQ(127u, i127hi1lo1wrap.getActiveBits()); in TEST()
2121 EXPECT_EQ(0u, i127hi1lo1wrap.countTrailingZeros()); in TEST()
2122 EXPECT_EQ(1u, i127hi1lo1wrap.countTrailingOnes()); in TEST()
2123 EXPECT_EQ(2u, i127hi1lo1wrap.countPopulation()); in TEST()
2126 EXPECT_EQ(32u, i32hiequallowrap.countLeadingOnes()); in TEST()
2127 EXPECT_EQ(0u, i32hiequallowrap.countLeadingZeros()); in TEST()
2128 EXPECT_EQ(32u, i32hiequallowrap.getActiveBits()); in TEST()
2129 EXPECT_EQ(0u, i32hiequallowrap.countTrailingZeros()); in TEST()
2130 EXPECT_EQ(32u, i32hiequallowrap.countTrailingOnes()); in TEST()
2131 EXPECT_EQ(32u, i32hiequallowrap.countPopulation()); in TEST()
2136 EXPECT_EQ(32u, i64hi32.countLeadingOnes()); in TEST()
2137 EXPECT_EQ(0u, i64hi32.countLeadingZeros()); in TEST()
2138 EXPECT_EQ(64u, i64hi32.getActiveBits()); in TEST()
2139 EXPECT_EQ(32u, i64hi32.countTrailingZeros()); in TEST()
2140 EXPECT_EQ(0u, i64hi32.countTrailingOnes()); in TEST()
2141 EXPECT_EQ(32u, i64hi32.countPopulation()); in TEST()
2146 EXPECT_EQ(31u, i64hi31.countLeadingOnes()); in TEST()
2147 EXPECT_EQ(0u, i64hi31.countLeadingZeros()); in TEST()
2148 EXPECT_EQ(64u, i64hi31.getActiveBits()); in TEST()
2149 EXPECT_EQ(33u, i64hi31.countTrailingZeros()); in TEST()
2150 EXPECT_EQ(0u, i64hi31.countTrailingOnes()); in TEST()
2151 EXPECT_EQ(31u, i64hi31.countPopulation()); in TEST()
2157 EXPECT_EQ(0u, i64lo32.countLeadingOnes()); in TEST()
2158 EXPECT_EQ(32u, i64lo32.countLeadingZeros()); in TEST()
2159 EXPECT_EQ(32u, i64lo32.getActiveBits()); in TEST()
2160 EXPECT_EQ(0u, i64lo32.countTrailingZeros()); in TEST()
2161 EXPECT_EQ(32u, i64lo32.countTrailingOnes()); in TEST()
2162 EXPECT_EQ(32u, i64lo32.countPopulation()); in TEST()
2166 EXPECT_EQ(0u, i128lo64.countLeadingOnes()); in TEST()
2167 EXPECT_EQ(64u, i128lo64.countLeadingZeros()); in TEST()
2168 EXPECT_EQ(64u, i128lo64.getActiveBits()); in TEST()
2169 EXPECT_EQ(0u, i128lo64.countTrailingZeros()); in TEST()
2170 EXPECT_EQ(64u, i128lo64.countTrailingOnes()); in TEST()
2171 EXPECT_EQ(64u, i128lo64.countPopulation()); in TEST()
2175 EXPECT_EQ(0u, i128lo24.countLeadingOnes()); in TEST()
2176 EXPECT_EQ(104u, i128lo24.countLeadingZeros()); in TEST()
2177 EXPECT_EQ(24u, i128lo24.getActiveBits()); in TEST()
2178 EXPECT_EQ(0u, i128lo24.countTrailingZeros()); in TEST()
2179 EXPECT_EQ(24u, i128lo24.countTrailingOnes()); in TEST()
2180 EXPECT_EQ(24u, i128lo24.countPopulation()); in TEST()
2184 EXPECT_EQ(0u, i128lo104.countLeadingOnes()); in TEST()
2185 EXPECT_EQ(24u, i128lo104.countLeadingZeros()); in TEST()
2186 EXPECT_EQ(104u, i128lo104.getActiveBits()); in TEST()
2187 EXPECT_EQ(0u, i128lo104.countTrailingZeros()); in TEST()
2188 EXPECT_EQ(104u, i128lo104.countTrailingOnes()); in TEST()
2189 EXPECT_EQ(104u, i128lo104.countPopulation()); in TEST()
2193 EXPECT_EQ(0u, i128lo0.countLeadingOnes()); in TEST()
2194 EXPECT_EQ(128u, i128lo0.countLeadingZeros()); in TEST()
2195 EXPECT_EQ(0u, i128lo0.getActiveBits()); in TEST()
2196 EXPECT_EQ(128u, i128lo0.countTrailingZeros()); in TEST()
2197 EXPECT_EQ(0u, i128lo0.countTrailingOnes()); in TEST()
2198 EXPECT_EQ(0u, i128lo0.countPopulation()); in TEST()
2202 EXPECT_EQ(0u, i80lo79.countLeadingOnes()); in TEST()
2203 EXPECT_EQ(1u, i80lo79.countLeadingZeros()); in TEST()
2204 EXPECT_EQ(79u, i80lo79.getActiveBits()); in TEST()
2205 EXPECT_EQ(0u, i80lo79.countTrailingZeros()); in TEST()
2206 EXPECT_EQ(79u, i80lo79.countTrailingOnes()); in TEST()
2207 EXPECT_EQ(79u, i80lo79.countPopulation()); in TEST()
2213 EXPECT_EQ(32u, i64hi32.countLeadingOnes()); in TEST()
2214 EXPECT_EQ(0u, i64hi32.countLeadingZeros()); in TEST()
2215 EXPECT_EQ(64u, i64hi32.getActiveBits()); in TEST()
2216 EXPECT_EQ(32u, i64hi32.countTrailingZeros()); in TEST()
2217 EXPECT_EQ(0u, i64hi32.countTrailingOnes()); in TEST()
2218 EXPECT_EQ(32u, i64hi32.countPopulation()); in TEST()
2222 EXPECT_EQ(64u, i128hi64.countLeadingOnes()); in TEST()
2223 EXPECT_EQ(0u, i128hi64.countLeadingZeros()); in TEST()
2224 EXPECT_EQ(128u, i128hi64.getActiveBits()); in TEST()
2225 EXPECT_EQ(64u, i128hi64.countTrailingZeros()); in TEST()
2226 EXPECT_EQ(0u, i128hi64.countTrailingOnes()); in TEST()
2227 EXPECT_EQ(64u, i128hi64.countPopulation()); in TEST()
2231 EXPECT_EQ(24u, i128hi24.countLeadingOnes()); in TEST()
2232 EXPECT_EQ(0u, i128hi24.countLeadingZeros()); in TEST()
2233 EXPECT_EQ(128u, i128hi24.getActiveBits()); in TEST()
2234 EXPECT_EQ(104u, i128hi24.countTrailingZeros()); in TEST()
2235 EXPECT_EQ(0u, i128hi24.countTrailingOnes()); in TEST()
2236 EXPECT_EQ(24u, i128hi24.countPopulation()); in TEST()
2240 EXPECT_EQ(104u, i128hi104.countLeadingOnes()); in TEST()
2241 EXPECT_EQ(0u, i128hi104.countLeadingZeros()); in TEST()
2242 EXPECT_EQ(128u, i128hi104.getActiveBits()); in TEST()
2243 EXPECT_EQ(24u, i128hi104.countTrailingZeros()); in TEST()
2244 EXPECT_EQ(0u, i128hi104.countTrailingOnes()); in TEST()
2245 EXPECT_EQ(104u, i128hi104.countPopulation()); in TEST()
2249 EXPECT_EQ(0u, i128hi0.countLeadingOnes()); in TEST()
2250 EXPECT_EQ(128u, i128hi0.countLeadingZeros()); in TEST()
2251 EXPECT_EQ(0u, i128hi0.getActiveBits()); in TEST()
2252 EXPECT_EQ(128u, i128hi0.countTrailingZeros()); in TEST()
2253 EXPECT_EQ(0u, i128hi0.countTrailingOnes()); in TEST()
2254 EXPECT_EQ(0u, i128hi0.countPopulation()); in TEST()
2258 EXPECT_EQ(1u, i80hi1.countLeadingOnes()); in TEST()
2259 EXPECT_EQ(0u, i80hi1.countLeadingZeros()); in TEST()
2260 EXPECT_EQ(80u, i80hi1.getActiveBits()); in TEST()
2261 EXPECT_EQ(79u, i80hi1.countTrailingZeros()); in TEST()
2262 EXPECT_EQ(0u, i80hi1.countTrailingOnes()); in TEST()
2263 EXPECT_EQ(1u, i80hi1.countPopulation()); in TEST()
2267 EXPECT_EQ(16u, i32hi16.countLeadingOnes()); in TEST()
2268 EXPECT_EQ(0u, i32hi16.countLeadingZeros()); in TEST()
2269 EXPECT_EQ(32u, i32hi16.getActiveBits()); in TEST()
2270 EXPECT_EQ(16u, i32hi16.countTrailingZeros()); in TEST()
2271 EXPECT_EQ(0u, i32hi16.countTrailingOnes()); in TEST()
2272 EXPECT_EQ(16u, i32hi16.countPopulation()); in TEST()
2278 EXPECT_EQ(1u, i64from63.countLeadingOnes()); in TEST()
2279 EXPECT_EQ(0u, i64from63.countLeadingZeros()); in TEST()
2280 EXPECT_EQ(64u, i64from63.getActiveBits()); in TEST()
2281 EXPECT_EQ(63u, i64from63.countTrailingZeros()); in TEST()
2282 EXPECT_EQ(0u, i64from63.countTrailingOnes()); in TEST()
2283 EXPECT_EQ(1u, i64from63.countPopulation()); in TEST()
2289 EXPECT_EQ(32u, i32.countLeadingOnes()); in TEST()
2290 EXPECT_EQ(0u, i32.countLeadingZeros()); in TEST()
2291 EXPECT_EQ(32u, i32.getActiveBits()); in TEST()
2292 EXPECT_EQ(0u, i32.countTrailingZeros()); in TEST()
2293 EXPECT_EQ(32u, i32.countTrailingOnes()); in TEST()
2294 EXPECT_EQ(32u, i32.countPopulation()); in TEST()
2298 EXPECT_EQ(64u, i64.countLeadingOnes()); in TEST()
2299 EXPECT_EQ(0u, i64.countLeadingZeros()); in TEST()
2300 EXPECT_EQ(64u, i64.getActiveBits()); in TEST()
2301 EXPECT_EQ(0u, i64.countTrailingZeros()); in TEST()
2302 EXPECT_EQ(64u, i64.countTrailingOnes()); in TEST()
2303 EXPECT_EQ(64u, i64.countPopulation()); in TEST()
2307 EXPECT_EQ(96u, i96.countLeadingOnes()); in TEST()
2308 EXPECT_EQ(0u, i96.countLeadingZeros()); in TEST()
2309 EXPECT_EQ(96u, i96.getActiveBits()); in TEST()
2310 EXPECT_EQ(0u, i96.countTrailingZeros()); in TEST()
2311 EXPECT_EQ(96u, i96.countTrailingOnes()); in TEST()
2312 EXPECT_EQ(96u, i96.countPopulation()); in TEST()
2316 EXPECT_EQ(128u, i128.countLeadingOnes()); in TEST()
2317 EXPECT_EQ(0u, i128.countLeadingZeros()); in TEST()
2318 EXPECT_EQ(128u, i128.getActiveBits()); in TEST()
2319 EXPECT_EQ(0u, i128.countTrailingZeros()); in TEST()
2320 EXPECT_EQ(128u, i128.countTrailingOnes()); in TEST()
2321 EXPECT_EQ(128u, i128.countPopulation()); in TEST()
2327 EXPECT_EQ(0xa, i32.getLoBits(4)); in TEST()
2330 EXPECT_EQ(0xa, i128.getLoBits(4)); in TEST()
2336 EXPECT_EQ(0xc, i32.getHiBits(4)); in TEST()
2339 EXPECT_EQ(0xc, i128.getHiBits(4)); in TEST()
2345 EXPECT_EQ(32u, i64hi32.countLeadingOnes()); in TEST()
2346 EXPECT_EQ(0u, i64hi32.countLeadingZeros()); in TEST()
2347 EXPECT_EQ(64u, i64hi32.getActiveBits()); in TEST()
2348 EXPECT_EQ(32u, i64hi32.countTrailingZeros()); in TEST()
2349 EXPECT_EQ(0u, i64hi32.countTrailingOnes()); in TEST()
2350 EXPECT_EQ(32u, i64hi32.countPopulation()); in TEST()
2354 EXPECT_EQ(64u, i128hi64.countLeadingOnes()); in TEST()
2355 EXPECT_EQ(0u, i128hi64.countLeadingZeros()); in TEST()
2356 EXPECT_EQ(128u, i128hi64.getActiveBits()); in TEST()
2357 EXPECT_EQ(64u, i128hi64.countTrailingZeros()); in TEST()
2358 EXPECT_EQ(0u, i128hi64.countTrailingOnes()); in TEST()
2359 EXPECT_EQ(64u, i128hi64.countPopulation()); in TEST()
2363 EXPECT_EQ(24u, i128hi24.countLeadingOnes()); in TEST()
2364 EXPECT_EQ(0u, i128hi24.countLeadingZeros()); in TEST()
2365 EXPECT_EQ(128u, i128hi24.getActiveBits()); in TEST()
2366 EXPECT_EQ(104u, i128hi24.countTrailingZeros()); in TEST()
2367 EXPECT_EQ(0u, i128hi24.countTrailingOnes()); in TEST()
2368 EXPECT_EQ(24u, i128hi24.countPopulation()); in TEST()
2372 EXPECT_EQ(104u, i128hi104.countLeadingOnes()); in TEST()
2373 EXPECT_EQ(0u, i128hi104.countLeadingZeros()); in TEST()
2374 EXPECT_EQ(128u, i128hi104.getActiveBits()); in TEST()
2375 EXPECT_EQ(24u, i128hi104.countTrailingZeros()); in TEST()
2376 EXPECT_EQ(0u, i128hi104.countTrailingOnes()); in TEST()
2377 EXPECT_EQ(104u, i128hi104.countPopulation()); in TEST()
2381 EXPECT_EQ(0u, i128hi0.countLeadingOnes()); in TEST()
2382 EXPECT_EQ(128u, i128hi0.countLeadingZeros()); in TEST()
2383 EXPECT_EQ(0u, i128hi0.getActiveBits()); in TEST()
2384 EXPECT_EQ(128u, i128hi0.countTrailingZeros()); in TEST()
2385 EXPECT_EQ(0u, i128hi0.countTrailingOnes()); in TEST()
2386 EXPECT_EQ(0u, i128hi0.countPopulation()); in TEST()
2390 EXPECT_EQ(1u, i80hi1.countLeadingOnes()); in TEST()
2391 EXPECT_EQ(0u, i80hi1.countLeadingZeros()); in TEST()
2392 EXPECT_EQ(80u, i80hi1.getActiveBits()); in TEST()
2393 EXPECT_EQ(79u, i80hi1.countTrailingZeros()); in TEST()
2394 EXPECT_EQ(0u, i80hi1.countTrailingOnes()); in TEST()
2395 EXPECT_EQ(1u, i80hi1.countPopulation()); in TEST()
2399 EXPECT_EQ(16u, i32hi16.countLeadingOnes()); in TEST()
2400 EXPECT_EQ(0u, i32hi16.countLeadingZeros()); in TEST()
2401 EXPECT_EQ(32u, i32hi16.getActiveBits()); in TEST()
2402 EXPECT_EQ(16u, i32hi16.countTrailingZeros()); in TEST()
2403 EXPECT_EQ(0u, i32hi16.countTrailingOnes()); in TEST()
2404 EXPECT_EQ(16u, i32hi16.countPopulation()); in TEST()
2413 EXPECT_EQ(GreatestCommonDivisor(Zero, Zero), Zero); in TEST()
2414 EXPECT_EQ(GreatestCommonDivisor(Zero, One), One); in TEST()
2415 EXPECT_EQ(GreatestCommonDivisor(One, Zero), One); in TEST()
2416 EXPECT_EQ(GreatestCommonDivisor(One, One), One); in TEST()
2420 EXPECT_EQ(GreatestCommonDivisor(Zero, Two), Two); in TEST()
2421 EXPECT_EQ(GreatestCommonDivisor(One, Two), One); in TEST()
2422 EXPECT_EQ(GreatestCommonDivisor(Two, Two), Two); in TEST()
2427 EXPECT_EQ(GreatestCommonDivisor(Zero, Max), Max); in TEST()
2428 EXPECT_EQ(GreatestCommonDivisor(One, Max), One); in TEST()
2429 EXPECT_EQ(GreatestCommonDivisor(Two, Max), One); in TEST()
2430 EXPECT_EQ(GreatestCommonDivisor(Max, Max), Max); in TEST()
2433 EXPECT_EQ(GreatestCommonDivisor(MaxOver2, Max), One); in TEST()
2435 EXPECT_EQ(GreatestCommonDivisor(MaxOver2, Max - 1), MaxOver2); in TEST()
2447 EXPECT_EQ(C, HugePrime); in TEST()
2454 EXPECT_EQ(1U, i256.countLeadingZeros()); in TEST()
2455 EXPECT_EQ(253U, i256.countTrailingZeros()); in TEST()
2456 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2459 EXPECT_EQ(63U, i256.countLeadingZeros()); in TEST()
2460 EXPECT_EQ(191U, i256.countTrailingZeros()); in TEST()
2461 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2464 EXPECT_EQ(128U, i256.countLeadingZeros()); in TEST()
2465 EXPECT_EQ(126U, i256.countTrailingZeros()); in TEST()
2466 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2469 EXPECT_EQ(192U, i256.countLeadingZeros()); in TEST()
2470 EXPECT_EQ(62U, i256.countTrailingZeros()); in TEST()
2471 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2474 EXPECT_EQ(255U, i256.countLeadingZeros()); in TEST()
2475 EXPECT_EQ(0U, i256.countTrailingZeros()); in TEST()
2476 EXPECT_EQ(1U, i256.countPopulation()); in TEST()
2480 EXPECT_EQ(0, neg_one.lshr(128)); in TEST()
2486 EXPECT_EQ(47U, i72.countLeadingOnes()); in TEST()
2487 EXPECT_EQ(25U, i72.countTrailingZeros()); in TEST()
2488 EXPECT_EQ(47U, i72.countPopulation()); in TEST()
2492 EXPECT_EQ(65U, i72.countLeadingOnes()); in TEST()
2493 EXPECT_EQ(7U, i72.countTrailingZeros()); in TEST()
2494 EXPECT_EQ(65U, i72.countPopulation()); in TEST()
2498 EXPECT_EQ(65U, i128.countLeadingOnes()); in TEST()
2499 EXPECT_EQ(63U, i128.countTrailingZeros()); in TEST()
2500 EXPECT_EQ(65U, i128.countPopulation()); in TEST()
2508 EXPECT_EQ(0, umax32.ashr(32)); in TEST()
2516 EXPECT_EQ(0, umax128.ashr(128)); in TEST()
2523 EXPECT_EQ(253U, i256.countLeadingZeros()); in TEST()
2524 EXPECT_EQ(1U, i256.countTrailingZeros()); in TEST()
2525 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2528 EXPECT_EQ(191U, i256.countLeadingZeros()); in TEST()
2529 EXPECT_EQ(63U, i256.countTrailingZeros()); in TEST()
2530 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2533 EXPECT_EQ(126U, i256.countLeadingZeros()); in TEST()
2534 EXPECT_EQ(128U, i256.countTrailingZeros()); in TEST()
2535 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2538 EXPECT_EQ(62U, i256.countLeadingZeros()); in TEST()
2539 EXPECT_EQ(192U, i256.countTrailingZeros()); in TEST()
2540 EXPECT_EQ(2U, i256.countPopulation()); in TEST()
2543 EXPECT_EQ(0U, i256.countLeadingZeros()); in TEST()
2544 EXPECT_EQ(255U, i256.countTrailingZeros()); in TEST()
2545 EXPECT_EQ(1U, i256.countPopulation()); in TEST()
2549 EXPECT_EQ(0, neg_one.shl(128)); in TEST()
2582 EXPECT_EQ(0, APInt(1, 0).sext(64)); in TEST()
2583 EXPECT_EQ(~uint64_t(0), APInt(1, 1).sext(64)); in TEST()
2586 EXPECT_EQ(32U, i32_max.countLeadingZeros()); in TEST()
2587 EXPECT_EQ(0U, i32_max.countTrailingZeros()); in TEST()
2588 EXPECT_EQ(31U, i32_max.countPopulation()); in TEST()
2591 EXPECT_EQ(32U, i32_min.countLeadingOnes()); in TEST()
2592 EXPECT_EQ(31U, i32_min.countTrailingZeros()); in TEST()
2593 EXPECT_EQ(32U, i32_min.countPopulation()); in TEST()
2596 EXPECT_EQ(63U, i32_neg1.countLeadingOnes()); in TEST()
2597 EXPECT_EQ(0U, i32_neg1.countTrailingZeros()); in TEST()
2598 EXPECT_EQ(63U, i32_neg1.countPopulation()); in TEST()
2603 EXPECT_EQ(0xFFFF, val.truncOrSelf(16)); in TEST()
2604 EXPECT_EQ(0xFFFFFFFF, val.truncOrSelf(32)); in TEST()
2605 EXPECT_EQ(0xFFFFFFFF, val.truncOrSelf(64)); in TEST()
2611 EXPECT_EQ(7006652, i64 * 5678); in TEST()
2612 EXPECT_EQ(7006652, 5678 * i64); in TEST()
2617 EXPECT_EQ(i128_1234, i128 * 1234); in TEST()
2618 EXPECT_EQ(i128_1234, 1234 * i128); in TEST()
2622 EXPECT_EQ(32U, i96.countLeadingOnes()); in TEST()
2623 EXPECT_EQ(32U, i96.countPopulation()); in TEST()
2624 EXPECT_EQ(64U, i96.countTrailingZeros()); in TEST()
2631 EXPECT_EQ(0, APIntOps::RoundingUDiv(Zero, A, APInt::Rounding::UP)); in TEST()
2632 EXPECT_EQ(0, APIntOps::RoundingUDiv(Zero, A, APInt::Rounding::DOWN)); in TEST()
2633 EXPECT_EQ(0, APIntOps::RoundingUDiv(Zero, A, APInt::Rounding::TOWARD_ZERO)); in TEST()
2647 EXPECT_EQ(Quo, APIntOps::RoundingUDiv(A, B, APInt::Rounding::TOWARD_ZERO)); in TEST()
2648 EXPECT_EQ(Quo, APIntOps::RoundingUDiv(A, B, APInt::Rounding::DOWN)); in TEST()
2660 EXPECT_EQ(0, APIntOps::RoundingSDiv(Zero, A, APInt::Rounding::UP)); in TEST()
2661 EXPECT_EQ(0, APIntOps::RoundingSDiv(Zero, A, APInt::Rounding::DOWN)); in TEST()
2662 EXPECT_EQ(0, APIntOps::RoundingSDiv(Zero, A, APInt::Rounding::TOWARD_ZERO)); in TEST()
2674 EXPECT_EQ(QuoTowardZero, Quo); in TEST()
2677 EXPECT_EQ(QuoTowardZero, Quo); in TEST()
2679 EXPECT_EQ(QuoTowardZero + 1, Quo); in TEST()
2685 EXPECT_EQ(QuoTowardZero, Quo); in TEST()
2688 EXPECT_EQ(QuoTowardZero - 1, Quo); in TEST()
2690 EXPECT_EQ(QuoTowardZero, Quo); in TEST()
2693 EXPECT_EQ(QuoTowardZero, in TEST()
2841 EXPECT_EQ(APIntOps::GetMostSignificantDifferentBit(APInt(8, 0), APInt(8, 0)), in TEST()
2843 EXPECT_EQ( in TEST()
2846 EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 0), APInt(8, 1)), in TEST()
2848 EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 0), APInt(8, 2)), in TEST()
2850 EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 0), APInt(8, 3)), in TEST()
2852 EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 0)), in TEST()
2854 EXPECT_EQ(APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 1)), in TEST()
2856 EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 2)), in TEST()
2858 EXPECT_EQ(*APIntOps::GetMostSignificantDifferentBit(APInt(8, 1), APInt(8, 3)), in TEST()
2860 EXPECT_EQ( in TEST()
2887 EXPECT_EQ(Bit, GetHighestDifferentBitBruteforce(A, B)); in TEST()
2890 EXPECT_EQ(A, B); in TEST()
2901 EXPECT_EQ(Adash, Bdash); in TEST()