Skip to content

Commit 413aaf1

Browse files
committed
[clang][Interp][NFC] Support IntAP(S) in emitPrimCast
1 parent 8ab753c commit 413aaf1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3685,12 +3685,22 @@ bool ByteCodeExprGen<Emitter>::emitPrimCast(PrimType FromT, PrimType ToT,
36853685
return this->emitCastFP(ToSem, getRoundingMode(E), E);
36863686
}
36873687

3688+
if (ToT == PT_IntAP)
3689+
return this->emitCastFloatingIntegralAP(Ctx.getBitWidth(ToQT), E);
3690+
if (ToT == PT_IntAPS)
3691+
return this->emitCastFloatingIntegralAPS(Ctx.getBitWidth(ToQT), E);
3692+
36883693
// Float to integral.
36893694
if (isIntegralType(ToT) || ToT == PT_Bool)
36903695
return this->emitCastFloatingIntegral(ToT, E);
36913696
}
36923697

36933698
if (isIntegralType(FromT) || FromT == PT_Bool) {
3699+
if (ToT == PT_IntAP)
3700+
return this->emitCastAP(FromT, Ctx.getBitWidth(ToQT), E);
3701+
if (ToT == PT_IntAPS)
3702+
return this->emitCastAPS(FromT, Ctx.getBitWidth(ToQT), E);
3703+
36943704
// Integral to integral.
36953705
if (isIntegralType(ToT) || ToT == PT_Bool)
36963706
return FromT != ToT ? this->emitCast(FromT, ToT, E) : true;

0 commit comments

Comments
 (0)