diff options
author | Chris Lattner <sabre@nondot.org> | 2006-02-04 02:13:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-02-04 02:13:02 +0000 |
commit | ee1dadbccf9923c46c8f344b4338661f11a5e053 (patch) | |
tree | 0873319f636f56d3158cfc7fb4a8fe6c1b12661f /llvm/lib/Target/TargetLowering.cpp | |
parent | 3fb81ddda367328b592cdbc413e6f7b5f5457a8b (diff) | |
download | bcm5719-llvm-ee1dadbccf9923c46c8f344b4338661f11a5e053.tar.gz bcm5719-llvm-ee1dadbccf9923c46c8f344b4338661f11a5e053.zip |
implementation of some methods for inlineasm
llvm-svn: 25951
Diffstat (limited to 'llvm/lib/Target/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLowering.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetLowering.cpp b/llvm/lib/Target/TargetLowering.cpp index 5a191d99981..068f6a8f5d2 100644 --- a/llvm/lib/Target/TargetLowering.cpp +++ b/llvm/lib/Target/TargetLowering.cpp @@ -131,6 +131,10 @@ const char *TargetLowering::getTargetNodeName(unsigned Opcode) const { return NULL; } +//===----------------------------------------------------------------------===// +// Optimization Methods +//===----------------------------------------------------------------------===// + /// DemandedBitsAreZero - Return true if 'Op & Mask' demands no bits from a bit /// set operation such as a sign extend or or/xor with constant whose only /// use is Op. If it returns true, the old node that sets bits which are @@ -139,7 +143,7 @@ const char *TargetLowering::getTargetNodeName(unsigned Opcode) const { /// desired. bool TargetLowering::DemandedBitsAreZero(const SDOperand &Op, uint64_t Mask, SDOperand &Old, SDOperand &New, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { // If the operation has more than one use, we're not interested in it. // Tracking down and checking all uses would be problematic and slow. if (!Op.Val->hasOneUse()) @@ -302,6 +306,42 @@ bool TargetLowering::isMaskedValueZeroForTargetNode(const SDOperand &Op, return false; } +//===----------------------------------------------------------------------===// +// Inline Assembler Implementation Methods +//===----------------------------------------------------------------------===// + +TargetLowering::ConstraintType +TargetLowering::getConstraintType(char ConstraintLetter) const { + // FIXME: lots more standard ones to handle. + switch (ConstraintLetter) { + default: return C_Unknown; + case 'r': return C_RegisterClass; + case 'i': // Simple Integer or Relocatable Constant + case 'n': // Simple Integer + case 's': // Relocatable Constant + case 'I': // Target registers. + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': return C_Other; + } +} + +bool TargetLowering::isOperandValidForConstraint(SDOperand Op, + char ConstraintLetter) { + switch (ConstraintLetter) { + default: return false; + case 'i': // Simple Integer or Relocatable Constant + case 'n': // Simple Integer + case 's': // Relocatable Constant + return true; // FIXME: not right. + } +} + + std::vector<unsigned> TargetLowering:: getRegForInlineAsmConstraint(const std::string &Constraint) const { // Not a physreg, must not be a register reference or something. |