0
|
1 /*
|
|
2 * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 *
|
|
5 * This code is free software; you can redistribute it and/or modify it
|
|
6 * under the terms of the GNU General Public License version 2 only, as
|
|
7 * published by the Free Software Foundation.
|
|
8 *
|
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 * version 2 for more details (a copy is included in the LICENSE file that
|
|
13 * accompanied this code).
|
|
14 *
|
|
15 * You should have received a copy of the GNU General Public License version
|
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 *
|
|
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
20 * CA 95054 USA or visit www.sun.com if you need additional information or
|
|
21 * have any questions.
|
|
22 *
|
|
23 */
|
|
24
|
|
25 package sun.jvm.hotspot.asm.sparc;
|
|
26
|
|
27 import sun.jvm.hotspot.asm.*;
|
|
28
|
|
29 public class SPARCInstructionFactoryImpl implements SPARCInstructionFactory {
|
|
30 public SPARCInstruction newCallInstruction(PCRelativeAddress addr) {
|
|
31 return new SPARCCallInstruction(addr);
|
|
32 }
|
|
33
|
|
34 public SPARCInstruction newNoopInstruction() {
|
|
35 return new SPARCNoopInstruction();
|
|
36 }
|
|
37
|
|
38 public SPARCInstruction newSethiInstruction(int imm22, SPARCRegister rd) {
|
|
39 return new SPARCSethiInstruction(imm22, rd);
|
|
40 }
|
|
41
|
|
42 public SPARCInstruction newUnimpInstruction(int const22) {
|
|
43 return new SPARCUnimpInstruction(const22);
|
|
44 }
|
|
45
|
|
46 public SPARCInstruction newBranchInstruction(String name, PCRelativeAddress addr, boolean isAnnuled, int conditionCode) {
|
|
47 return new SPARCBranchInstruction(name, addr, isAnnuled, conditionCode);
|
|
48 }
|
|
49
|
|
50 public SPARCInstruction newSpecialLoadInstruction(String name, int specialReg, int cregNum,
|
|
51 SPARCRegisterIndirectAddress addr) {
|
|
52 return new SPARCSpecialLoadInstruction(name, specialReg, cregNum, addr);
|
|
53 }
|
|
54
|
|
55
|
|
56 public SPARCInstruction newSpecialStoreInstruction(String name, int specialReg, int cregNum,
|
|
57 SPARCRegisterIndirectAddress addr) {
|
|
58 return new SPARCSpecialStoreInstruction(name, specialReg, cregNum, addr);
|
|
59 }
|
|
60
|
|
61 public SPARCInstruction newLoadInstruction(String name, int opcode,
|
|
62 SPARCRegisterIndirectAddress addr, SPARCRegister rd,
|
|
63 int dataType) {
|
|
64 return new SPARCLoadInstruction(name, opcode, addr, rd, dataType);
|
|
65 }
|
|
66
|
|
67 public SPARCInstruction newStoreInstruction(String name, int opcode,
|
|
68 SPARCRegisterIndirectAddress addr, SPARCRegister rd,
|
|
69 int dataType) {
|
|
70 return new SPARCStoreInstruction(name, opcode, addr, rd, dataType);
|
|
71 }
|
|
72
|
|
73 public SPARCInstruction newStbarInstruction() {
|
|
74 return new SPARCStbarInstruction();
|
|
75 }
|
|
76
|
|
77 public SPARCInstruction newReadInstruction(int specialReg, int asrRegNum, SPARCRegister rd) {
|
|
78 return new SPARCReadInstruction(specialReg, asrRegNum, rd);
|
|
79 }
|
|
80
|
|
81 public SPARCInstruction newWriteInstruction(int specialReg, int asrRegNum, SPARCRegister rs1,
|
|
82 ImmediateOrRegister operand2) {
|
|
83 return new SPARCWriteInstruction(specialReg, asrRegNum, rs1,operand2);
|
|
84 }
|
|
85
|
|
86 public SPARCInstruction newIllegalInstruction(int instruction) {
|
|
87 return new SPARCIllegalInstruction(instruction);
|
|
88 }
|
|
89
|
|
90
|
|
91 public SPARCInstruction newIndirectCallInstruction(SPARCRegisterIndirectAddress addr,
|
|
92 SPARCRegister rd) {
|
|
93 return new SPARCIndirectCallInstruction(addr, rd);
|
|
94 }
|
|
95
|
|
96 public SPARCInstruction newReturnInstruction(SPARCRegisterIndirectAddress addr,
|
|
97 SPARCRegister rd, boolean isLeaf) {
|
|
98 return new SPARCReturnInstruction(addr, rd, isLeaf);
|
|
99 }
|
|
100
|
|
101 public SPARCInstruction newJmplInstruction(SPARCRegisterIndirectAddress addr,
|
|
102 SPARCRegister rd) {
|
|
103 return new SPARCJmplInstruction(addr, rd);
|
|
104 }
|
|
105
|
|
106 public SPARCInstruction newFPArithmeticInstruction(String name, int opf, int rtlOperation,
|
|
107 SPARCFloatRegister rs1, SPARCFloatRegister rs2,
|
|
108 SPARCFloatRegister rd) {
|
|
109 return new SPARCFPArithmeticInstruction(name, opf, rtlOperation, rs1, rs2, rd);
|
|
110 }
|
|
111
|
|
112 public SPARCInstruction newFPMoveInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
|
|
113 return new SPARCFPMoveInstruction(name, opf, rs, rd);
|
|
114 }
|
|
115
|
|
116 public SPARCInstruction newFP2RegisterInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
|
|
117 return new SPARCFP2RegisterInstruction(name, opf, rs, rd);
|
|
118 }
|
|
119
|
|
120 public SPARCInstruction newFlushInstruction(SPARCRegisterIndirectAddress addr) {
|
|
121 return new SPARCFlushInstruction(addr);
|
|
122 }
|
|
123
|
|
124 public SPARCInstruction newSaveInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
|
|
125 return new SPARCSaveInstruction(rs1, operand2, rd);
|
|
126 }
|
|
127
|
|
128 public SPARCInstruction newRestoreInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
|
|
129 return new SPARCRestoreInstruction(rs1, operand2, rd);
|
|
130 }
|
|
131
|
|
132 public SPARCInstruction newTrapInstruction(String name, int conditionCode) {
|
|
133 return new SPARCTrapInstruction(name, conditionCode);
|
|
134 }
|
|
135
|
|
136 public SPARCInstruction newRettInstruction(SPARCRegisterIndirectAddress addr) {
|
|
137 return new SPARCRettInstruction(addr);
|
|
138 }
|
|
139
|
|
140 public SPARCInstruction newArithmeticInstruction(String name, int opcode, int rtlOperation,
|
|
141 SPARCRegister rs1, ImmediateOrRegister operand2,
|
|
142 SPARCRegister rd) {
|
|
143 return new SPARCArithmeticInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
|
|
144 }
|
|
145
|
|
146 public SPARCInstruction newLogicInstruction(String name, int opcode, int rtlOperation,
|
|
147 SPARCRegister rs1, ImmediateOrRegister operand2,
|
|
148 SPARCRegister rd) {
|
|
149 return new SPARCLogicInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
|
|
150 }
|
|
151
|
|
152 public SPARCInstruction newMoveInstruction(String name, int opcode,
|
|
153 ImmediateOrRegister operand2,
|
|
154 SPARCRegister rd) {
|
|
155 return new SPARCMoveInstruction(name, opcode, operand2, rd);
|
|
156 }
|
|
157
|
|
158 public SPARCInstruction newShiftInstruction(String name, int opcode, int rtlOperation,
|
|
159 SPARCRegister rs1, ImmediateOrRegister operand2,
|
|
160 SPARCRegister rd) {
|
|
161 return new SPARCShiftInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
|
|
162 }
|
|
163
|
|
164 public SPARCInstruction newCoprocessorInstruction(int instruction, int cpopcode, int opcode,
|
|
165 int rs1Num, int rs2Num, int rd) {
|
|
166 return new SPARCIllegalInstruction(instruction);
|
|
167 }
|
|
168
|
|
169 public SPARCInstruction newSwapInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
|
|
170 return new SPARCSwapInstruction(name, addr, rd);
|
|
171 }
|
|
172
|
|
173 public SPARCInstruction newLdstubInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
|
|
174 return new SPARCLdstubInstruction(name, addr, rd);
|
|
175 }
|
|
176 }
|