merge Compiler::load and Compiler::loadz

This commit is contained in:
Joshua Warner
2014-05-01 11:13:52 -06:00
parent 85f114ea0f
commit 99fa560257
4 changed files with 80 additions and 62 deletions

View File

@ -2627,7 +2627,8 @@ class MyCompiler: public Compiler {
static_cast<Value*>(dst));
}
virtual Operand* load(ir::Type srcType,
virtual Operand* load(ir::SignExtendMode signExtend,
ir::Type srcType,
ir::Type srcSelectType,
Operand* src,
ir::Type dstType)
@ -2638,27 +2639,7 @@ class MyCompiler: public Compiler {
Value* dst = value(&c, static_cast<Value*>(src)->type);
appendMove(&c,
lir::Move,
srcType.size(),
srcSelectType.size(),
static_cast<Value*>(src),
dstType.size(),
dst);
return dst;
}
virtual Operand* loadz(ir::Type srcType,
ir::Type srcSelectType,
Operand* src,
ir::Type dstType)
{
assert(&c, dstType.size() >= TargetBytesPerWord);
assert(&c, srcType.flavor() == srcSelectType.flavor());
assert(&c, srcType.flavor() == dstType.flavor());
Value* dst = value(&c, static_cast<Value*>(src)->type);
appendMove(&c,
lir::MoveZ,
signExtend == ir::SignExtend ? lir::Move : lir::MoveZ,
srcType.size(),
srcSelectType.size(),
static_cast<Value*>(src),