mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-03 11:24:18 +00:00
Change BitsInit to inherit from TypedInit.
This is useful in a later patch where binary literals such as 0b000 will become BitsInit values instead of IntInit values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215085 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -520,6 +520,21 @@ bool CodeGenInstAlias::tryAliasOpMatch(DagInit *Result, unsigned AliasOpNo,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Bits<n> (also used for 0bxx literals)
|
||||
if (BitsInit *BI = dyn_cast<BitsInit>(Arg)) {
|
||||
if (hasSubOps || !InstOpRec->isSubClassOf("Operand"))
|
||||
return false;
|
||||
if (!BI->isComplete())
|
||||
return false;
|
||||
// Convert the bits init to an integer and use that for the result.
|
||||
IntInit *II =
|
||||
dyn_cast_or_null<IntInit>(BI->convertInitializerTo(IntRecTy::get()));
|
||||
if (!II)
|
||||
return false;
|
||||
ResOp = ResultOperand(II->getValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
// If both are Operands with the same MVT, allow the conversion. It's
|
||||
// up to the user to make sure the values are appropriate, just like
|
||||
// for isel Pat's.
|
||||
|
Reference in New Issue
Block a user