aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-08-07 14:33:55 +0200
committerErik Verbruggen <erik.verbruggen@digia.com>2014-08-13 10:00:32 +0200
commitccb69a858fcf1b42ff36605007aeabc3dbb4a8d7 (patch)
treee8b7a41091e0cd37f7486317c45ad4629afe7698 /src
parentcf9b3c334d70d5018b438f37518b057ead9199c0 (diff)
V4 JIT: tweak generated int32 to double conversion code
If the target is a FP register, and the source is a memory address, do not load the int32 ourselves, but leave it to the assembler to decide what to do. On x86(_64) this is generates a single instruction, while on ARM the assembler will insert a load on its own. For the case where the target is not a FP register, use the return value register as base register for the target address. The advantage is that the address calculation is now independent of the preceding conversion, so it can fit in a different pipeline without dependencies. Change-Id: Ib7cefa636274ba8596e4d11ae0170a091a0def3e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jit/qv4isel_masm_p.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qml/jit/qv4isel_masm_p.h b/src/qml/jit/qv4isel_masm_p.h
index f54b18d494..af518a0851 100644
--- a/src/qml/jit/qv4isel_masm_p.h
+++ b/src/qml/jit/qv4isel_masm_p.h
@@ -179,6 +179,15 @@ private:
{
if (IR::Temp *targetTemp = target->asTemp()) {
if (targetTemp->kind == IR::Temp::PhysicalRegister) {
+ if (IR::Temp *sourceTemp = source->asTemp()) {
+ if (sourceTemp->kind == IR::Temp::PhysicalRegister) {
+ _as->convertInt32ToDouble((Assembler::RegisterID) sourceTemp->index,
+ (Assembler::FPRegisterID) targetTemp->index);
+ } else {
+ _as->convertInt32ToDouble(_as->loadAddress(Assembler::ReturnValueRegister, sourceTemp),
+ (Assembler::FPRegisterID) targetTemp->index);
+ }
+ }
_as->convertInt32ToDouble(_as->toInt32Register(source, Assembler::ScratchRegister),
(Assembler::FPRegisterID) targetTemp->index);
return;
@@ -187,7 +196,7 @@ private:
_as->convertInt32ToDouble(_as->toInt32Register(source, Assembler::ScratchRegister),
Assembler::FPGpr0);
- _as->storeDouble(Assembler::FPGpr0, _as->loadAddress(Assembler::ScratchRegister, target));
+ _as->storeDouble(Assembler::FPGpr0, _as->loadAddress(Assembler::ReturnValueRegister, target));
}
void convertUIntToDouble(IR::Expr *source, IR::Expr *target)