diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2011-07-20 23:34:39 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-20 23:34:39 +0000 |
| commit | a20cde31e727118ab5dcdd539856d1b5be926af4 (patch) | |
| tree | 87a61ab7073b5dce5919e1ea0f3ef22cbe146ecc /llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | |
| parent | ed93564c7a4defecbdd057c4b41a01fdd8cbe4ff (diff) | |
| download | bcm5719-llvm-a20cde31e727118ab5dcdd539856d1b5be926af4.tar.gz bcm5719-llvm-a20cde31e727118ab5dcdd539856d1b5be926af4.zip | |
Sink ARMMCExpr and ARMAddressingModes into MC layer. First step to separate ARM MC code from target.
llvm-svn: 135636
Diffstat (limited to 'llvm/lib/Target/ARM/ARMSelectionDAGInfo.h')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h index ec1bf5ca194..6419a737295 100644 --- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h +++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h @@ -14,10 +14,27 @@ #ifndef ARMSELECTIONDAGINFO_H #define ARMSELECTIONDAGINFO_H +#include "MCTargetDesc/ARMAddressingModes.h" #include "llvm/Target/TargetSelectionDAGInfo.h" namespace llvm { +namespace ARM_AM { + static inline ShiftOpc getShiftOpcForNode(unsigned Opcode) { + switch (Opcode) { + default: return ARM_AM::no_shift; + case ISD::SHL: return ARM_AM::lsl; + case ISD::SRL: return ARM_AM::lsr; + case ISD::SRA: return ARM_AM::asr; + case ISD::ROTR: return ARM_AM::ror; + //case ISD::ROTL: // Only if imm -> turn into ROTR. + // Can't handle RRX here, because it would require folding a flag into + // the addressing mode. :( This causes us to miss certain things. + //case ARMISD::RRX: return ARM_AM::rrx; + } + } +} // end namespace ARM_AM + class ARMSelectionDAGInfo : public TargetSelectionDAGInfo { /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can /// make the right decision when generating code for different targets. |

