@@ -322,6 +322,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
322
322
}
323
323
324
324
bool isSImm6 () const {
325
+ if (!isImm ())
326
+ return false ;
325
327
RISCVMCExpr::VariantKind VK;
326
328
int64_t Imm;
327
329
bool IsValid;
@@ -335,6 +337,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
335
337
}
336
338
337
339
bool isSImm6NonZero () const {
340
+ if (!isImm ())
341
+ return false ;
338
342
RISCVMCExpr::VariantKind VK;
339
343
int64_t Imm;
340
344
bool IsValid;
@@ -348,6 +352,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
348
352
}
349
353
350
354
bool isCLUIImm () const {
355
+ if (!isImm ())
356
+ return false ;
351
357
int64_t Imm;
352
358
RISCVMCExpr::VariantKind VK;
353
359
bool IsConstantImm = evaluateConstantImm (Imm, VK);
@@ -357,6 +363,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
357
363
}
358
364
359
365
bool isUImm7Lsb00 () const {
366
+ if (!isImm ())
367
+ return false ;
360
368
int64_t Imm;
361
369
RISCVMCExpr::VariantKind VK;
362
370
bool IsConstantImm = evaluateConstantImm (Imm, VK);
@@ -365,6 +373,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
365
373
}
366
374
367
375
bool isUImm8Lsb00 () const {
376
+ if (!isImm ())
377
+ return false ;
368
378
int64_t Imm;
369
379
RISCVMCExpr::VariantKind VK;
370
380
bool IsConstantImm = evaluateConstantImm (Imm, VK);
@@ -373,6 +383,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
373
383
}
374
384
375
385
bool isUImm8Lsb000 () const {
386
+ if (!isImm ())
387
+ return false ;
376
388
int64_t Imm;
377
389
RISCVMCExpr::VariantKind VK;
378
390
bool IsConstantImm = evaluateConstantImm (Imm, VK);
@@ -383,6 +395,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
383
395
bool isSImm9Lsb0 () const { return isBareSimmNLsb0<9 >(); }
384
396
385
397
bool isUImm9Lsb000 () const {
398
+ if (!isImm ())
399
+ return false ;
386
400
int64_t Imm;
387
401
RISCVMCExpr::VariantKind VK;
388
402
bool IsConstantImm = evaluateConstantImm (Imm, VK);
@@ -391,6 +405,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
391
405
}
392
406
393
407
bool isUImm10Lsb00NonZero () const {
408
+ if (!isImm ())
409
+ return false ;
394
410
int64_t Imm;
395
411
RISCVMCExpr::VariantKind VK;
396
412
bool IsConstantImm = evaluateConstantImm (Imm, VK);
@@ -428,6 +444,8 @@ struct RISCVOperand : public MCParsedAsmOperand {
428
444
bool isSImm13Lsb0 () const { return isBareSimmNLsb0<13 >(); }
429
445
430
446
bool isSImm10Lsb0000NonZero () const {
447
+ if (!isImm ())
448
+ return false ;
431
449
int64_t Imm;
432
450
RISCVMCExpr::VariantKind VK;
433
451
bool IsConstantImm = evaluateConstantImm (Imm, VK);
0 commit comments