From ce97b6eecbd3b2d19cf771dc4530c516d44c064f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 13 Sep 2007 19:42:12 -0600 Subject: [PATCH] implement i2d and i2f --- src/run.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/run.cpp b/src/run.cpp index 7e57d6e0f2..933690243f 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -1209,6 +1209,18 @@ run(Thread* t) pushInt(t, static_cast(popInt(t))); } goto loop; + case i2d: { + double f = static_cast(popInt(t)); + int64_t i; memcpy(&i, &f, 8); + pushLong(t, i); + } goto loop; + + case i2f: { + float f = static_cast(popInt(t)); + int32_t i; memcpy(&i, &f, 4); + pushInt(t, i); + } goto loop; + case i2l: { pushLong(t, popInt(t)); } goto loop;