blob: afeb340d4c66fd8a0db1b9ee9b29e7f3829c5243 [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
Bill Buzbee9bc3df32009-07-30 10:52:29 -070017/*
Ben Cheng5d90c202009-11-22 23:31:11 -080018 * This file contains register alloction support and is intended to be
19 * included by:
20 *
21 * Codegen-$(TARGET_ARCH_VARIANT).c
22 *
Bill Buzbee9bc3df32009-07-30 10:52:29 -070023 */
24
Ben Cheng5d90c202009-11-22 23:31:11 -080025#include "compiler/CompilerIR.h"
Ben Chengbd1326d2010-04-02 15:04:53 -070026#include "CalloutHelper.h"
Bill Buzbee9bc3df32009-07-30 10:52:29 -070027
Carl Shapiro5d5b94c2011-04-19 17:34:24 -070028#ifdef __cplusplus
29extern "C" {
30#endif
31
Ben Chengfc075c22010-05-28 15:20:08 -070032#if defined(_CODEGEN_C)
Ben Cheng5d90c202009-11-22 23:31:11 -080033/*
34 * loadConstant() sometimes needs to add a small imm to a pre-existing constant
35 */
36static ArmLIR *opRegImm(CompilationUnit *cUnit, OpKind op, int rDestSrc1,
37 int value);
38static ArmLIR *opRegReg(CompilationUnit *cUnit, OpKind op, int rDestSrc1,
39 int rSrc2);
Bill Buzbee9bc3df32009-07-30 10:52:29 -070040
Ben Cheng5d90c202009-11-22 23:31:11 -080041/* Forward decalraton the portable versions due to circular dependency */
42static bool genArithOpFloatPortable(CompilationUnit *cUnit, MIR *mir,
43 RegLocation rlDest, RegLocation rlSrc1,
44 RegLocation rlSrc2);
45
46static bool genArithOpDoublePortable(CompilationUnit *cUnit, MIR *mir,
47 RegLocation rlDest, RegLocation rlSrc1,
48 RegLocation rlSrc2);
49
50static bool genConversionPortable(CompilationUnit *cUnit, MIR *mir);
51
Carl Shapiro01605d22011-02-01 11:32:44 -080052#if defined(__ARM_ARCH_5__)
Ben Cheng5d90c202009-11-22 23:31:11 -080053static void genMonitorPortable(CompilationUnit *cUnit, MIR *mir);
Ben Chengfc075c22010-05-28 15:20:08 -070054#endif
Ben Cheng5d90c202009-11-22 23:31:11 -080055
Bill Buzbee434bae62010-03-27 10:58:03 -070056static void genInterpSingleStep(CompilationUnit *cUnit, MIR *mir);
57
Ben Chengfc075c22010-05-28 15:20:08 -070058#endif
59
60
jeffhao9e45c0b2010-02-03 10:24:05 -080061#if defined(WITH_SELF_VERIFICATION)
62/* Self Verification memory instruction decoder */
63void dvmSelfVerificationMemOpDecode(int lr, int* sp);
64#endif
Ben Cheng5d90c202009-11-22 23:31:11 -080065
buzbeef6789272010-09-24 15:37:12 -070066extern void dvmCompilerSetupResourceMasks(ArmLIR *lir);
Ben Cheng5d90c202009-11-22 23:31:11 -080067
68extern ArmLIR* dvmCompilerRegCopyNoInsert(CompilationUnit *cUnit, int rDest,
69 int rSrc);
Carl Shapiro5d5b94c2011-04-19 17:34:24 -070070
71#ifdef __cplusplus
72}
73#endif