Codegen.h revision 9bc3df373ae6f4f7e6e97d554884d4e0dbad5494
1/* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef _DALVIK_VM_COMPILER_CODEGEN_ARM_CODEGEN_H 18#define _DALVIK_VM_COMPILER_CODEGEN_ARM_CODEGEN_H 19 20/* 21 * Forward declarations for common routines in Codegen.c used by ISA 22 * variant code such as ThumbUtilty.c 23 */ 24 25static ArmLIR *newLIR0(CompilationUnit *cUnit, ArmOpCode opCode); 26static ArmLIR *newLIR1(CompilationUnit *cUnit, ArmOpCode opCode, 27 int dest); 28static ArmLIR *newLIR2(CompilationUnit *cUnit, ArmOpCode opCode, 29 int dest, int src1); 30static ArmLIR *newLIR3(CompilationUnit *cUnit, ArmOpCode opCode, 31 int dest, int src1, int src2); 32static ArmLIR *newLIR23(CompilationUnit *cUnit, ArmOpCode opCode, 33 int srcdest, int src2); 34static ArmLIR *scanLiteralPool(CompilationUnit *cUnit, int value, 35 unsigned int delta); 36static ArmLIR *addWordData(CompilationUnit *cUnit, int value, bool inPlace); 37static inline ArmLIR *genCheckCommon(CompilationUnit *cUnit, int dOffset, 38 ArmLIR *branch, 39 ArmLIR *pcrLabel); 40 41/* Routines which must be supplied by the variant-specific code */ 42static void genDispatchToHandler(CompilationUnit *cUnit, TemplateOpCode opCode); 43bool dvmCompilerArchInit(void); 44static bool genInlineSqrt(CompilationUnit *cUnit, MIR *mir); 45static bool genInlineCos(CompilationUnit *cUnit, MIR *mir); 46static bool genInlineSin(CompilationUnit *cUnit, MIR *mir); 47static bool genConversion(CompilationUnit *cUnit, MIR *mir); 48static bool genArithOpFloat(CompilationUnit *cUnit, MIR *mir, int vDest, 49 int vSrc1, int vSrc2); 50static bool genArithOpDouble(CompilationUnit *cUnit, MIR *mir, int vDest, 51 int vSrc1, int vSrc2); 52static bool genCmpX(CompilationUnit *cUnit, MIR *mir, int vDest, int vSrc1, 53 int vSrc2); 54 55 56 57#endif /* _DALVIK_VM_COMPILER_CODEGEN_ARM_CODEGEN_H */ 58