@@ -1352,7 +1352,7 @@ bool SparcAsmParser::matchRegisterName(const AsmToken &Tok, MCRegister &RegNo,
1352
1352
return true ;
1353
1353
}
1354
1354
1355
- if (name.substr ( 0 , 3 ). equals_insensitive (" asr" ) &&
1355
+ if (name.starts_with_insensitive (" asr" ) &&
1356
1356
!name.substr (3 ).getAsInteger (10 , intVal) && intVal > 0 && intVal < 32 ) {
1357
1357
RegNo = ASRRegs[intVal];
1358
1358
RegKind = SparcOperand::rk_Special;
@@ -1421,7 +1421,7 @@ bool SparcAsmParser::matchRegisterName(const AsmToken &Tok, MCRegister &RegNo,
1421
1421
}
1422
1422
1423
1423
// %fcc0 - %fcc3
1424
- if (name.substr ( 0 , 3 ). equals_insensitive (" fcc" ) &&
1424
+ if (name.starts_with_insensitive (" fcc" ) &&
1425
1425
!name.substr (3 ).getAsInteger (10 , intVal) && intVal < 4 ) {
1426
1426
// FIXME: check 64bit and handle %fcc1 - %fcc3
1427
1427
RegNo = Sparc::FCC0 + intVal;
@@ -1430,40 +1430,40 @@ bool SparcAsmParser::matchRegisterName(const AsmToken &Tok, MCRegister &RegNo,
1430
1430
}
1431
1431
1432
1432
// %g0 - %g7
1433
- if (name.substr ( 0 , 1 ). equals_insensitive (" g" ) &&
1433
+ if (name.starts_with_insensitive (" g" ) &&
1434
1434
!name.substr (1 ).getAsInteger (10 , intVal) && intVal < 8 ) {
1435
1435
RegNo = IntRegs[intVal];
1436
1436
RegKind = SparcOperand::rk_IntReg;
1437
1437
return true ;
1438
1438
}
1439
1439
// %o0 - %o7
1440
- if (name.substr ( 0 , 1 ). equals_insensitive (" o" ) &&
1440
+ if (name.starts_with_insensitive (" o" ) &&
1441
1441
!name.substr (1 ).getAsInteger (10 , intVal) && intVal < 8 ) {
1442
1442
RegNo = IntRegs[8 + intVal];
1443
1443
RegKind = SparcOperand::rk_IntReg;
1444
1444
return true ;
1445
1445
}
1446
- if (name.substr ( 0 , 1 ). equals_insensitive (" l" ) &&
1446
+ if (name.starts_with_insensitive (" l" ) &&
1447
1447
!name.substr (1 ).getAsInteger (10 , intVal) && intVal < 8 ) {
1448
1448
RegNo = IntRegs[16 + intVal];
1449
1449
RegKind = SparcOperand::rk_IntReg;
1450
1450
return true ;
1451
1451
}
1452
- if (name.substr ( 0 , 1 ). equals_insensitive (" i" ) &&
1452
+ if (name.starts_with_insensitive (" i" ) &&
1453
1453
!name.substr (1 ).getAsInteger (10 , intVal) && intVal < 8 ) {
1454
1454
RegNo = IntRegs[24 + intVal];
1455
1455
RegKind = SparcOperand::rk_IntReg;
1456
1456
return true ;
1457
1457
}
1458
1458
// %f0 - %f31
1459
- if (name.substr ( 0 , 1 ). equals_insensitive (" f" ) &&
1459
+ if (name.starts_with_insensitive (" f" ) &&
1460
1460
!name.substr (1 , 2 ).getAsInteger (10 , intVal) && intVal < 32 ) {
1461
1461
RegNo = FloatRegs[intVal];
1462
1462
RegKind = SparcOperand::rk_FloatReg;
1463
1463
return true ;
1464
1464
}
1465
1465
// %f32 - %f62
1466
- if (name.substr ( 0 , 1 ). equals_insensitive (" f" ) &&
1466
+ if (name.starts_with_insensitive (" f" ) &&
1467
1467
!name.substr (1 , 2 ).getAsInteger (10 , intVal) && intVal >= 32 &&
1468
1468
intVal <= 62 && (intVal % 2 == 0 )) {
1469
1469
// FIXME: Check V9
@@ -1473,15 +1473,15 @@ bool SparcAsmParser::matchRegisterName(const AsmToken &Tok, MCRegister &RegNo,
1473
1473
}
1474
1474
1475
1475
// %r0 - %r31
1476
- if (name.substr ( 0 , 1 ). equals_insensitive (" r" ) &&
1476
+ if (name.starts_with_insensitive (" r" ) &&
1477
1477
!name.substr (1 , 2 ).getAsInteger (10 , intVal) && intVal < 31 ) {
1478
1478
RegNo = IntRegs[intVal];
1479
1479
RegKind = SparcOperand::rk_IntReg;
1480
1480
return true ;
1481
1481
}
1482
1482
1483
1483
// %c0 - %c31
1484
- if (name.substr ( 0 , 1 ). equals_insensitive (" c" ) &&
1484
+ if (name.starts_with_insensitive (" c" ) &&
1485
1485
!name.substr (1 ).getAsInteger (10 , intVal) && intVal < 32 ) {
1486
1486
RegNo = CoprocRegs[intVal];
1487
1487
RegKind = SparcOperand::rk_CoprocReg;
0 commit comments