@@ -95,10 +95,27 @@ def HasFSMULD : Predicate<"!Subtarget->hasNoFSMULD()">;
95
95
// will pick deprecated instructions.
96
96
def UseDeprecatedInsts : Predicate<"Subtarget->useV8DeprecatedInsts()">;
97
97
98
+ //===----------------------------------------------------------------------===//
99
+ // HwModes Pattern Stuff
100
+ //===----------------------------------------------------------------------===//
101
+
102
+ defvar SPARC32 = DefaultMode;
103
+ def SPARC64 : HwMode<[Is64Bit]>;
104
+
98
105
//===----------------------------------------------------------------------===//
99
106
// Instruction Pattern Stuff
100
107
//===----------------------------------------------------------------------===//
101
108
109
+ def sparc_ptr_rc : RegClassByHwMode<
110
+ [SPARC32, SPARC64],
111
+ [IntRegs, I64Regs]>;
112
+
113
+ // Both cases can use the same decoder method, so avoid the dispatch
114
+ // by hwmode by setting an explicit DecoderMethod
115
+ def ptr_op : RegisterOperand<sparc_ptr_rc> {
116
+ let DecoderMethod = "DecodeIntRegsRegisterClass";
117
+ }
118
+
102
119
// FIXME these should have AsmOperandClass.
103
120
def uimm3 : PatLeaf<(imm), [{ return isUInt<3>(N->getZExtValue()); }]>;
104
121
@@ -178,12 +195,12 @@ def simm13Op : Operand<iPTR> {
178
195
179
196
def MEMrr : Operand<iPTR> {
180
197
let PrintMethod = "printMemOperand";
181
- let MIOperandInfo = (ops ptr_rc, ptr_rc );
198
+ let MIOperandInfo = (ops ptr_op, ptr_op );
182
199
let ParserMatchClass = SparcMEMrrAsmOperand;
183
200
}
184
201
def MEMri : Operand<iPTR> {
185
202
let PrintMethod = "printMemOperand";
186
- let MIOperandInfo = (ops ptr_rc , simm13Op);
203
+ let MIOperandInfo = (ops ptr_op , simm13Op);
187
204
let ParserMatchClass = SparcMEMriAsmOperand;
188
205
}
189
206
0 commit comments