================ @@ -59,13 +59,54 @@ static void pushInt(InterpState &S, int32_t Val) { llvm_unreachable("Int isn't 16 or 32 bit?"); } -static bool retInt(InterpState &S, CodePtr OpPC, APValue &Result) { - PrimType IntType = getIntPrimType(S); - if (IntType == PT_Sint32) - return Ret<PT_Sint32>(S, OpPC, Result); - else if (IntType == PT_Sint16) - return Ret<PT_Sint16>(S, OpPC, Result); - llvm_unreachable("Int isn't 16 or 32 bit?"); +static void pushAPSInt(InterpState &S, const APSInt &Val) { + bool Signed = Val.isSigned(); + + if (Signed) { + switch (Val.getBitWidth()) { + case 64: + S.Stk.push<Integral<64, true>>( + Integral<64, true>::from(Val.getSExtValue())); + break; + case 32: + S.Stk.push<Integral<32, true>>( + Integral<32, true>::from(Val.getSExtValue())); + break; + case 16: + S.Stk.push<Integral<16, true>>( + Integral<16, true>::from(Val.getSExtValue())); + break; + case 8: + S.Stk.push<Integral<8, true>>( + Integral<8, true>::from(Val.getSExtValue())); + break; + default: + llvm_unreachable("Invalid integer bitwidth"); ---------------- AaronBallman wrote:
`_BitInt`? Not that you need to support it in this patch, but I do wonder if this design is painting us into a corner. https://github.com/llvm/llvm-project/pull/71687 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits