@@ -257,146 +257,6 @@ def simm12 : RISCVSImmLeafOp<12> {
257257 }];
258258}
259259
260- // A 7-bit unsigned immediate where the least significant two bits are zero.
261- def uimm7_lsb00 : RISCVOp,
262- ImmLeaf<XLenVT, [{return isShiftedUInt<5, 2>(Imm);}]> {
263- let ParserMatchClass = UImmAsmOperand<7, "Lsb00">;
264- let EncoderMethod = "getImmOpValue";
265- let DecoderMethod = "decodeUImmOperand<7>";
266- let OperandType = "OPERAND_UIMM7_LSB00";
267- let MCOperandPredicate = [{
268- int64_t Imm;
269- if (!MCOp.evaluateAsConstantImm(Imm))
270- return false;
271- return isShiftedUInt<5, 2>(Imm);
272- }];
273- }
274-
275- // A 7-bit unsigned immediate where the least significant three bits are zero.
276- def uimm7_lsb000 : RISCVOp,
277- ImmLeaf<XLenVT, [{return isShiftedUInt<4, 3>(Imm);}]> {
278- let ParserMatchClass = UImmAsmOperand<7, "Lsb000">;
279- let EncoderMethod = "getImmOpValue";
280- let DecoderMethod = "decodeUImmOperand<7>";
281- let OperandType = "OPERAND_UIMM7_LSB000";
282- let MCOperandPredicate = [{
283- int64_t Imm;
284- if (!MCOp.evaluateAsConstantImm(Imm))
285- return false;
286- return isShiftedUInt<4, 3>(Imm);
287- }];
288- }
289-
290- // A 8-bit unsigned immediate where the least significant two bits are zero.
291- def uimm8_lsb00 : RISCVOp,
292- ImmLeaf<XLenVT, [{return isShiftedUInt<6, 2>(Imm);}]> {
293- let ParserMatchClass = UImmAsmOperand<8, "Lsb00">;
294- let EncoderMethod = "getImmOpValue";
295- let DecoderMethod = "decodeUImmOperand<8>";
296- let OperandType = "OPERAND_UIMM8_LSB00";
297- let MCOperandPredicate = [{
298- int64_t Imm;
299- if (!MCOp.evaluateAsConstantImm(Imm))
300- return false;
301- return isShiftedUInt<6, 2>(Imm);
302- }];
303- }
304-
305- // A 8-bit unsigned immediate where the least significant three bits are zero.
306- def uimm8_lsb000 : RISCVOp,
307- ImmLeaf<XLenVT, [{return isShiftedUInt<5, 3>(Imm);}]> {
308- let ParserMatchClass = UImmAsmOperand<8, "Lsb000">;
309- let EncoderMethod = "getImmOpValue";
310- let DecoderMethod = "decodeUImmOperand<8>";
311- let OperandType = "OPERAND_UIMM8_LSB000";
312- let MCOperandPredicate = [{
313- int64_t Imm;
314- if (!MCOp.evaluateAsConstantImm(Imm))
315- return false;
316- return isShiftedUInt<5, 3>(Imm);
317- }];
318- }
319-
320- // A 9-bit signed immediate where the least significant bit is zero.
321- def simm9_lsb0 : Operand<OtherVT>,
322- ImmLeaf<XLenVT, [{return isShiftedInt<8, 1>(Imm);}]> {
323- let ParserMatchClass = SImmAsmOperand<9, "Lsb0">;
324- let PrintMethod = "printBranchOperand";
325- let EncoderMethod = "getImmOpValueAsr1";
326- let DecoderMethod = "decodeSImmOperandAndLsl1<9>";
327- let MCOperandPredicate = [{
328- int64_t Imm;
329- if (MCOp.evaluateAsConstantImm(Imm))
330- return isShiftedInt<8, 1>(Imm);
331- return MCOp.isBareSymbolRef();
332- }];
333- let OperandType = "OPERAND_PCREL";
334- }
335-
336- // A 9-bit unsigned immediate where the least significant three bits are zero.
337- def uimm9_lsb000 : RISCVOp,
338- ImmLeaf<XLenVT, [{return isShiftedUInt<6, 3>(Imm);}]> {
339- let ParserMatchClass = UImmAsmOperand<9, "Lsb000">;
340- let EncoderMethod = "getImmOpValue";
341- let DecoderMethod = "decodeUImmOperand<9>";
342- let OperandType = "OPERAND_UIMM9_LSB000";
343- let MCOperandPredicate = [{
344- int64_t Imm;
345- if (!MCOp.evaluateAsConstantImm(Imm))
346- return false;
347- return isShiftedUInt<6, 3>(Imm);
348- }];
349- }
350-
351- // A 10-bit unsigned immediate where the least significant two bits are zero
352- // and the immediate can't be zero.
353- def uimm10_lsb00nonzero : RISCVOp,
354- ImmLeaf<XLenVT,
355- [{return isShiftedUInt<8, 2>(Imm) && (Imm != 0);}]> {
356- let ParserMatchClass = UImmAsmOperand<10, "Lsb00NonZero">;
357- let EncoderMethod = "getImmOpValue";
358- let DecoderMethod = "decodeUImmNonZeroOperand<10>";
359- let OperandType = "OPERAND_UIMM10_LSB00_NONZERO";
360- let MCOperandPredicate = [{
361- int64_t Imm;
362- if (!MCOp.evaluateAsConstantImm(Imm))
363- return false;
364- return isShiftedUInt<8, 2>(Imm) && (Imm != 0);
365- }];
366- }
367-
368- // A 10-bit signed immediate where the least significant four bits are zero.
369- def simm10_lsb0000nonzero : RISCVOp,
370- ImmLeaf<XLenVT,
371- [{return (Imm != 0) && isShiftedInt<6, 4>(Imm);}]> {
372- let ParserMatchClass = SImmAsmOperand<10, "Lsb0000NonZero">;
373- let EncoderMethod = "getImmOpValue";
374- let DecoderMethod = "decodeSImmNonZeroOperand<10>";
375- let OperandType = "OPERAND_SIMM10_LSB0000_NONZERO";
376- let MCOperandPredicate = [{
377- int64_t Imm;
378- if (!MCOp.evaluateAsConstantImm(Imm))
379- return false;
380- return isShiftedInt<6, 4>(Imm) && (Imm != 0);
381- }];
382- }
383-
384- // A 12-bit signed immediate where the least significant bit is zero.
385- def simm12_lsb0 : Operand<XLenVT>,
386- ImmLeaf<XLenVT, [{return isShiftedInt<11, 1>(Imm);}]> {
387- let ParserMatchClass = SImmAsmOperand<12, "Lsb0">;
388- let PrintMethod = "printBranchOperand";
389- let EncoderMethod = "getImmOpValueAsr1";
390- let DecoderMethod = "decodeSImmOperandAndLsl1<12>";
391- let MCOperandPredicate = [{
392- int64_t Imm;
393- if (MCOp.evaluateAsConstantImm(Imm))
394- return isShiftedInt<11, 1>(Imm);
395- return MCOp.isBareSymbolRef();
396- }];
397- let OperandType = "OPERAND_PCREL";
398- }
399-
400260// A 12-bit signed immediate which cannot fit in 6-bit signed immediate,
401261// but even negative value fit in 12-bit.
402262def simm12_no6 : ImmLeaf<XLenVT, [{
0 commit comments