diff options
| author | buzbee <buzbee@google.com> | 2012-11-30 06:46:45 -0800 |
|---|---|---|
| committer | buzbee <buzbee@google.com> | 2012-11-30 12:21:43 -0800 |
| commit | c8129911e598ad0ca8d7b31012444ab6ce8bce45 (patch) | |
| tree | ecb49da68ba80edaa0ece59f835f9ebd3295c0d4 /vm/compiler/codegen/arm/CodegenCommon.cpp | |
| parent | 436d13bf317ceaa28bd2a5ea0483f956f0082413 (diff) | |
JIT: Performance fix for const doubles
Some recent Arm processors take a performance hit when
creating a floating point double by loading it as a pair of singles.
Legacy code to support soft floating point doubles as a pair of core
registers loaded double immediates in this way.
With the CL, we handle double immediates as a single unit.
Change-Id: I91aca9da6d4b38e180479dd8f75c82dbc7b4a526
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenCommon.cpp')
| -rw-r--r-- | vm/compiler/codegen/arm/CodegenCommon.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vm/compiler/codegen/arm/CodegenCommon.cpp b/vm/compiler/codegen/arm/CodegenCommon.cpp index 07f3ac765..5c02678fe 100644 --- a/vm/compiler/codegen/arm/CodegenCommon.cpp +++ b/vm/compiler/codegen/arm/CodegenCommon.cpp @@ -368,6 +368,25 @@ static ArmLIR *scanLiteralPool(LIR *dataTarget, int value, unsigned int delta) return NULL; } +/* Search the existing constants in the literal pool for an exact wide match */ +ArmLIR* scanLiteralPoolWide(LIR* dataTarget, int valLo, int valHi) +{ + bool lowMatch = false; + ArmLIR* lowTarget = NULL; + while (dataTarget) { + if (lowMatch && (((ArmLIR *)dataTarget)->operands[0] == valHi)) { + return lowTarget; + } + lowMatch = false; + if (((ArmLIR *) dataTarget)->operands[0] == valLo) { + lowMatch = true; + lowTarget = (ArmLIR *) dataTarget; + } + dataTarget = dataTarget->next; + } + return NULL; +} + /* * The following are building blocks to insert constants into the pool or * instruction streams. @@ -392,6 +411,14 @@ static ArmLIR *addWordData(CompilationUnit *cUnit, LIR **constantListP, return NULL; } +/* Add a 64-bit constant to the literal pool or mixed with code */ +ArmLIR* addWideData(CompilationUnit* cUnit, LIR** constantListP, + int valLo, int valHi) +{ + addWordData(cUnit, constantListP, valHi); + return addWordData(cUnit, constantListP, valLo); +} + static RegLocation inlinedTargetWide(CompilationUnit *cUnit, MIR *mir, bool fpHint) { |
