remove redundant f2i & i2f aType parameter

This commit is contained in:
Joshua Warner 2014-05-03 20:00:10 -06:00 committed by Joshua Warner
parent c9313d5802
commit b853f1a594
3 changed files with 14 additions and 19 deletions

View File

@ -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;

View File

@ -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<Value*>(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<Value*>(a),
resType.size(),
result);

View File

@ -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: