2010-04-17 07:04:22 +08:00
|
|
|
//===-- ARMSelectionDAGInfo.h - ARM SelectionDAG Info -----------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2010-04-17 07:04:22 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2016-01-28 00:32:26 +08:00
|
|
|
// This file defines the ARM subclass for SelectionDAGTargetInfo.
|
2010-04-17 07:04:22 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H
|
2010-04-17 07:04:22 +08:00
|
|
|
|
2011-07-21 07:34:39 +08:00
|
|
|
#include "MCTargetDesc/ARMAddressingModes.h"
|
2016-01-28 03:29:56 +08:00
|
|
|
#include "llvm/CodeGen/RuntimeLibcalls.h"
|
2016-01-28 00:32:26 +08:00
|
|
|
#include "llvm/CodeGen/SelectionDAGTargetInfo.h"
|
2010-04-17 07:04:22 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2011-07-21 07:34:39 +08:00
|
|
|
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
|
|
|
|
|
2016-01-28 00:32:26 +08:00
|
|
|
class ARMSelectionDAGInfo : public SelectionDAGTargetInfo {
|
2010-04-17 07:04:22 +08:00
|
|
|
public:
|
2016-06-12 23:39:02 +08:00
|
|
|
SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, const SDLoc &dl,
|
|
|
|
SDValue Chain, SDValue Dst, SDValue Src,
|
|
|
|
SDValue Size, unsigned Align, bool isVolatile,
|
|
|
|
bool AlwaysInline,
|
2010-09-21 13:40:29 +08:00
|
|
|
MachinePointerInfo DstPtrInfo,
|
2014-03-10 10:09:33 +08:00
|
|
|
MachinePointerInfo SrcPtrInfo) const override;
|
2011-05-23 05:41:23 +08:00
|
|
|
|
2016-06-12 23:39:02 +08:00
|
|
|
SDValue
|
|
|
|
EmitTargetCodeForMemmove(SelectionDAG &DAG, const SDLoc &dl, SDValue Chain,
|
|
|
|
SDValue Dst, SDValue Src, SDValue Size,
|
|
|
|
unsigned Align, bool isVolatile,
|
|
|
|
MachinePointerInfo DstPtrInfo,
|
|
|
|
MachinePointerInfo SrcPtrInfo) const override;
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2011-05-23 05:41:23 +08:00
|
|
|
// Adjust parameters for memset, see RTABI section 4.3.4
|
2016-06-12 23:39:02 +08:00
|
|
|
SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &dl,
|
|
|
|
SDValue Chain, SDValue Op1, SDValue Op2,
|
|
|
|
SDValue Op3, unsigned Align, bool isVolatile,
|
2014-03-10 10:09:33 +08:00
|
|
|
MachinePointerInfo DstPtrInfo) const override;
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2016-06-12 23:39:02 +08:00
|
|
|
SDValue EmitSpecializedLibcall(SelectionDAG &DAG, const SDLoc &dl,
|
|
|
|
SDValue Chain, SDValue Dst, SDValue Src,
|
2015-05-12 21:13:38 +08:00
|
|
|
SDValue Size, unsigned Align,
|
|
|
|
RTLIB::Libcall LC) const;
|
2010-04-17 07:04:22 +08:00
|
|
|
};
|
|
|
|
|
2015-06-23 17:49:53 +08:00
|
|
|
}
|
2010-04-17 07:04:22 +08:00
|
|
|
|
|
|
|
#endif
|