diff options
| author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-10-05 20:01:38 +0000 |
|---|---|---|
| committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-10-05 20:01:38 +0000 |
| commit | 7ae3ae9ef4cf3a427078bbb9f8ca4b4d0080569c (patch) | |
| tree | a53d719a87d35933afa5296b4e4c9b412a37233a /llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | |
| parent | 42eb1f2ba9b471bb24028de53dee98623600032b (diff) | |
| download | bcm5719-llvm-7ae3ae9ef4cf3a427078bbb9f8ca4b4d0080569c.tar.gz bcm5719-llvm-7ae3ae9ef4cf3a427078bbb9f8ca4b4d0080569c.zip | |
[Hexagon] Give uniform names to functions changing addressing modes, NFC
The new format is changeAddrMode_xx_yy, where xx is the current mode,
and yy is the new one.
Old name: New name:
getBaseWithImmOffset changeAddrMode_abs_io
getAbsoluteForm changeAddrMode_io_abs
getBaseWithRegOffset changeAddrMode_io_rr
xformRegToImmOffset changeAddrMode_rr_io
getBaseWithLongOffset changeAddrMode_rr_ur
getRegShlForm changeAddrMode_ur_rr
llvm-svn: 315013
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp index 4721fd523f3..bcd1a5089c7 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -2704,16 +2704,16 @@ bool HexagonInstrInfo::hasNonExtEquivalent(const MachineInstr &MI) const { case HexagonII::Absolute: // Load/store with absolute addressing mode can be converted into // base+offset mode. - NonExtOpcode = Hexagon::getBaseWithImmOffset(MI.getOpcode()); + NonExtOpcode = Hexagon::changeAddrMode_abs_io(MI.getOpcode()); break; case HexagonII::BaseImmOffset: // Load/store with base+offset addressing mode can be converted into // base+register offset addressing mode. However left shift operand should // be set to 0. - NonExtOpcode = Hexagon::getBaseWithRegOffset(MI.getOpcode()); + NonExtOpcode = Hexagon::changeAddrMode_io_rr(MI.getOpcode()); break; case HexagonII::BaseLongOffset: - NonExtOpcode = Hexagon::getRegShlForm(MI.getOpcode()); + NonExtOpcode = Hexagon::changeAddrMode_ur_rr(MI.getOpcode()); break; default: return false; @@ -2827,10 +2827,6 @@ bool HexagonInstrInfo::predOpcodeHasNot(ArrayRef<MachineOperand> Cond) const { return !isPredicatedTrue(Cond[0].getImm()); } -short HexagonInstrInfo::getAbsoluteForm(const MachineInstr &MI) const { - return Hexagon::getAbsoluteForm(MI.getOpcode()); -} - unsigned HexagonInstrInfo::getAddrMode(const MachineInstr &MI) const { const uint64_t F = MI.getDesc().TSFlags; return (F >> HexagonII::AddrModePos) & HexagonII::AddrModeMask; @@ -2963,20 +2959,6 @@ SmallVector<MachineInstr*, 2> HexagonInstrInfo::getBranchingInstrs( return Jumpers; } -short HexagonInstrInfo::getBaseWithLongOffset(short Opcode) const { - if (Opcode < 0) - return -1; - return Hexagon::getBaseWithLongOffset(Opcode); -} - -short HexagonInstrInfo::getBaseWithLongOffset(const MachineInstr &MI) const { - return Hexagon::getBaseWithLongOffset(MI.getOpcode()); -} - -short HexagonInstrInfo::getBaseWithRegOffset(const MachineInstr &MI) const { - return Hexagon::getBaseWithRegOffset(MI.getOpcode()); -} - // Returns Operand Index for the constant extended instruction. unsigned HexagonInstrInfo::getCExtOpNum(const MachineInstr &MI) const { const uint64_t F = MI.getDesc().TSFlags; @@ -3892,11 +3874,11 @@ short HexagonInstrInfo::getNonExtOpcode(const MachineInstr &MI) const { // Check addressing mode and retrieve non-ext equivalent instruction. switch (getAddrMode(MI)) { case HexagonII::Absolute: - return Hexagon::getBaseWithImmOffset(MI.getOpcode()); + return Hexagon::changeAddrMode_abs_io(MI.getOpcode()); case HexagonII::BaseImmOffset: - return Hexagon::getBaseWithRegOffset(MI.getOpcode()); + return Hexagon::changeAddrMode_io_rr(MI.getOpcode()); case HexagonII::BaseLongOffset: - return Hexagon::getRegShlForm(MI.getOpcode()); + return Hexagon::changeAddrMode_ur_rr(MI.getOpcode()); default: return -1; @@ -4075,6 +4057,27 @@ bool HexagonInstrInfo::validateBranchCond(const ArrayRef<MachineOperand> &Cond) return Cond.empty() || (Cond[0].isImm() && (Cond.size() != 1)); } -short HexagonInstrInfo::xformRegToImmOffset(const MachineInstr &MI) const { - return Hexagon::xformRegToImmOffset(MI.getOpcode()); +// Addressing mode relations. +short HexagonInstrInfo::changeAddrMode_abs_io(short Opc) const { + return Opc >= 0 ? Hexagon::changeAddrMode_abs_io(Opc) : Opc; +} + +short HexagonInstrInfo::changeAddrMode_io_abs(short Opc) const { + return Opc >= 0 ? Hexagon::changeAddrMode_io_abs(Opc) : Opc; +} + +short HexagonInstrInfo::changeAddrMode_io_rr(short Opc) const { + return Opc >= 0 ? Hexagon::changeAddrMode_io_rr(Opc) : Opc; +} + +short HexagonInstrInfo::changeAddrMode_rr_io(short Opc) const { + return Opc >= 0 ? Hexagon::changeAddrMode_rr_io(Opc) : Opc; +} + +short HexagonInstrInfo::changeAddrMode_rr_ur(short Opc) const { + return Opc >= 0 ? Hexagon::changeAddrMode_rr_ur(Opc) : Opc; +} + +short HexagonInstrInfo::changeAddrMode_ur_rr(short Opc) const { + return Opc >= 0 ? Hexagon::changeAddrMode_ur_rr(Opc) : Opc; } |

