blob: b484cd23d875e58a54d1611076f54bde8347b3f5 [file] [log] [blame]
Bill Buzbee9bc3df32009-07-30 10:52:29 -07001/*
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
Ben Chengd7d426a2009-09-22 11:23:36 -070025static void annotateDalvikRegAccess(ArmLIR *lir, int regId, bool isLoad);
Ben Chengdcf3e5d2009-09-11 13:42:05 -070026static void setupResourceMasks(ArmLIR *lir);
Bill Buzbee9bc3df32009-07-30 10:52:29 -070027static ArmLIR *newLIR0(CompilationUnit *cUnit, ArmOpCode opCode);
28static ArmLIR *newLIR1(CompilationUnit *cUnit, ArmOpCode opCode,
29 int dest);
30static ArmLIR *newLIR2(CompilationUnit *cUnit, ArmOpCode opCode,
31 int dest, int src1);
32static ArmLIR *newLIR3(CompilationUnit *cUnit, ArmOpCode opCode,
33 int dest, int src1, int src2);
Bill Buzbee270c1d62009-08-13 16:58:07 -070034static ArmLIR *newLIR4(CompilationUnit *cUnit, ArmOpCode opCode,
35 int dest, int src1, int src2, int info);
Bill Buzbee9bc3df32009-07-30 10:52:29 -070036static ArmLIR *scanLiteralPool(CompilationUnit *cUnit, int value,
37 unsigned int delta);
38static ArmLIR *addWordData(CompilationUnit *cUnit, int value, bool inPlace);
39static inline ArmLIR *genCheckCommon(CompilationUnit *cUnit, int dOffset,
40 ArmLIR *branch,
41 ArmLIR *pcrLabel);
Ben Chengd7d426a2009-09-22 11:23:36 -070042static void genBarrier(CompilationUnit *cUnit);
Bill Buzbee9bc3df32009-07-30 10:52:29 -070043
44/* Routines which must be supplied by the variant-specific code */
45static void genDispatchToHandler(CompilationUnit *cUnit, TemplateOpCode opCode);
Bill Buzbee9bc3df32009-07-30 10:52:29 -070046static bool genInlineSqrt(CompilationUnit *cUnit, MIR *mir);
47static bool genInlineCos(CompilationUnit *cUnit, MIR *mir);
48static bool genInlineSin(CompilationUnit *cUnit, MIR *mir);
49static bool genConversion(CompilationUnit *cUnit, MIR *mir);
50static bool genArithOpFloat(CompilationUnit *cUnit, MIR *mir, int vDest,
51 int vSrc1, int vSrc2);
52static bool genArithOpDouble(CompilationUnit *cUnit, MIR *mir, int vDest,
53 int vSrc1, int vSrc2);
54static bool genCmpX(CompilationUnit *cUnit, MIR *mir, int vDest, int vSrc1,
55 int vSrc2);
Ben Chengd7d426a2009-09-22 11:23:36 -070056static bool compilerArchVariantInit();
Bill Buzbee9bc3df32009-07-30 10:52:29 -070057
58#endif /* _DALVIK_VM_COMPILER_CODEGEN_ARM_CODEGEN_H */