mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
[arm] Distinguish the /U[qytnms]/, 'Uv', 'Q', and 'm' inline assembly memory constraints.
Summary: But still handle them the same way since I don't know how they differ on this target. Of these, /U[qytnms]/ do not have backend tests but are accepted by clang. No functional change intended. Reviewers: t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D8203 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238921 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -248,6 +248,13 @@ public:
|
|||||||
Constraint_R,
|
Constraint_R,
|
||||||
Constraint_S,
|
Constraint_S,
|
||||||
Constraint_T,
|
Constraint_T,
|
||||||
|
Constraint_Um,
|
||||||
|
Constraint_Un,
|
||||||
|
Constraint_Uq,
|
||||||
|
Constraint_Us,
|
||||||
|
Constraint_Ut,
|
||||||
|
Constraint_Uv,
|
||||||
|
Constraint_Uy,
|
||||||
Constraint_X,
|
Constraint_X,
|
||||||
Constraint_Z,
|
Constraint_Z,
|
||||||
Constraint_ZC,
|
Constraint_ZC,
|
||||||
|
@ -3920,13 +3920,25 @@ SDNode *ARMDAGToDAGISel::SelectInlineAsm(SDNode *N){
|
|||||||
bool ARMDAGToDAGISel::
|
bool ARMDAGToDAGISel::
|
||||||
SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
|
SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
|
||||||
std::vector<SDValue> &OutOps) {
|
std::vector<SDValue> &OutOps) {
|
||||||
assert(ConstraintID == InlineAsm::Constraint_m &&
|
switch(ConstraintID) {
|
||||||
"unexpected asm memory constraint");
|
default:
|
||||||
// Require the address to be in a register. That is safe for all ARM
|
llvm_unreachable("Unexpected asm memory constraint");
|
||||||
// variants and it is hard to do anything much smarter without knowing
|
case InlineAsm::Constraint_m:
|
||||||
// how the operand is used.
|
case InlineAsm::Constraint_Q:
|
||||||
OutOps.push_back(Op);
|
case InlineAsm::Constraint_Um:
|
||||||
return false;
|
case InlineAsm::Constraint_Un:
|
||||||
|
case InlineAsm::Constraint_Uq:
|
||||||
|
case InlineAsm::Constraint_Us:
|
||||||
|
case InlineAsm::Constraint_Ut:
|
||||||
|
case InlineAsm::Constraint_Uv:
|
||||||
|
case InlineAsm::Constraint_Uy:
|
||||||
|
// Require the address to be in a register. That is safe for all ARM
|
||||||
|
// variants and it is hard to do anything much smarter without knowing
|
||||||
|
// how the operand is used.
|
||||||
|
OutOps.push_back(Op);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// createARMISelDag - This pass converts a legalized DAG into a
|
/// createARMISelDag - This pass converts a legalized DAG into a
|
||||||
|
@ -351,8 +351,31 @@ namespace llvm {
|
|||||||
|
|
||||||
unsigned getInlineAsmMemConstraint(
|
unsigned getInlineAsmMemConstraint(
|
||||||
const std::string &ConstraintCode) const override {
|
const std::string &ConstraintCode) const override {
|
||||||
// FIXME: Map different constraints differently.
|
if (ConstraintCode == "Q")
|
||||||
return InlineAsm::Constraint_m;
|
return InlineAsm::Constraint_Q;
|
||||||
|
else if (ConstraintCode.size() == 2) {
|
||||||
|
if (ConstraintCode[0] == 'U') {
|
||||||
|
switch(ConstraintCode[1]) {
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
case 'm':
|
||||||
|
return InlineAsm::Constraint_Um;
|
||||||
|
case 'n':
|
||||||
|
return InlineAsm::Constraint_Un;
|
||||||
|
case 'q':
|
||||||
|
return InlineAsm::Constraint_Uq;
|
||||||
|
case 's':
|
||||||
|
return InlineAsm::Constraint_Us;
|
||||||
|
case 't':
|
||||||
|
return InlineAsm::Constraint_Ut;
|
||||||
|
case 'v':
|
||||||
|
return InlineAsm::Constraint_Uv;
|
||||||
|
case 'y':
|
||||||
|
return InlineAsm::Constraint_Uy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TargetLowering::getInlineAsmMemConstraint(ConstraintCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ARMSubtarget* getSubtarget() const {
|
const ARMSubtarget* getSubtarget() const {
|
||||||
|
Reference in New Issue
Block a user