| Bill Buzbee | 9bc3df3 | 2009-07-30 10:52:29 -0700 | [diff] [blame] | 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 | |
| Bill Buzbee | 9bc3df3 | 2009-07-30 10:52:29 -0700 | [diff] [blame] | 17 | /* |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 18 | * This file contains register alloction support and is intended to be |
| 19 | * included by: |
| 20 | * |
| 21 | * Codegen-$(TARGET_ARCH_VARIANT).c |
| 22 | * |
| Bill Buzbee | 9bc3df3 | 2009-07-30 10:52:29 -0700 | [diff] [blame] | 23 | */ |
| 24 | |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 25 | #include "compiler/CompilerIR.h" |
| Ben Cheng | bd1326d | 2010-04-02 15:04:53 -0700 | [diff] [blame] | 26 | #include "CalloutHelper.h" |
| Bill Buzbee | 9bc3df3 | 2009-07-30 10:52:29 -0700 | [diff] [blame] | 27 | |
| Ben Cheng | fc075c2 | 2010-05-28 15:20:08 -0700 | [diff] [blame] | 28 | #if defined(_CODEGEN_C) |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 29 | /* |
| 30 | * loadConstant() sometimes needs to add a small imm to a pre-existing constant |
| 31 | */ |
| 32 | static ArmLIR *opRegImm(CompilationUnit *cUnit, OpKind op, int rDestSrc1, |
| 33 | int value); |
| 34 | static ArmLIR *opRegReg(CompilationUnit *cUnit, OpKind op, int rDestSrc1, |
| 35 | int rSrc2); |
| Bill Buzbee | 9bc3df3 | 2009-07-30 10:52:29 -0700 | [diff] [blame] | 36 | |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 37 | /* Forward decalraton the portable versions due to circular dependency */ |
| 38 | static bool genArithOpFloatPortable(CompilationUnit *cUnit, MIR *mir, |
| 39 | RegLocation rlDest, RegLocation rlSrc1, |
| 40 | RegLocation rlSrc2); |
| 41 | |
| 42 | static bool genArithOpDoublePortable(CompilationUnit *cUnit, MIR *mir, |
| 43 | RegLocation rlDest, RegLocation rlSrc1, |
| 44 | RegLocation rlSrc2); |
| 45 | |
| 46 | static bool genConversionPortable(CompilationUnit *cUnit, MIR *mir); |
| 47 | |
| Carl Shapiro | 01605d2 | 2011-02-01 11:32:44 -0800 | [diff] [blame] | 48 | #if defined(__ARM_ARCH_5__) |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 49 | static void genMonitorPortable(CompilationUnit *cUnit, MIR *mir); |
| Ben Cheng | fc075c2 | 2010-05-28 15:20:08 -0700 | [diff] [blame] | 50 | #endif |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 51 | |
| Bill Buzbee | 434bae6 | 2010-03-27 10:58:03 -0700 | [diff] [blame] | 52 | static void genInterpSingleStep(CompilationUnit *cUnit, MIR *mir); |
| 53 | |
| Ben Cheng | fc075c2 | 2010-05-28 15:20:08 -0700 | [diff] [blame] | 54 | #endif |
| 55 | |
| 56 | |
| jeffhao | 9e45c0b | 2010-02-03 10:24:05 -0800 | [diff] [blame] | 57 | #if defined(WITH_SELF_VERIFICATION) |
| 58 | /* Self Verification memory instruction decoder */ |
| 59 | void dvmSelfVerificationMemOpDecode(int lr, int* sp); |
| 60 | #endif |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 61 | |
| buzbee | f678927 | 2010-09-24 15:37:12 -0700 | [diff] [blame] | 62 | extern void dvmCompilerSetupResourceMasks(ArmLIR *lir); |
| Ben Cheng | 5d90c20 | 2009-11-22 23:31:11 -0800 | [diff] [blame] | 63 | |
| 64 | extern ArmLIR* dvmCompilerRegCopyNoInsert(CompilationUnit *cUnit, int rDest, |
| 65 | int rSrc); |