|
From: Dmitry B. <dba...@gm...> - 2006-05-31 07:40:50
|
Hello, I am writing custom valgrind tool. For this work I have to pass float values to the tool helper functions. How should I do this? At first I thought, that I should use something like this: IRTemp temp = newIRTemp(bb->tyenv, Ity_I32); addStmtToIRBB(bb, IRStmt_Tmp(temp, IRExpr_Unop(Iop_ReinterpF32asI32, st->Ist.Store.data))); But this didn't work, because Iop_ReinterpF32asI32 isn't handled in the iselIntExpr_R_wrk() ... -- With best wishes Dmitry Baryshkov |
|
From: Julian S. <js...@ac...> - 2006-05-31 10:51:13
|
> But this didn't work, because Iop_ReinterpF32asI32 isn't handled
> in the iselIntExpr_R_wrk() ...
Hmm. Your options are:
(1) teach iselIntExpr_R_wrk() how to handle Iop_ReinterpF32asI32
(2) do everything at 64 bits, so first widen the value to F64
using Iop_F32toF64, and then do Iop_ReinterpF64asI64. That
should work.
(1) is more efficient, but (2) is easier to do since you don't have
to hack the instruction selector(s).
J
|