AArch64/ARM64: add non-scalar lowering for more FCVT operations.
[oota-llvm.git] / lib / Target / ARM64 / ARM64Subtarget.h
1 //=====---- ARM64Subtarget.h - Define Subtarget for the ARM64 -*- 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 declares the ARM64 specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef ARM64SUBTARGET_H
15 #define ARM64SUBTARGET_H
16
17 #include "llvm/Target/TargetSubtargetInfo.h"
18 #include "ARM64RegisterInfo.h"
19 #include <string>
20
21 #define GET_SUBTARGETINFO_HEADER
22 #include "ARM64GenSubtargetInfo.inc"
23
24 namespace llvm {
25 class GlobalValue;
26 class StringRef;
27
28 class ARM64Subtarget : public ARM64GenSubtargetInfo {
29 protected:
30   enum ARMProcFamilyEnum {Others, CortexA53, CortexA57, Cyclone};
31
32   /// ARMProcFamily - ARM processor family: Cortex-A53, Cortex-A57, and others.
33   ARMProcFamilyEnum ARMProcFamily;
34
35   bool HasFPARMv8;
36   bool HasNEON;
37   bool HasCrypto;
38
39   // HasZeroCycleRegMove - Has zero-cycle register mov instructions.
40   bool HasZeroCycleRegMove;
41
42   // HasZeroCycleZeroing - Has zero-cycle zeroing instructions.
43   bool HasZeroCycleZeroing;
44
45   /// CPUString - String name of used CPU.
46   std::string CPUString;
47
48   /// TargetTriple - What processor and OS we're targeting.
49   Triple TargetTriple;
50
51 public:
52   /// This constructor initializes the data members to match that
53   /// of the specified triple.
54   ARM64Subtarget(const std::string &TT, const std::string &CPU,
55                  const std::string &FS);
56
57   bool enableMachineScheduler() const override { return true; }
58
59   bool hasZeroCycleRegMove() const { return HasZeroCycleRegMove; }
60
61   bool hasZeroCycleZeroing() const { return HasZeroCycleZeroing; }
62
63   bool hasFPARMv8() const { return HasFPARMv8; }
64   bool hasNEON() const { return HasNEON; }
65   bool hasCrypto() const { return HasCrypto; }
66
67   bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
68
69   bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
70
71   bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
72
73   bool isCyclone() const { return CPUString == "cyclone"; }
74
75   /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
76   /// that still makes it profitable to inline the call.
77   unsigned getMaxInlineSizeThreshold() const { return 64; }
78
79   /// ParseSubtargetFeatures - Parses features string setting specified
80   /// subtarget options.  Definition of function is auto generated by tblgen.
81   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
82
83   /// ClassifyGlobalReference - Find the target operand flags that describe
84   /// how a global value should be referenced for the current subtarget.
85   unsigned char ClassifyGlobalReference(const GlobalValue *GV,
86                                         const TargetMachine &TM) const;
87
88   /// This function returns the name of a function which has an interface
89   /// like the non-standard bzero function, if such a function exists on
90   /// the current subtarget and it is considered prefereable over
91   /// memset with zero passed as the second argument. Otherwise it
92   /// returns null.
93   const char *getBZeroEntry() const;
94
95   void overrideSchedPolicy(MachineSchedPolicy &Policy, MachineInstr *begin,
96                            MachineInstr *end, unsigned NumRegionInstrs) const;
97 };
98 } // End llvm namespace
99
100 #endif // ARM64SUBTARGET_H