LLVM API Documentation
00001 //=====---- ARMSubtarget.h - Define Subtarget for the ARM -----*- C++ -*--====// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file declares the ARM specific subclass of TargetSubtarget. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #ifndef ARMSUBTARGET_H 00015 #define ARMSUBTARGET_H 00016 00017 #include "llvm/Target/TargetSubtarget.h" 00018 #include <string> 00019 00020 namespace llvm { 00021 class Module; 00022 00023 class ARMSubtarget : public TargetSubtarget { 00024 protected: 00025 enum ARMArchEnum { 00026 V4T, V5T, V5TE, V6 00027 }; 00028 00029 /// ARMArchVersion - ARM architecture vecrsion: V4T (base), V5T, V5TE, 00030 /// and V6. 00031 ARMArchEnum ARMArchVersion; 00032 00033 /// HasVFP2 - True if the processor supports Vector Floating Point (VFP) V2 00034 /// instructions. 00035 bool HasVFP2; 00036 00037 /// IsThumb - True if we are in thumb mode, false if in ARM mode. 00038 bool IsThumb; 00039 00040 /// UseThumbBacktraces - True if we use thumb style backtraces. 00041 bool UseThumbBacktraces; 00042 00043 /// IsR9Reserved - True if R9 is a not available as general purpose register. 00044 bool IsR9Reserved; 00045 00046 /// stackAlignment - The minimum alignment known to hold of the stack frame on 00047 /// entry to the function and which must be maintained by every function. 00048 unsigned stackAlignment; 00049 00050 public: 00051 enum { 00052 isELF, isDarwin 00053 } TargetType; 00054 00055 enum { 00056 ARM_ABI_APCS, 00057 ARM_ABI_AAPCS // ARM EABI 00058 } TargetABI; 00059 00060 /// This constructor initializes the data members to match that 00061 /// of the specified module. 00062 /// 00063 ARMSubtarget(const Module &M, const std::string &FS, bool thumb); 00064 00065 /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size 00066 /// that still makes it profitable to inline the call. 00067 unsigned getMaxInlineSizeThreshold() const { 00068 // FIXME: For now, we don't lower memcpy's to loads / stores for Thumb. 00069 // Change this once Thumb ldmia / stmia support is added. 00070 return isThumb() ? 0 : 64; 00071 } 00072 /// ParseSubtargetFeatures - Parses features string setting specified 00073 /// subtarget options. Definition of function is auto generated by tblgen. 00074 void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU); 00075 00076 bool hasV4TOps() const { return ARMArchVersion >= V4T; } 00077 bool hasV5TOps() const { return ARMArchVersion >= V5T; } 00078 bool hasV5TEOps() const { return ARMArchVersion >= V5TE; } 00079 bool hasV6Ops() const { return ARMArchVersion >= V6; } 00080 00081 bool hasVFP2() const { return HasVFP2; } 00082 00083 bool isTargetDarwin() const { return TargetType == isDarwin; } 00084 bool isTargetELF() const { return TargetType == isELF; } 00085 00086 bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; } 00087 bool isAAPCS_ABI() const { return TargetABI == ARM_ABI_AAPCS; } 00088 00089 bool isThumb() const { return IsThumb; } 00090 00091 bool useThumbBacktraces() const { return UseThumbBacktraces; } 00092 bool isR9Reserved() const { return IsR9Reserved; } 00093 00094 /// getStackAlignment - Returns the minimum alignment known to hold of the 00095 /// stack frame on entry to the function and which must be maintained by every 00096 /// function for this subtarget. 00097 unsigned getStackAlignment() const { return stackAlignment; } 00098 }; 00099 } // End llvm namespace 00100 00101 #endif // ARMSUBTARGET_H
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.