blob: 9134cce6f1708b882b5c67ca1e791ecb74cfe9e9 [file] [log] [blame]
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -07001/* libs/pixelflinger/codeflinger/ARMAssemblerProxy.h
2**
3** Copyright 2006, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9** http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18
19#ifndef ANDROID_ARMASSEMBLER_PROXY_H
20#define ANDROID_ARMASSEMBLER_PROXY_H
21
22#include <stdint.h>
23#include <sys/types.h>
24
25#include "codeflinger/ARMAssemblerInterface.h"
26
27namespace android {
28
29// ----------------------------------------------------------------------------
30
31class ARMAssemblerProxy : public ARMAssemblerInterface
32{
33public:
34 // ARMAssemblerProxy take ownership of the target
35
36 ARMAssemblerProxy();
37 ARMAssemblerProxy(ARMAssemblerInterface* target);
38 virtual ~ARMAssemblerProxy();
39
40 void setTarget(ARMAssemblerInterface* target);
41
42 virtual void reset();
43 virtual int generate(const char* name);
44 virtual void disassemble(const char* name);
45
46 virtual void prolog();
47 virtual void epilog(uint32_t touched);
48 virtual void comment(const char* string);
49
50 virtual void dataProcessing(int opcode, int cc, int s,
51 int Rd, int Rn,
52 uint32_t Op2);
53 virtual void MLA(int cc, int s,
54 int Rd, int Rm, int Rs, int Rn);
55 virtual void MUL(int cc, int s,
56 int Rd, int Rm, int Rs);
57 virtual void UMULL(int cc, int s,
58 int RdLo, int RdHi, int Rm, int Rs);
59 virtual void UMUAL(int cc, int s,
60 int RdLo, int RdHi, int Rm, int Rs);
61 virtual void SMULL(int cc, int s,
62 int RdLo, int RdHi, int Rm, int Rs);
63 virtual void SMUAL(int cc, int s,
64 int RdLo, int RdHi, int Rm, int Rs);
65
66 virtual void B(int cc, uint32_t* pc);
67 virtual void BL(int cc, uint32_t* pc);
68 virtual void BX(int cc, int Rn);
69 virtual void label(const char* theLabel);
70 virtual void B(int cc, const char* label);
71 virtual void BL(int cc, const char* label);
72
73 uint32_t* pcForLabel(const char* label);
74
75 virtual void LDR (int cc, int Rd,
76 int Rn, uint32_t offset = immed12_pre(0));
77 virtual void LDRB(int cc, int Rd,
78 int Rn, uint32_t offset = immed12_pre(0));
79 virtual void STR (int cc, int Rd,
80 int Rn, uint32_t offset = immed12_pre(0));
81 virtual void STRB(int cc, int Rd,
82 int Rn, uint32_t offset = immed12_pre(0));
83 virtual void LDRH (int cc, int Rd,
84 int Rn, uint32_t offset = immed8_pre(0));
85 virtual void LDRSB(int cc, int Rd,
86 int Rn, uint32_t offset = immed8_pre(0));
87 virtual void LDRSH(int cc, int Rd,
88 int Rn, uint32_t offset = immed8_pre(0));
89 virtual void STRH (int cc, int Rd,
90 int Rn, uint32_t offset = immed8_pre(0));
91 virtual void LDM(int cc, int dir,
92 int Rn, int W, uint32_t reg_list);
93 virtual void STM(int cc, int dir,
94 int Rn, int W, uint32_t reg_list);
95
96 virtual void SWP(int cc, int Rn, int Rd, int Rm);
97 virtual void SWPB(int cc, int Rn, int Rd, int Rm);
98 virtual void SWI(int cc, uint32_t comment);
99
100 virtual void PLD(int Rn, uint32_t offset);
101 virtual void CLZ(int cc, int Rd, int Rm);
102 virtual void QADD(int cc, int Rd, int Rm, int Rn);
103 virtual void QDADD(int cc, int Rd, int Rm, int Rn);
104 virtual void QSUB(int cc, int Rd, int Rm, int Rn);
105 virtual void QDSUB(int cc, int Rd, int Rm, int Rn);
106 virtual void SMUL(int cc, int xy,
107 int Rd, int Rm, int Rs);
108 virtual void SMULW(int cc, int y,
109 int Rd, int Rm, int Rs);
110 virtual void SMLA(int cc, int xy,
111 int Rd, int Rm, int Rs, int Rn);
112 virtual void SMLAL(int cc, int xy,
113 int RdHi, int RdLo, int Rs, int Rm);
114 virtual void SMLAW(int cc, int y,
115 int Rd, int Rm, int Rs, int Rn);
116
Martyn Capewell96dbb4f2009-12-07 13:59:59 +0000117 virtual void UXTB16(int cc, int Rd, int Rm, int rotate);
118
The Android Open Source Project4f6e8d72008-10-21 07:00:00 -0700119private:
120 ARMAssemblerInterface* mTarget;
121};
122
123}; // namespace android
124
125#endif //ANDROID_ARMASSEMBLER_PROXY_H