diff --git a/include/avian/codegen/compiler.h b/include/avian/codegen/compiler.h index 36f89690b4..fb34919a03 100644 --- a/include/avian/codegen/compiler.h +++ b/include/avian/codegen/compiler.h @@ -137,8 +137,8 @@ class Compiler { virtual void nullaryOp(lir::Operation op) = 0; virtual ir::Value* f2f(ir::Type resType, ir::Value* a) = 0; - virtual ir::Value* f2i(ir::Type aType, ir::Type resType, ir::Value* a) = 0; - virtual ir::Value* i2f(ir::Type aType, ir::Type resType, ir::Value* a) = 0; + virtual ir::Value* f2i(ir::Type resType, ir::Value* a) = 0; + virtual ir::Value* i2f(ir::Type resType, ir::Value* a) = 0; virtual void compile(uintptr_t stackOverflowHandler, unsigned stackLimitOffset) = 0; diff --git a/src/codegen/compiler.cpp b/src/codegen/compiler.cpp index 05a99bb49c..1a17e9f9cd 100644 --- a/src/codegen/compiler.cpp +++ b/src/codegen/compiler.cpp @@ -2696,7 +2696,6 @@ class MyCompiler: public Compiler { { assert(&c, isFloatValue(a)); assert(&c, resType.flavor() == ir::Type::Float); - assert(&c, a->type.flavor() == ir::Type::Float); Value* result = value(&c, resType); appendTranslate(&c, lir::Float2Float, @@ -2707,32 +2706,28 @@ class MyCompiler: public Compiler { return result; } - virtual ir::Value* f2i(ir::Type aType, ir::Type resType, ir::Value* a) + virtual ir::Value* f2i(ir::Type resType, ir::Value* a) { - assert(&c, aType == a->type); assert(&c, isFloatValue(a)); assert(&c, resType.flavor() != ir::Type::Float); - assert(&c, aType.flavor() == ir::Type::Float); Value* result = value(&c, resType); appendTranslate(&c, lir::Float2Int, - aType.size(), + a->type.size(), static_cast(a), resType.size(), result); return result; } - virtual ir::Value* i2f(ir::Type aType, ir::Type resType, ir::Value* a) + virtual ir::Value* i2f(ir::Type resType, ir::Value* a) { - assert(&c, aType == a->type); assert(&c, isGeneralValue(a)); assert(&c, resType.flavor() == ir::Type::Float); - assert(&c, aType.flavor() != ir::Type::Float); Value* result = value(&c, resType); appendTranslate(&c, lir::Int2Float, - aType.size(), + a->type.size(), static_cast(a), resType.size(), result); diff --git a/src/compile.cpp b/src/compile.cpp index 4e50fad7dc..660a53e908 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -4432,11 +4432,11 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, } break; case d2i: { - frame->pushInt(c->f2i(types.f8, types.i4, frame->popLong())); + frame->pushInt(c->f2i(types.i4, frame->popLong())); } break; case d2l: { - frame->pushLong(c->f2i(types.f8, types.i8, frame->popLong())); + frame->pushLong(c->f2i(types.i8, frame->popLong())); } break; case dadd: @@ -4533,11 +4533,11 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, } break; case f2i: { - frame->pushInt(c->f2i(types.f4, types.i4, frame->popInt())); + frame->pushInt(c->f2i(types.i4, frame->popInt())); } break; case f2l: { - frame->pushLong(c->f2i(types.f4, types.i8, frame->popInt())); + frame->pushLong(c->f2i(types.i8, frame->popInt())); } break; case fadd: @@ -4816,11 +4816,11 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, } break; case i2d: { - frame->pushDouble(c->i2f(types.i4, types.f8, frame->popInt())); + frame->pushDouble(c->i2f(types.f8, frame->popInt())); } break; case i2f: { - frame->pushFloat(c->i2f(types.i4, types.f4, frame->popInt())); + frame->pushFloat(c->i2f(types.f4, frame->popInt())); } break; case i2l: @@ -5321,11 +5321,11 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, } break; case l2d: { - frame->pushDouble(c->i2f(types.i8, types.f8, frame->popLong())); + frame->pushDouble(c->i2f(types.f8, frame->popLong())); } break; case l2f: { - frame->pushFloat(c->i2f(types.i8, types.f4, frame->popLong())); + frame->pushFloat(c->i2f(types.f4, frame->popLong())); } break; case l2i: