blob: 1db190f41e1a3bef5a656f5e515e9d71e2925211 [file] [log] [blame]
Dan Gohman9becddd2010-04-16 23:04:22 +00001//===-- ARMSelectionDAGInfo.h - ARM SelectionDAG Info -----------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the ARM subclass for TargetSelectionDAGInfo.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H
15#define LLVM_LIB_TARGET_ARM_ARMSELECTIONDAGINFO_H
Dan Gohman9becddd2010-04-16 23:04:22 +000016
Evan Chenga20cde32011-07-20 23:34:39 +000017#include "MCTargetDesc/ARMAddressingModes.h"
Dan Gohman9becddd2010-04-16 23:04:22 +000018#include "llvm/Target/TargetSelectionDAGInfo.h"
19
20namespace llvm {
21
Evan Chenga20cde32011-07-20 23:34:39 +000022namespace ARM_AM {
23 static inline ShiftOpc getShiftOpcForNode(unsigned Opcode) {
24 switch (Opcode) {
25 default: return ARM_AM::no_shift;
26 case ISD::SHL: return ARM_AM::lsl;
27 case ISD::SRL: return ARM_AM::lsr;
28 case ISD::SRA: return ARM_AM::asr;
29 case ISD::ROTR: return ARM_AM::ror;
30 //case ISD::ROTL: // Only if imm -> turn into ROTR.
31 // Can't handle RRX here, because it would require folding a flag into
32 // the addressing mode. :( This causes us to miss certain things.
33 //case ARMISD::RRX: return ARM_AM::rrx;
34 }
35 }
36} // end namespace ARM_AM
37
Dan Gohman9becddd2010-04-16 23:04:22 +000038class ARMSelectionDAGInfo : public TargetSelectionDAGInfo {
39public:
Eric Christopher70e005a2014-06-12 23:39:49 +000040 explicit ARMSelectionDAGInfo(const DataLayout &DL);
Dan Gohman9becddd2010-04-16 23:04:22 +000041 ~ARMSelectionDAGInfo();
Dan Gohmanbb919df2010-05-11 17:31:57 +000042
Andrew Trickef9de2a2013-05-25 02:42:55 +000043 SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl,
Dan Gohmanbb919df2010-05-11 17:31:57 +000044 SDValue Chain,
45 SDValue Dst, SDValue Src,
46 SDValue Size, unsigned Align,
47 bool isVolatile, bool AlwaysInline,
Chris Lattner2510de22010-09-21 05:40:29 +000048 MachinePointerInfo DstPtrInfo,
Craig Topper6bc27bf2014-03-10 02:09:33 +000049 MachinePointerInfo SrcPtrInfo) const override;
Renato Golin4cd51872011-05-22 21:41:23 +000050
John Brawn70605f72015-05-12 13:13:38 +000051 SDValue EmitTargetCodeForMemmove(SelectionDAG &DAG, SDLoc dl,
52 SDValue Chain,
53 SDValue Dst, SDValue Src,
54 SDValue Size, unsigned Align, bool isVolatile,
55 MachinePointerInfo DstPtrInfo,
56 MachinePointerInfo SrcPtrInfo) const override;
57
Renato Golin4cd51872011-05-22 21:41:23 +000058 // Adjust parameters for memset, see RTABI section 4.3.4
Andrew Trickef9de2a2013-05-25 02:42:55 +000059 SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, SDLoc dl,
Renato Golin4cd51872011-05-22 21:41:23 +000060 SDValue Chain,
61 SDValue Op1, SDValue Op2,
62 SDValue Op3, unsigned Align,
63 bool isVolatile,
Craig Topper6bc27bf2014-03-10 02:09:33 +000064 MachinePointerInfo DstPtrInfo) const override;
John Brawn70605f72015-05-12 13:13:38 +000065
66 SDValue EmitSpecializedLibcall(SelectionDAG &DAG, SDLoc dl,
67 SDValue Chain,
68 SDValue Dst, SDValue Src,
69 SDValue Size, unsigned Align,
70 RTLIB::Libcall LC) const;
Dan Gohman9becddd2010-04-16 23:04:22 +000071};
72
Alexander Kornienkof00654e2015-06-23 09:49:53 +000073}
Dan Gohman9becddd2010-04-16 23:04:22 +000074
75#endif