buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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 ART_SRC_COMPILER_COMPILERCODEGEN_H_ |
| 18 | #define ART_SRC_COMPILER_COMPILERCODEGEN_H_ |
| 19 | |
| 20 | #include "../CompilerIR.h" |
| 21 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 22 | namespace art { |
| 23 | |
buzbee | a2ebdd7 | 2012-03-04 14:57:06 -0800 | [diff] [blame] | 24 | LIR* rawLIR(CompilationUnit* cUnit, int dalvikOffset, int opcode, int op0 = 0, |
Ian Rogers | b5d09b2 | 2012-03-06 22:14:17 -0800 | [diff] [blame] | 25 | int op1 = 0, int op2 = 0, int op3 = 0, int op4 = 0, LIR* target = NULL); |
buzbee | a2ebdd7 | 2012-03-04 14:57:06 -0800 | [diff] [blame] | 26 | |
buzbee | e88dfbf | 2012-03-05 11:19:57 -0800 | [diff] [blame] | 27 | int oatGetInsnSize(LIR* lir); |
| 28 | |
buzbee | 84fd693 | 2012-03-29 16:44:16 -0700 | [diff] [blame^] | 29 | void genFusedLongCmpBranch(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir); |
| 30 | void genFusedFPCmpBranch(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir, |
| 31 | bool gtBias, bool isDouble); |
| 32 | |
| 33 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 34 | /* Lower middle-level IR to low-level IR for the whole method */ |
| 35 | void oatMethodMIR2LIR(CompilationUnit* cUnit); |
| 36 | |
buzbee | 16da88c | 2012-03-20 10:38:17 -0700 | [diff] [blame] | 37 | /* Lower middle-level IR to low-level IR for the simple methods */ |
| 38 | void oatSpecialMIR2LIR(CompilationUnit* cUnit, SpecialCaseHandler specialCase ); |
| 39 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 40 | /* Assemble LIR into machine code */ |
| 41 | void oatAssembleLIR(CompilationUnit* cUnit); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 42 | AssemblerStatus oatAssembleInstructions(CompilationUnit* cUnit, |
| 43 | intptr_t startAddr); |
| 44 | void oatAssignOffsets(CompilationUnit* cUnit); |
| 45 | int oatAssignInsnOffsets(CompilationUnit* cUnit); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 46 | |
| 47 | /* Implemented in the codegen/<target>/ArchUtility.c */ |
| 48 | void oatCodegenDump(CompilationUnit* cUnit); |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 49 | void oatDumpPromotionMap(CompilationUnit* cUnit); |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 50 | std::string buildInsnString(const char* fmt, LIR* lir, |
| 51 | unsigned char* baseAddr); |
| 52 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 53 | |
| 54 | /* Implemented in codegen/<target>/Ralloc.c */ |
| 55 | void oatSimpleRegAlloc(CompilationUnit* cUnit); |
| 56 | |
| 57 | /* Implemented in codegen/<target>/Thumb<version>Util.c */ |
| 58 | void oatInitializeRegAlloc(CompilationUnit* cUnit); |
| 59 | |
| 60 | /* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */ |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 61 | InstructionSet oatInstructionSet(); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 62 | |
| 63 | /* |
| 64 | * Implemented in codegen/<target>/<target_variant>/ArchVariant.c |
| 65 | * Architecture-specific initializations and checks |
| 66 | */ |
| 67 | bool oatArchVariantInit(void); |
| 68 | |
| 69 | /* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */ |
| 70 | int oatTargetOptHint(int key); |
| 71 | |
| 72 | /* Implemented in codegen/<target>/<target_variant>/ArchVariant.c */ |
| 73 | void oatGenMemBarrier(CompilationUnit* cUnit, int barrierKind); |
| 74 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 75 | } // namespace art |
| 76 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 77 | #endif // ART_SRC_COMPILER_COMPILERCODEGEN_H_ |