File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -218,21 +218,19 @@ template <bool Signed> class IntegralAP final {
218218
219219 static bool bitAnd (IntegralAP A, IntegralAP B, unsigned OpBits,
220220 IntegralAP *R) {
221- // FIXME: Implement.
222- assert (false );
221+ *R = IntegralAP (A.V & B.V );
223222 return false ;
224223 }
225224
226225 static bool bitOr (IntegralAP A, IntegralAP B, unsigned OpBits,
227226 IntegralAP *R) {
228- assert ( false );
227+ *R = IntegralAP (A. V | B. V );
229228 return false ;
230229 }
231230
232231 static bool bitXor (IntegralAP A, IntegralAP B, unsigned OpBits,
233232 IntegralAP *R) {
234- // FIXME: Implement.
235- assert (false );
233+ *R = IntegralAP (A.V ^ B.V );
236234 return false ;
237235 }
238236
Original file line number Diff line number Diff line change @@ -172,4 +172,16 @@ namespace Bitfields {
172172 // expected-warning {{changes value from 100 to 0}}
173173}
174174
175+ namespace BitOps {
176+ constexpr unsigned __int128 UZero = 0 ;
177+ constexpr unsigned __int128 Max = ~UZero;
178+ static_assert (Max == ~0 , " " );
179+ static_assert ((Max & 0 ) == 0 , " " );
180+ static_assert ((UZero | 0 ) == 0 , " " );
181+ static_assert ((Max ^ Max) == 0 , " " );
182+ static_assert ((Max & 1 ) == 1 , " " );
183+ static_assert ((UZero | 1 ) == 1 , " " );
184+ static_assert ((Max ^ UZero) == Max, " " );
185+ }
186+
175187#endif
You can’t perform that action at this time.
0 commit comments