switch Compiler::load* to use ir::Type rather than sizes

This commit is contained in:
Joshua Warner
2014-05-01 00:13:39 -06:00
committed by Joshua Warner
parent 9c98986f99
commit 27ea503233
3 changed files with 119 additions and 90 deletions

View File

@ -2626,25 +2626,39 @@ class MyCompiler: public Compiler {
static_cast<Value*>(dst));
}
virtual Operand* load(unsigned srcSize, unsigned srcSelectSize, Operand* src,
unsigned dstSize)
virtual Operand* load(ir::Type srcType,
ir::Type srcSelectType,
Operand* src,
ir::Type dstType)
{
assert(&c, dstSize >= TargetBytesPerWord);
assert(&c, dstType.size() >= TargetBytesPerWord);
Value* dst = value(&c, static_cast<Value*>(src)->type);
appendMove(&c, lir::Move, srcSize, srcSelectSize, static_cast<Value*>(src),
dstSize, dst);
appendMove(&c,
lir::Move,
srcType.size(),
srcSelectType.size(),
static_cast<Value*>(src),
dstType.size(),
dst);
return dst;
}
virtual Operand* loadz(unsigned srcSize, unsigned srcSelectSize,
Operand* src, unsigned dstSize)
virtual Operand* loadz(ir::Type srcType,
ir::Type srcSelectType,
Operand* src,
ir::Type dstType)
{
assert(&c, dstSize >= TargetBytesPerWord);
assert(&c, dstType.size() >= TargetBytesPerWord);
Value* dst = value(&c, static_cast<Value*>(src)->type);
appendMove(&c, lir::MoveZ, srcSize, srcSelectSize, static_cast<Value*>(src),
dstSize, dst);
appendMove(&c,
lir::MoveZ,
srcType.size(),
srcSelectType.size(),
static_cast<Value*>(src),
dstType.size(),
dst);
return dst;
}