diff options
Diffstat (limited to 'vm/compiler/codegen/armv5te')
-rw-r--r-- | vm/compiler/codegen/armv5te/Armv5teLIR.h | 14 | ||||
-rw-r--r-- | vm/compiler/codegen/armv5te/Codegen.c | 161 | ||||
-rw-r--r-- | vm/compiler/codegen/armv5te/Codegen.h | 36 | ||||
-rw-r--r-- | vm/compiler/codegen/armv5te/FpCodegen-armv5te-vfp.c | 161 | ||||
-rw-r--r-- | vm/compiler/codegen/armv5te/FpCodegen-armv5te.c | 70 | ||||
-rw-r--r-- | vm/compiler/codegen/armv5te/FpCodegen.h | 32 |
6 files changed, 408 insertions, 66 deletions
diff --git a/vm/compiler/codegen/armv5te/Armv5teLIR.h b/vm/compiler/codegen/armv5te/Armv5teLIR.h index 5268ee8ef..3341e496b 100644 --- a/vm/compiler/codegen/armv5te/Armv5teLIR.h +++ b/vm/compiler/codegen/armv5te/Armv5teLIR.h @@ -180,4 +180,18 @@ typedef struct Armv5teLIR { #define CHAIN_CELL_OFFSET_TAG 0xcdab +/* Create the TemplateOpcode enum */ +#define JIT_TEMPLATE(X) TEMPLATE_##X, +typedef enum { +#include "../../template/armv5te/TemplateOpList.h" +/* + * For example, + * TEMPLATE_CMP_LONG, + * TEMPLATE_RETURN, + * ... + */ + TEMPLATE_LAST_MARK, +} TemplateOpCode; +#undef JIT_TEMPLATE + #endif /* _DALVIK_VM_COMPILER_CODEGEN_ARMV5TE_H */ diff --git a/vm/compiler/codegen/armv5te/Codegen.c b/vm/compiler/codegen/armv5te/Codegen.c index 257272cb4..448a539ac 100644 --- a/vm/compiler/codegen/armv5te/Codegen.c +++ b/vm/compiler/codegen/armv5te/Codegen.c @@ -19,23 +19,10 @@ #include "libdex/OpCode.h" #include "dexdump/OpCodeNames.h" #include "vm/compiler/CompilerInternals.h" +#include "FpCodegen.h" #include "Armv5teLIR.h" #include "vm/mterp/common/FindInterface.h" -/* Create the TemplateOpcode enum */ -#define JIT_TEMPLATE(X) TEMPLATE_##X, -typedef enum { -#include "../../template/armv5te/TemplateOpList.h" -/* - * For example, - * TEMPLATE_CMP_LONG, - * TEMPLATE_RETURN, - * ... - */ - TEMPLATE_LAST_MARK, -} TemplateOpCode; -#undef JIT_TEMPLATE - /* Array holding the entry offset of each template relative to the first one */ static intptr_t templateEntryOffsets[TEMPLATE_LAST_MARK]; @@ -339,7 +326,6 @@ static void loadValueAddress(CompilationUnit *cUnit, int vSrc, int rDest) } } - /* Load a single value from rFP[src] and store them into rDest */ static void loadValue(CompilationUnit *cUnit, int vSrc, int rDest) { @@ -653,9 +639,8 @@ static bool genShiftOpLong(CompilationUnit *cUnit, MIR *mir, int vDest, storeValuePair(cUnit, r0, r1, vDest, r2); return false; } - -static bool genArithOpFloat(CompilationUnit *cUnit, MIR *mir, int vDest, - int vSrc1, int vSrc2) +bool dvmCompilerGenArithOpFloatPortable(CompilationUnit *cUnit, MIR *mir, + int vDest, int vSrc1, int vSrc2) { void* funct; /* TODO: use a proper include file to define these */ @@ -704,8 +689,8 @@ static bool genArithOpFloat(CompilationUnit *cUnit, MIR *mir, int vDest, return false; } -static bool genArithOpDouble(CompilationUnit *cUnit, MIR *mir, int vDest, - int vSrc1, int vSrc2) +bool dvmCompilerGenArithOpDoublePortable(CompilationUnit *cUnit, MIR *mir, + int vDest, int vSrc1, int vSrc2) { void* funct; /* TODO: use a proper include file to define these */ @@ -960,22 +945,22 @@ static bool genArithOp(CompilationUnit *cUnit, MIR *mir) return genArithOpInt(cUnit,mir, vA, vB, vC); } if ((opCode >= OP_ADD_FLOAT_2ADDR) && (opCode <= OP_REM_FLOAT_2ADDR)) { - return genArithOpFloat(cUnit,mir, vA, vA, vB); + return dvmCompilerGenArithOpFloat(cUnit,mir, vA, vA, vB); } if ((opCode >= OP_ADD_FLOAT) && (opCode <= OP_REM_FLOAT)) { - return genArithOpFloat(cUnit,mir, vA, vB, vC); + return dvmCompilerGenArithOpFloat(cUnit, mir, vA, vB, vC); } if ((opCode >= OP_ADD_DOUBLE_2ADDR) && (opCode <= OP_REM_DOUBLE_2ADDR)) { - return genArithOpDouble(cUnit,mir, vA, vA, vB); + return dvmCompilerGenArithOpDouble(cUnit,mir, vA, vA, vB); } if ((opCode >= OP_ADD_DOUBLE) && (opCode <= OP_REM_DOUBLE)) { - return genArithOpDouble(cUnit,mir, vA, vB, vC); + return dvmCompilerGenArithOpDouble(cUnit,mir, vA, vB, vC); } return true; } -static bool genConversion(CompilationUnit *cUnit, MIR *mir, void *funct, - int srcSize, int tgtSize) +static bool genConversionCall(CompilationUnit *cUnit, MIR *mir, void *funct, + int srcSize, int tgtSize) { loadConstant(cUnit, r2, (int)funct); if (srcSize == 1) { @@ -1475,13 +1460,10 @@ static bool handleFmt11x(CompilationUnit *cUnit, MIR *mir) return false; } -static bool handleFmt12x(CompilationUnit *cUnit, MIR *mir) +bool dvmCompilerGenConversionPortable(CompilationUnit *cUnit, MIR *mir) { OpCode opCode = mir->dalvikInsn.opCode; - int vSrc1Dest = mir->dalvikInsn.vA; - int vSrc2 = mir->dalvikInsn.vB; - /* TODO - find the proper include file to declare these */ float __aeabi_i2f( int op1 ); int __aeabi_f2iz( float op1 ); float __aeabi_d2f( double op1 ); @@ -1493,31 +1475,57 @@ static bool handleFmt12x(CompilationUnit *cUnit, MIR *mir) long __aeabi_d2lz( double op1 ); double __aeabi_l2d( long op1 ); + switch (opCode) { + case OP_INT_TO_FLOAT: + return genConversionCall(cUnit, mir, (void*)__aeabi_i2f, 1, 1); + case OP_FLOAT_TO_INT: + return genConversionCall(cUnit, mir, (void*)__aeabi_f2iz, 1, 1); + case OP_DOUBLE_TO_FLOAT: + return genConversionCall(cUnit, mir, (void*)__aeabi_d2f, 2, 1); + case OP_FLOAT_TO_DOUBLE: + return genConversionCall(cUnit, mir, (void*)__aeabi_f2d, 1, 2); + case OP_INT_TO_DOUBLE: + return genConversionCall(cUnit, mir, (void*)__aeabi_i2d, 1, 2); + case OP_DOUBLE_TO_INT: + return genConversionCall(cUnit, mir, (void*)__aeabi_d2iz, 2, 1); + case OP_FLOAT_TO_LONG: + return genConversionCall(cUnit, mir, (void*)__aeabi_f2lz, 1, 2); + case OP_LONG_TO_FLOAT: + return genConversionCall(cUnit, mir, (void*)__aeabi_l2f, 2, 1); + case OP_DOUBLE_TO_LONG: + return genConversionCall(cUnit, mir, (void*)__aeabi_d2lz, 2, 2); + case OP_LONG_TO_DOUBLE: + return genConversionCall(cUnit, mir, (void*)__aeabi_l2d, 2, 2); + default: + return true; + } + return false; +} + +static bool handleFmt12x(CompilationUnit *cUnit, MIR *mir) +{ + OpCode opCode = mir->dalvikInsn.opCode; + int vSrc1Dest = mir->dalvikInsn.vA; + int vSrc2 = mir->dalvikInsn.vB; + + /* TODO - find the proper include file to declare these */ + if ( (opCode >= OP_ADD_INT_2ADDR) && (opCode <= OP_REM_DOUBLE_2ADDR)) { return genArithOp( cUnit, mir ); } switch (opCode) { case OP_INT_TO_FLOAT: - return genConversion(cUnit, mir, (void*)__aeabi_i2f, 1, 1); case OP_FLOAT_TO_INT: - return genConversion(cUnit, mir, (void*)__aeabi_f2iz, 1, 1); case OP_DOUBLE_TO_FLOAT: - return genConversion(cUnit, mir, (void*)__aeabi_d2f, 2, 1); case OP_FLOAT_TO_DOUBLE: - return genConversion(cUnit, mir, (void*)__aeabi_f2d, 1, 2); case OP_INT_TO_DOUBLE: - return genConversion(cUnit, mir, (void*)__aeabi_i2d, 1, 2); case OP_DOUBLE_TO_INT: - return genConversion(cUnit, mir, (void*)__aeabi_d2iz, 2, 1); case OP_FLOAT_TO_LONG: - return genConversion(cUnit, mir, (void*)__aeabi_f2lz, 1, 2); case OP_LONG_TO_FLOAT: - return genConversion(cUnit, mir, (void*)__aeabi_l2f, 2, 1); case OP_DOUBLE_TO_LONG: - return genConversion(cUnit, mir, (void*)__aeabi_d2lz, 2, 2); case OP_LONG_TO_DOUBLE: - return genConversion(cUnit, mir, (void*)__aeabi_l2d, 2, 2); + return dvmCompilerGenConversion(cUnit, mir); case OP_NEG_INT: case OP_NOT_INT: return genArithOpInt(cUnit, mir, vSrc1Dest, vSrc1Dest, vSrc2); @@ -1525,9 +1533,11 @@ static bool handleFmt12x(CompilationUnit *cUnit, MIR *mir) case OP_NOT_LONG: return genArithOpLong(cUnit,mir, vSrc1Dest, vSrc1Dest, vSrc2); case OP_NEG_FLOAT: - return genArithOpFloat(cUnit,mir,vSrc1Dest,vSrc1Dest,vSrc2); + return dvmCompilerGenArithOpFloat(cUnit, mir, vSrc1Dest, + vSrc1Dest, vSrc2); case OP_NEG_DOUBLE: - return genArithOpDouble(cUnit,mir,vSrc1Dest,vSrc1Dest,vSrc2); + return dvmCompilerGenArithOpDouble(cUnit, mir, vSrc1Dest, + vSrc1Dest, vSrc2); case OP_MOVE_WIDE: loadValuePair(cUnit, mir->dalvikInsn.vB, r0, r1); storeValuePair(cUnit, r0, r1, mir->dalvikInsn.vA, r2); @@ -2036,34 +2046,15 @@ static bool handleFmt23x(CompilationUnit *cUnit, MIR *mir) } switch (opCode) { - case OP_CMP_LONG: - loadValuePair(cUnit,vB, r0, r1); - loadValuePair(cUnit, vC, r2, r3); - genDispatchToHandler(cUnit, TEMPLATE_CMP_LONG); - storeValue(cUnit, r0, vA, r1); - break; case OP_CMPL_FLOAT: - loadValue(cUnit, vB, r0); - loadValue(cUnit, vC, r1); - genDispatchToHandler(cUnit, TEMPLATE_CMPL_FLOAT); - storeValue(cUnit, r0, vA, r1); - break; case OP_CMPG_FLOAT: - loadValue(cUnit, vB, r0); - loadValue(cUnit, vC, r1); - genDispatchToHandler(cUnit, TEMPLATE_CMPG_FLOAT); - storeValue(cUnit, r0, vA, r1); - break; case OP_CMPL_DOUBLE: - loadValueAddress(cUnit, vB, r0); - loadValueAddress(cUnit, vC, r1); - genDispatchToHandler(cUnit, TEMPLATE_CMPL_DOUBLE); - storeValue(cUnit, r0, vA, r1); - break; case OP_CMPG_DOUBLE: - loadValueAddress(cUnit, vB, r0); - loadValueAddress(cUnit, vC, r1); - genDispatchToHandler(cUnit, TEMPLATE_CMPG_DOUBLE); + return dvmCompilerGenCmpX(cUnit, mir, vA, vB, vC); + case OP_CMP_LONG: + loadValuePair(cUnit,vB, r0, r1); + loadValuePair(cUnit, vC, r2, r3); + genDispatchToHandler(cUnit, TEMPLATE_CMP_LONG); storeValue(cUnit, r0, vA, r1); break; case OP_AGET_WIDE: @@ -2905,3 +2896,41 @@ void dvmCompilerArchDump(void) LOGD("dalvik.vm.jitop = %s", buf); } } + +/* + * Exported version of loadValueAddress + * TODO: revisit source file structure + */ +void dvmCompilerLoadValueAddress(CompilationUnit *cUnit, int vSrc, int rDest) +{ + loadValueAddress(cUnit, vSrc, rDest); +} + +/* + * Exported version of genDispatchToHandler + * TODO: revisit source file structure + */ +void dvmCompilerGenDispatchToHandler(CompilationUnit *cUnit, + TemplateOpCode opCode) +{ + genDispatchToHandler(cUnit, opCode); +} + +/* + * Exported version of loadValue + * TODO: revisit source file structure + */ +void dvmCompilerLoadValue(CompilationUnit *cUnit, int vSrc, int rDest) +{ + loadValue(cUnit, vSrc, rDest); +} + +/* + * Exported version of storeValue + * TODO: revisit source file structure + */ +void dvmCompilerStoreValue(CompilationUnit *cUnit, int rSrc, int vDest, + int rScratch) +{ + storeValue(cUnit, rSrc, vDest, rScratch); +} diff --git a/vm/compiler/codegen/armv5te/Codegen.h b/vm/compiler/codegen/armv5te/Codegen.h new file mode 100644 index 000000000..f156e600e --- /dev/null +++ b/vm/compiler/codegen/armv5te/Codegen.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Dalvik.h" +#include "compiler/CompilerInternals.h" +#include "Armv5teLIR.h" + +#ifndef _DALVIK_VM_COMPILER_CODEGEN_CODEGEN_H +#define _DALVIK_VM_COMPILER_CODEGEN_CODEGEN_H + +bool dvmCompilerGenConversionPortable(CompilationUnit *cUnit, MIR *mir); +bool dvmCompilerGenArithOpFloatPortable(CompilationUnit *cUnit, MIR *mir, + int vDest, int vSrc1, int vSrc2); +bool dvmCompilerGenArithOpDoublePortable(CompilationUnit *cUnit, MIR *mir, + int vDest, int vSrc1, int vSrc2); +void dvmCompilerLoadValueAddress(CompilationUnit *cUnit, int vSrc, int rDest); +void dvmCompilerGenDispatchToHandler(CompilationUnit *cUnit, + TemplateOpCode opCode); +void dvmCompilerLoadValue(CompilationUnit *cUnit, int vSrc, int rDest); +void dvmCompilerStoreValue(CompilationUnit *cUnit, int rSrc, int vDest, + int rScratch); + +#endif /* _DALVIK_VM_COMPILER_CODEGEN_CODEGEN_H */ diff --git a/vm/compiler/codegen/armv5te/FpCodegen-armv5te-vfp.c b/vm/compiler/codegen/armv5te/FpCodegen-armv5te-vfp.c new file mode 100644 index 000000000..7e483c868 --- /dev/null +++ b/vm/compiler/codegen/armv5te/FpCodegen-armv5te-vfp.c @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Dalvik.h" +#include "Armv5teLIR.h" +#include "Codegen.h" + +bool dvmCompilerGenArithOpFloat(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2) +{ + TemplateOpCode opCode; + + switch (mir->dalvikInsn.opCode) { + case OP_ADD_FLOAT_2ADDR: + case OP_ADD_FLOAT: + opCode = TEMPLATE_ADD_FLOAT_VFP; + break; + case OP_SUB_FLOAT_2ADDR: + case OP_SUB_FLOAT: + opCode = TEMPLATE_SUB_FLOAT_VFP; + case OP_DIV_FLOAT_2ADDR: + case OP_DIV_FLOAT: + opCode = TEMPLATE_DIV_FLOAT_VFP; + break; + case OP_MUL_FLOAT_2ADDR: + case OP_MUL_FLOAT: + opCode = TEMPLATE_MUL_FLOAT_VFP; + break; + case OP_REM_FLOAT_2ADDR: + case OP_REM_FLOAT: + case OP_NEG_FLOAT: { + return dvmCompilerGenArithOpFloatPortable(cUnit, mir, vDest, + vSrc1, vSrc2); + } + default: + return true; + } + dvmCompilerLoadValueAddress(cUnit, vDest, r0); + dvmCompilerLoadValueAddress(cUnit, vSrc1, r1); + dvmCompilerLoadValueAddress(cUnit, vSrc2, r2); + dvmCompilerGenDispatchToHandler(cUnit, opCode); + return false; +} + +bool dvmCompilerGenArithOpDouble(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2) +{ + TemplateOpCode opCode; + + switch (mir->dalvikInsn.opCode) { + case OP_ADD_DOUBLE_2ADDR: + case OP_ADD_DOUBLE: + opCode = TEMPLATE_ADD_DOUBLE_VFP; + break; + case OP_SUB_DOUBLE_2ADDR: + case OP_SUB_DOUBLE: + opCode = TEMPLATE_SUB_DOUBLE_VFP; + break; + case OP_DIV_DOUBLE_2ADDR: + case OP_DIV_DOUBLE: + opCode = TEMPLATE_DIV_DOUBLE_VFP; + break; + case OP_MUL_DOUBLE_2ADDR: + case OP_MUL_DOUBLE: + opCode = TEMPLATE_MUL_DOUBLE_VFP; + break; + case OP_REM_DOUBLE_2ADDR: + case OP_REM_DOUBLE: + case OP_NEG_DOUBLE: { + return dvmCompilerGenArithOpDoublePortable(cUnit, mir, vDest, + vSrc1, vSrc2); + } + default: + return true; + } + dvmCompilerLoadValueAddress(cUnit, vDest, r0); + dvmCompilerLoadValueAddress(cUnit, vSrc1, r1); + dvmCompilerLoadValueAddress(cUnit, vSrc2, r2); + dvmCompilerGenDispatchToHandler(cUnit, opCode); + return false; +} + +bool dvmCompilerGenConversion(CompilationUnit *cUnit, MIR *mir) +{ + OpCode opCode = mir->dalvikInsn.opCode; + int vSrc1Dest = mir->dalvikInsn.vA; + int vSrc2 = mir->dalvikInsn.vB; + TemplateOpCode template; + + switch (opCode) { + case OP_INT_TO_FLOAT: + template = TEMPLATE_INT_TO_FLOAT_VFP; + break; + case OP_FLOAT_TO_INT: + template = TEMPLATE_FLOAT_TO_INT_VFP; + break; + case OP_DOUBLE_TO_FLOAT: + template = TEMPLATE_DOUBLE_TO_FLOAT_VFP; + break; + case OP_FLOAT_TO_DOUBLE: + template = TEMPLATE_FLOAT_TO_DOUBLE_VFP; + break; + case OP_INT_TO_DOUBLE: + template = TEMPLATE_INT_TO_DOUBLE_VFP; + break; + case OP_DOUBLE_TO_INT: + template = TEMPLATE_DOUBLE_TO_INT_VFP; + break; + case OP_FLOAT_TO_LONG: + case OP_LONG_TO_FLOAT: + case OP_DOUBLE_TO_LONG: + case OP_LONG_TO_DOUBLE: + return dvmCompilerGenConversionPortable(cUnit, mir); + default: + return true; + } + dvmCompilerLoadValueAddress(cUnit, vSrc1Dest, r0); + dvmCompilerLoadValueAddress(cUnit, vSrc2, r1); + dvmCompilerGenDispatchToHandler(cUnit, template); + return false; +} + +bool dvmCompilerGenCmpX(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2) +{ + TemplateOpCode template; + switch(mir->dalvikInsn.opCode) { + case OP_CMPL_FLOAT: + template = TEMPLATE_CMPL_FLOAT_VFP; + break; + case OP_CMPG_FLOAT: + template = TEMPLATE_CMPG_FLOAT_VFP; + break; + case OP_CMPL_DOUBLE: + template = TEMPLATE_CMPL_DOUBLE_VFP; + break; + case OP_CMPG_DOUBLE: + template = TEMPLATE_CMPG_DOUBLE_VFP; + break; + default: + return true; + } + dvmCompilerLoadValueAddress(cUnit, vSrc1, r0); + dvmCompilerLoadValueAddress(cUnit, vSrc2, r1); + dvmCompilerGenDispatchToHandler(cUnit, template); + dvmCompilerStoreValue(cUnit, r0, vDest, r1); + return false; +} diff --git a/vm/compiler/codegen/armv5te/FpCodegen-armv5te.c b/vm/compiler/codegen/armv5te/FpCodegen-armv5te.c new file mode 100644 index 000000000..26a40bcf9 --- /dev/null +++ b/vm/compiler/codegen/armv5te/FpCodegen-armv5te.c @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Dalvik.h" +#include "Armv5teLIR.h" +#include "Codegen.h" + +bool dvmCompilerGenConversion(CompilationUnit *cUnit, MIR *mir) +{ + return dvmCompilerGenConversionPortable(cUnit, mir); +} + +bool dvmCompilerGenArithOpFloat(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2) +{ + return dvmCompilerGenArithOpFloatPortable(cUnit, mir, vDest, vSrc1, vSrc2); +} + +bool dvmCompilerGenArithOpDouble(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2) +{ + return dvmCompilerGenArithOpDoublePortable(cUnit, mir, vDest, vSrc1, vSrc2); +} + +bool dvmCompilerGenCmpX(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2) +{ + switch (mir->dalvikInsn.opCode) { + case OP_CMPL_FLOAT: + dvmCompilerLoadValue(cUnit, vSrc1, r0); + dvmCompilerLoadValue(cUnit, vSrc2, r1); + dvmCompilerGenDispatchToHandler(cUnit, TEMPLATE_CMPL_FLOAT); + dvmCompilerStoreValue(cUnit, r0, vDest, r1); + break; + case OP_CMPG_FLOAT: + dvmCompilerLoadValue(cUnit, vSrc1, r0); + dvmCompilerLoadValue(cUnit, vSrc2, r1); + dvmCompilerGenDispatchToHandler(cUnit, TEMPLATE_CMPG_FLOAT); + dvmCompilerStoreValue(cUnit, r0, vDest, r1); + break; + case OP_CMPL_DOUBLE: + dvmCompilerLoadValueAddress(cUnit, vSrc1, r0); + dvmCompilerLoadValueAddress(cUnit, vSrc2, r1); + dvmCompilerGenDispatchToHandler(cUnit, TEMPLATE_CMPL_DOUBLE); + dvmCompilerStoreValue(cUnit, r0, vDest, r1); + break; + case OP_CMPG_DOUBLE: + dvmCompilerLoadValueAddress(cUnit, vSrc1, r0); + dvmCompilerLoadValueAddress(cUnit, vSrc2, r1); + dvmCompilerGenDispatchToHandler(cUnit, TEMPLATE_CMPG_DOUBLE); + dvmCompilerStoreValue(cUnit, r0, vDest, r1); + break; + default: + return true; + } + return false; +} diff --git a/vm/compiler/codegen/armv5te/FpCodegen.h b/vm/compiler/codegen/armv5te/FpCodegen.h new file mode 100644 index 000000000..72625b53f --- /dev/null +++ b/vm/compiler/codegen/armv5te/FpCodegen.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Dalvik.h" +#include "compiler/CompilerInternals.h" + +#ifndef _DALVIK_VM_COMPILER_CODEGEN_FPCODEGEN_H +#define _DALVIK_VM_COMPILER_CODEGEN_FPCODEGEN_H + +bool dvmCompilerGenConversion(CompilationUnit *cUnit, MIR *mir); +bool dvmCompilerGenArithOpFloat(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2); +bool dvmCompilerGenArithOpDouble(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2); +bool dvmCompilerGenCmpX(CompilationUnit *cUnit, MIR *mir, int vDest, + int vSrc1, int vSrc2); + + +#endif /* _DALVIK_VM_COMPILER_CODEGEN_FPCODEGEN_H */ |