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