|
From: Petar J. <pe...@so...> - 2020-01-14 17:47:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8b809cdbba8dbb8ae3093bf68653e47dbff7e215 commit 8b809cdbba8dbb8ae3093bf68653e47dbff7e215 Author: Petar Jovanovic <mip...@gm...> Date: Tue Jan 14 17:45:00 2020 +0000 mips: Implement Iex_CCall for nanoMIPS Implement Iex_CCall for nanoMIPS. This fixes none/tests/nestedfns. Patch by Stefan Maksimovic. Diff: --- VEX/priv/host_nanomips_isel.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/VEX/priv/host_nanomips_isel.c b/VEX/priv/host_nanomips_isel.c index 59adf58..d348f21 100644 --- a/VEX/priv/host_nanomips_isel.c +++ b/VEX/priv/host_nanomips_isel.c @@ -877,8 +877,23 @@ static HReg iselWordExpr_R_wrk(ISelEnv * env, IRExpr * e) } case Iex_CCall: { - /* unimplemented yet */ - vassert(0); + HReg r_dst = newVRegI(env); + UInt addToSp = 0; + RetLoc rloc = mk_RetLoc_INVALID(); + + /* Be very restrictive for now. Only 32-bit ints allowed for + args, and 32 bits for return type. Don't forget to change + the RetLoc if more return types are allowed in future. */ + vassert(Ity_I32 == e->Iex.CCall.retty); + + /* Marshal args, do the call, clear stack. */ + doHelperCall(&rloc, env, NULL /*guard*/, e->Iex.CCall.cee, + e->Iex.CCall.retty, e->Iex.CCall.args); + vassert(is_sane_RetLoc(rloc)); + vassert(rloc.pri == RLPri_Int); + vassert(addToSp == 0); + addInstr(env, mk_iMOVds_RR(r_dst, hregNANOMIPS_GPR4())); + return r_dst; } default: |