@@ -2829,12 +2829,12 @@ bool RISCVAsmParser::parseDirectiveOption() {
2829
2829
2830
2830
if (isDigit (Arch.back ()))
2831
2831
return Error (
2832
- Loc, " Extension version number parsing not currently implemented" );
2832
+ Loc, " extension version number parsing not currently implemented" );
2833
2833
2834
2834
std::string Feature = RISCVISAInfo::getTargetFeatureForExtension (Arch);
2835
2835
if (!enableExperimentalExtension () &&
2836
2836
StringRef (Feature).starts_with (" experimental-" ))
2837
- return Error (Loc, " Unexpected experimental extensions. " );
2837
+ return Error (Loc, " unexpected experimental extensions" );
2838
2838
auto Ext = llvm::lower_bound (RISCVFeatureKV, Feature);
2839
2839
if (Ext == std::end (RISCVFeatureKV) || StringRef (Ext->Key ) != Feature)
2840
2840
return Error (Loc, " unknown extension feature" );
@@ -2866,10 +2866,10 @@ bool RISCVAsmParser::parseDirectiveOption() {
2866
2866
for (auto &Feature : RISCVFeatureKV) {
2867
2867
if (getSTI ().hasFeature (Feature.Value ) &&
2868
2868
Feature.Implies .test (Ext->Value ))
2869
- return Error (Loc,
2870
- Twine ( " Can't disable " ) + Ext-> Key + " extension, " +
2871
- Feature. Key + " extension requires " + Ext->Key +
2872
- " extension be enabled " );
2869
+ return Error (Loc, Twine ( " can't disable " ) + Ext-> Key +
2870
+ " extension; " + Feature. Key +
2871
+ " extension requires " + Ext->Key +
2872
+ " extension " );
2873
2873
}
2874
2874
2875
2875
clearFeatureBits (Ext->Value , Ext->Key );
@@ -3382,8 +3382,8 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3382
3382
unsigned TempReg = Inst.getOperand (1 ).getReg ();
3383
3383
if (DestReg == TempReg) {
3384
3384
SMLoc Loc = Operands.back ()->getStartLoc ();
3385
- return Error (Loc, " The temporary vector register cannot be the same as "
3386
- " the destination register. " );
3385
+ return Error (Loc, " the temporary vector register cannot be the same as "
3386
+ " the destination register" );
3387
3387
}
3388
3388
}
3389
3389
@@ -3395,8 +3395,7 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3395
3395
// The encoding with rd1 == rd2 == rs1 is reserved for XTHead load pair.
3396
3396
if (Rs1 == Rd1 && Rs1 == Rd2) {
3397
3397
SMLoc Loc = Operands[1 ]->getStartLoc ();
3398
- return Error (Loc, " The source register and destination registers "
3399
- " cannot be equal." );
3398
+ return Error (Loc, " rs1, rd1, and rd2 cannot all be the same" );
3400
3399
}
3401
3400
}
3402
3401
@@ -3405,7 +3404,7 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3405
3404
unsigned Rd2 = Inst.getOperand (1 ).getReg ();
3406
3405
if (Rd1 == Rd2) {
3407
3406
SMLoc Loc = Operands[1 ]->getStartLoc ();
3408
- return Error (Loc, " ' rs1' and ' rs2' must be different. " );
3407
+ return Error (Loc, " rs1 and rs2 must be different" );
3409
3408
}
3410
3409
}
3411
3410
@@ -3416,10 +3415,10 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3416
3415
// depending on the data width.
3417
3416
if (IsTHeadMemPair32 && Inst.getOperand (4 ).getImm () != 3 ) {
3418
3417
SMLoc Loc = Operands.back ()->getStartLoc ();
3419
- return Error (Loc, " Operand must be constant 3. " );
3418
+ return Error (Loc, " operand must be constant 3" );
3420
3419
} else if (IsTHeadMemPair64 && Inst.getOperand (4 ).getImm () != 4 ) {
3421
3420
SMLoc Loc = Operands.back ()->getStartLoc ();
3422
- return Error (Loc, " Operand must be constant 4. " );
3421
+ return Error (Loc, " operand must be constant 4" );
3423
3422
}
3424
3423
3425
3424
const MCInstrDesc &MCID = MII.get (Opcode);
@@ -3434,14 +3433,14 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3434
3433
if (MCID.TSFlags & RISCVII::VS1Constraint) {
3435
3434
unsigned VCIXRs1 = Inst.getOperand (Inst.getNumOperands () - 1 ).getReg ();
3436
3435
if (VCIXDst == VCIXRs1)
3437
- return Error (VCIXDstLoc, " The destination vector register group cannot"
3438
- " overlap the source vector register group. " );
3436
+ return Error (VCIXDstLoc, " the destination vector register group cannot"
3437
+ " overlap the source vector register group" );
3439
3438
}
3440
3439
if (MCID.TSFlags & RISCVII::VS2Constraint) {
3441
3440
unsigned VCIXRs2 = Inst.getOperand (Inst.getNumOperands () - 2 ).getReg ();
3442
3441
if (VCIXDst == VCIXRs2)
3443
- return Error (VCIXDstLoc, " The destination vector register group cannot"
3444
- " overlap the source vector register group. " );
3442
+ return Error (VCIXDstLoc, " the destination vector register group cannot"
3443
+ " overlap the source vector register group" );
3445
3444
}
3446
3445
return false ;
3447
3446
}
@@ -3457,14 +3456,14 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3457
3456
if (MCID.TSFlags & RISCVII::VS2Constraint) {
3458
3457
unsigned CheckReg = Inst.getOperand (Offset + 1 ).getReg ();
3459
3458
if (DestReg == CheckReg)
3460
- return Error (Loc, " The destination vector register group cannot overlap"
3461
- " the source vector register group. " );
3459
+ return Error (Loc, " the destination vector register group cannot overlap"
3460
+ " the source vector register group" );
3462
3461
}
3463
3462
if ((MCID.TSFlags & RISCVII::VS1Constraint) && Inst.getOperand (Offset + 2 ).isReg ()) {
3464
3463
unsigned CheckReg = Inst.getOperand (Offset + 2 ).getReg ();
3465
3464
if (DestReg == CheckReg)
3466
- return Error (Loc, " The destination vector register group cannot overlap"
3467
- " the source vector register group. " );
3465
+ return Error (Loc, " the destination vector register group cannot overlap"
3466
+ " the source vector register group" );
3468
3467
}
3469
3468
if ((MCID.TSFlags & RISCVII::VMConstraint) && (DestReg == RISCV::V0)) {
3470
3469
// vadc, vsbc are special cases. These instructions have no mask register.
@@ -3474,7 +3473,7 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3474
3473
Opcode == RISCV::VSBC_VXM || Opcode == RISCV::VFMERGE_VFM ||
3475
3474
Opcode == RISCV::VMERGE_VIM || Opcode == RISCV::VMERGE_VVM ||
3476
3475
Opcode == RISCV::VMERGE_VXM)
3477
- return Error (Loc, " The destination vector register group cannot be V0. " );
3476
+ return Error (Loc, " the destination vector register group cannot be V0" );
3478
3477
3479
3478
// Regardless masked or unmasked version, the number of operands is the
3480
3479
// same. For example, "viota.m v0, v2" is "viota.m v0, v2, NoRegister"
@@ -3485,8 +3484,8 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3485
3484
" Unexpected register for mask operand" );
3486
3485
3487
3486
if (DestReg == CheckReg)
3488
- return Error (Loc, " The destination vector register group cannot overlap"
3489
- " the mask register. " );
3487
+ return Error (Loc, " the destination vector register group cannot overlap"
3488
+ " the mask register" );
3490
3489
}
3491
3490
return false ;
3492
3491
}
0 commit comments