File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -1554,6 +1554,42 @@ bool X86TargetInfo::validateCpuIs(StringRef FeatureStr) const {
1554
1554
.Default (false );
1555
1555
}
1556
1556
1557
+
1558
+ static unsigned matchAsmCCConstraint (const char *&Name) {
1559
+ auto RV = llvm::StringSwitch<unsigned >(Name)
1560
+ .Case (" @cca" , 4 )
1561
+ .Case (" @ccae" , 5 )
1562
+ .Case (" @ccb" , 4 )
1563
+ .Case (" @ccbe" , 5 )
1564
+ .Case (" @ccc" , 4 )
1565
+ .Case (" @cce" , 4 )
1566
+ .Case (" @ccz" , 4 )
1567
+ .Case (" @ccg" , 4 )
1568
+ .Case (" @ccge" , 4 )
1569
+ .Case (" @ccl" , 4 )
1570
+ .Case (" @ccle" , 5 )
1571
+ .Case (" @ccna" , 5 )
1572
+ .Case (" @ccnae" ,6 )
1573
+ .Case (" @ccnb" , 5 )
1574
+ .Case (" @ccnbe" ,6 )
1575
+ .Case (" @ccnc" , 5 )
1576
+ .Case (" @ccne" , 5 )
1577
+ .Case (" @ccnz" , 5 )
1578
+ .Case (" @ccng" , 5 )
1579
+ .Case (" @ccnge" ,6 )
1580
+ .Case (" @ccnl" , 5 )
1581
+ .Case (" @ccnle" ,6 )
1582
+ .Case (" @ccno" , 5 )
1583
+ .Case (" @ccnp" , 5 )
1584
+ .Case (" @ccns" , 5 )
1585
+ .Case (" @cco" , 4 )
1586
+ .Case (" @ccp" , 4 )
1587
+ .Case (" @ccs" , 4 )
1588
+ .Default (0 );
1589
+ return RV;
1590
+ }
1591
+
1592
+
1557
1593
bool X86TargetInfo::validateAsmConstraint (
1558
1594
const char *&Name, TargetInfo::ConstraintInfo &Info) const {
1559
1595
switch (*Name) {
@@ -1636,6 +1672,14 @@ bool X86TargetInfo::validateAsmConstraint(
1636
1672
case ' C' : // SSE floating point constant.
1637
1673
case ' G' : // x87 floating point constant.
1638
1674
return true ;
1675
+ case ' @' :
1676
+ // CC condition changes.
1677
+ if (auto Len = matchAsmCCConstraint (Name)) {
1678
+ Name+=Len-1 ;
1679
+ Info.setAllowsRegister ();
1680
+ return true ;
1681
+ }
1682
+ return false ;
1639
1683
}
1640
1684
}
1641
1685
@@ -1705,8 +1749,16 @@ bool X86TargetInfo::validateOperandSize(StringRef Constraint,
1705
1749
return true ;
1706
1750
}
1707
1751
1752
+ // niravd
1708
1753
std::string X86TargetInfo::convertConstraint (const char *&Constraint) const {
1709
1754
switch (*Constraint) {
1755
+ case ' @' :
1756
+ if (auto Len = matchAsmCCConstraint (Constraint)) {
1757
+ std::string Converted = " {" + std::string (Constraint, Len) + " }" ;
1758
+ Constraint+=Len-1 ;
1759
+ return Converted;
1760
+ }
1761
+ break ;
1710
1762
case ' a' :
1711
1763
return std::string (" {ax}" );
1712
1764
case ' b' :
You can’t perform that action at this time.
0 commit comments