mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +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,
|
virtual void checkBounds(Operand* object, unsigned lengthOffset,
|
||||||
Operand* index, intptr_t handler) = 0;
|
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,
|
virtual void store(ir::Type srcType,
|
||||||
Operand* src,
|
Operand* src,
|
||||||
Operand* dst) = 0;
|
Operand* dst) = 0;
|
||||||
|
@ -2609,6 +2609,22 @@ class MyCompiler: public Compiler {
|
|||||||
static_cast<Value*>(index), handler);
|
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,
|
virtual void store(ir::Type srcType,
|
||||||
Operand* src,
|
Operand* src,
|
||||||
Operand* dst)
|
Operand* dst)
|
||||||
|
@ -4831,8 +4831,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case i2l:
|
case i2l:
|
||||||
frame->pushLong(c->load(
|
frame->pushLong(c->truncateThenExtend(
|
||||||
ir::SignExtend, types.address, types.i4, frame->popInt(), types.i8));
|
ir::SignExtend, types.i8, types.i4, frame->popInt()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case i2s: {
|
case i2s: {
|
||||||
|
Loading…
Reference in New Issue
Block a user