use ir::Type in f2i and friends, instead of aSize

This commit is contained in:
Joshua Warner
2014-04-30 22:02:57 -06:00
committed by Joshua Warner
parent 704c05f818
commit 6ed7681dc0
3 changed files with 29 additions and 21 deletions

View File

@ -2649,42 +2649,50 @@ class MyCompiler: public Compiler {
return result;
}
virtual Operand* f2f(unsigned aSize, ir::Type resType, Operand* a)
virtual Operand* f2f(ir::Type aType, ir::Type resType, Operand* a)
{
assert(&c, aType == static_cast<Value*>(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::Float2Float,
aSize,
aType.size(),
static_cast<Value*>(a),
resType.size(),
result);
return result;
}
virtual Operand* f2i(unsigned aSize, ir::Type resType, Operand* a)
virtual Operand* f2i(ir::Type aType, ir::Type resType, Operand* a)
{
// TODO: enable when possible
// assert(&c, aType == static_cast<Value*>(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,
aSize,
aType.size(),
static_cast<Value*>(a),
resType.size(),
result);
return result;
}
virtual Operand* i2f(unsigned aSize, ir::Type resType, Operand* a)
virtual Operand* i2f(ir::Type aType, ir::Type resType, Operand* a)
{
// TODO: enable when possible
// assert(&c, aType == static_cast<Value*>(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,
aSize,
aType.size(),
static_cast<Value*>(a),
resType.size(),
result);