File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -480,19 +480,25 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *CE) {
480
480
}
481
481
}
482
482
483
+ auto maybeNegate = [&]() -> bool {
484
+ if (CE->getCastKind () == CK_BooleanToSignedIntegral)
485
+ return this ->emitNeg (*ToT, CE);
486
+ return true ;
487
+ };
488
+
483
489
if (ToT == PT_IntAP)
484
- return this ->emitCastAP (*FromT, Ctx.getBitWidth (CE->getType ()), CE);
490
+ return this ->emitCastAP (*FromT, Ctx.getBitWidth (CE->getType ()), CE) &&
491
+ maybeNegate ();
485
492
if (ToT == PT_IntAPS)
486
- return this ->emitCastAPS (*FromT, Ctx.getBitWidth (CE->getType ()), CE);
493
+ return this ->emitCastAPS (*FromT, Ctx.getBitWidth (CE->getType ()), CE) &&
494
+ maybeNegate ();
487
495
488
496
if (FromT == ToT)
489
497
return true ;
490
498
if (!this ->emitCast (*FromT, *ToT, CE))
491
499
return false ;
492
500
493
- if (CE->getCastKind () == CK_BooleanToSignedIntegral)
494
- return this ->emitNeg (*ToT, CE);
495
- return true ;
501
+ return maybeNegate ();
496
502
}
497
503
498
504
case CK_PointerToBoolean:
Original file line number Diff line number Diff line change @@ -90,3 +90,14 @@ namespace Temporaries {
90
90
};
91
91
int &&s = S().w[1 ];
92
92
}
93
+
94
+ #ifdef __SIZEOF_INT128__
95
+ namespace bigint {
96
+ typedef __attribute__ ((__ext_vector_type__(4 ))) __int128 bigint4;
97
+ constexpr bigint4 A = (bigint4)true ;
98
+ static_assert (A[0 ] == -1 , " " );
99
+ static_assert (A[1 ] == -1 , " " );
100
+ static_assert (A[2 ] == -1 , " " );
101
+ static_assert (A[3 ] == -1 , " " );
102
+ }
103
+ #endif
You can’t perform that action at this time.
0 commit comments