1 //=====---- ARMSubtarget.h - Define Subtarget for the ARM -----*- C++ -*--====//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Evan Cheng and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the ARM specific subclass of TargetSubtarget.
12 //===----------------------------------------------------------------------===//
14 #ifndef ARMSUBTARGET_H
15 #define ARMSUBTARGET_H
17 #include "llvm/Target/TargetSubtarget.h"
23 class ARMSubtarget : public TargetSubtarget {
29 /// ARMArchVersion - ARM architecture vecrsion: V4T (base), V5T, V5TE,
31 ARMArchEnum ARMArchVersion;
33 /// HasVFP2 - True if the processor supports Vector Floating Point (VFP) V2
37 /// IsThumb - True if we are in thumb mode, false if in ARM mode.
42 /// UseThumbBacktraces - True if we use thumb style backtraces.
43 bool UseThumbBacktraces;
45 /// IsR9Reserved - True if R9 is a not available as general purpose register.
48 /// stackAlignment - The minimum alignment known to hold of the stack frame on
49 /// entry to the function and which must be maintained by every function.
50 unsigned stackAlignment;
53 /// This constructor initializes the data members to match that
54 /// of the specified module.
56 ARMSubtarget(const Module &M, const std::string &FS);
58 /// ParseSubtargetFeatures - Parses features string setting specified
59 /// subtarget options. Definition of function is auto generated by tblgen.
60 void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
62 bool hasV4TOps() const { return ARMArchVersion >= V4T; }
63 bool hasV5TOps() const { return ARMArchVersion >= V5T; }
64 bool hasV5TEOps() const { return ARMArchVersion >= V5TE; }
65 bool hasV6Ops() const { return ARMArchVersion >= V6; }
67 bool hasVFP2() const { return HasVFP2; }
69 bool isDarwin() const { return IsDarwin; }
70 bool isThumb() const { return IsThumb; }
72 bool useThumbBacktraces() const { return UseThumbBacktraces; }
73 bool isR9Reserved() const { return IsR9Reserved; }
75 /// getStackAlignment - Returns the minimum alignment known to hold of the
76 /// stack frame on entry to the function and which must be maintained by every
77 /// function for this subtarget.
78 unsigned getStackAlignment() const { return stackAlignment; }
80 } // End llvm namespace
82 #endif // ARMSUBTARGET_H