mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
add Compiler::truncateThenExtend
This commit is contained in:
parent
99fa560257
commit
26d8e8aa1f
@ -107,6 +107,11 @@ class Compiler {
|
||||
virtual void checkBounds(Operand* object, unsigned lengthOffset,
|
||||
Operand* index, intptr_t handler) = 0;
|
||||
|
||||
virtual Operand* truncateThenExtend(ir::SignExtendMode signExtend,
|
||||
ir::Type extendType,
|
||||
ir::Type truncateType,
|
||||
Operand* src) = 0;
|
||||
|
||||
virtual void store(ir::Type srcType,
|
||||
Operand* src,
|
||||
Operand* dst) = 0;
|
||||
|
@ -2609,6 +2609,22 @@ class MyCompiler: public Compiler {
|
||||
static_cast<Value*>(index), handler);
|
||||
}
|
||||
|
||||
virtual Operand* truncateThenExtend(ir::SignExtendMode signExtend,
|
||||
ir::Type extendType,
|
||||
ir::Type truncateType,
|
||||
Operand* src)
|
||||
{
|
||||
Value* dst = value(&c, extendType);
|
||||
appendMove(&c,
|
||||
signExtend == ir::SignExtend ? lir::Move : lir::MoveZ,
|
||||
TargetBytesPerWord,
|
||||
truncateType.size(),
|
||||
static_cast<Value*>(src),
|
||||
extendType.size(),
|
||||
dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
virtual void store(ir::Type srcType,
|
||||
Operand* src,
|
||||
Operand* dst)
|
||||
|
@ -4831,8 +4831,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
} break;
|
||||
|
||||
case i2l:
|
||||
frame->pushLong(c->load(
|
||||
ir::SignExtend, types.address, types.i4, frame->popInt(), types.i8));
|
||||
frame->pushLong(c->truncateThenExtend(
|
||||
ir::SignExtend, types.i8, types.i4, frame->popInt()));
|
||||
break;
|
||||
|
||||
case i2s: {
|
||||
|
Loading…
Reference in New Issue
Block a user