2012-02-18 20:03:15 +08:00
|
|
|
//===-- ARMSubtarget.h - Define Subtarget for the ARM ----------*- C++ -*--===//
|
2007-01-19 15:51:42 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-01-19 15:51:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2011-07-02 05:01:15 +08:00
|
|
|
// This file declares the ARM specific subclass of TargetSubtargetInfo.
|
2007-01-19 15:51:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
|
|
|
|
#define LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2014-06-27 03:30:02 +08:00
|
|
|
|
|
|
|
#include "ARMFrameLowering.h"
|
|
|
|
#include "ARMISelLowering.h"
|
|
|
|
#include "ARMInstrInfo.h"
|
2014-06-13 08:20:39 +08:00
|
|
|
#include "ARMSelectionDAGInfo.h"
|
2014-06-27 03:30:02 +08:00
|
|
|
#include "ARMSubtarget.h"
|
|
|
|
#include "Thumb1FrameLowering.h"
|
|
|
|
#include "Thumb1InstrInfo.h"
|
|
|
|
#include "Thumb2InstrInfo.h"
|
2011-07-07 08:08:19 +08:00
|
|
|
#include "MCTargetDesc/ARMMCTargetDesc.h"
|
2011-01-12 05:46:47 +08:00
|
|
|
#include "llvm/ADT/Triple.h"
|
2014-06-13 08:20:35 +08:00
|
|
|
#include "llvm/IR/DataLayout.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "llvm/MC/MCInstrItineraries.h"
|
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2007-01-19 15:51:42 +08:00
|
|
|
#include <string>
|
|
|
|
|
2011-07-02 04:45:01 +08:00
|
|
|
#define GET_SUBTARGETINFO_HEADER
|
2011-07-02 06:36:09 +08:00
|
|
|
#include "ARMGenSubtargetInfo.inc"
|
2011-07-02 04:45:01 +08:00
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
namespace llvm {
|
2009-08-29 07:18:09 +08:00
|
|
|
class GlobalValue;
|
2011-07-07 15:07:08 +08:00
|
|
|
class StringRef;
|
2013-03-22 02:47:47 +08:00
|
|
|
class TargetOptions;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2011-07-02 04:45:01 +08:00
|
|
|
class ARMSubtarget : public ARMGenSubtargetInfo {
|
2007-01-19 15:51:42 +08:00
|
|
|
protected:
|
2010-09-10 09:29:16 +08:00
|
|
|
enum ARMProcFamilyEnum {
|
2014-04-04 07:43:18 +08:00
|
|
|
Others, CortexA5, CortexA7, CortexA8, CortexA9, CortexA12, CortexA15,
|
2014-10-13 18:22:19 +08:00
|
|
|
CortexA17, CortexR5, Swift, CortexA53, CortexA57, Krait,
|
2010-09-10 09:29:16 +08:00
|
|
|
};
|
2013-09-23 22:26:15 +08:00
|
|
|
enum ARMProcClassEnum {
|
|
|
|
None, AClass, RClass, MClass
|
|
|
|
};
|
2010-09-10 09:29:16 +08:00
|
|
|
|
|
|
|
/// ARMProcFamily - ARM processor family: Cortex-A8, Cortex-A9, and others.
|
|
|
|
ARMProcFamilyEnum ARMProcFamily;
|
|
|
|
|
2013-09-23 22:26:15 +08:00
|
|
|
/// ARMProcClass - ARM processor class: None, AClass, RClass or MClass.
|
|
|
|
ARMProcClassEnum ARMProcClass;
|
|
|
|
|
2013-06-27 00:58:26 +08:00
|
|
|
/// HasV4TOps, HasV5TOps, HasV5TEOps,
|
2013-10-07 19:10:47 +08:00
|
|
|
/// HasV6Ops, HasV6MOps, HasV6T2Ops, HasV7Ops, HasV8Ops -
|
2011-07-07 11:55:05 +08:00
|
|
|
/// Specify whether target support specific ARM ISA variants.
|
|
|
|
bool HasV4TOps;
|
|
|
|
bool HasV5TOps;
|
|
|
|
bool HasV5TEOps;
|
|
|
|
bool HasV6Ops;
|
2013-10-07 19:10:47 +08:00
|
|
|
bool HasV6MOps;
|
2011-07-07 11:55:05 +08:00
|
|
|
bool HasV6T2Ops;
|
|
|
|
bool HasV7Ops;
|
2013-06-27 00:58:26 +08:00
|
|
|
bool HasV8Ops;
|
2011-07-07 11:55:05 +08:00
|
|
|
|
2013-09-13 21:46:57 +08:00
|
|
|
/// HasVFPv2, HasVFPv3, HasVFPv4, HasFPARMv8, HasNEON - Specify what
|
2012-01-22 20:07:33 +08:00
|
|
|
/// floating point ISAs are supported.
|
2011-07-07 11:55:05 +08:00
|
|
|
bool HasVFPv2;
|
|
|
|
bool HasVFPv3;
|
2012-01-22 20:07:33 +08:00
|
|
|
bool HasVFPv4;
|
2013-09-13 21:46:57 +08:00
|
|
|
bool HasFPARMv8;
|
2011-07-07 11:55:05 +08:00
|
|
|
bool HasNEON;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2009-08-06 00:01:19 +08:00
|
|
|
/// UseNEONForSinglePrecisionFP - if the NEONFP attribute has been
|
|
|
|
/// specified. Use the method useNEONForSinglePrecisionFP() to
|
|
|
|
/// determine if NEON should actually be used.
|
2009-08-05 01:53:06 +08:00
|
|
|
bool UseNEONForSinglePrecisionFP;
|
|
|
|
|
2012-09-30 05:43:49 +08:00
|
|
|
/// UseMulOps - True if non-microcoded fused integer multiply-add and
|
|
|
|
/// multiply-subtract instructions should be used.
|
|
|
|
bool UseMulOps;
|
|
|
|
|
2010-12-06 06:04:16 +08:00
|
|
|
/// SlowFPVMLx - If the VFP2 / NEON instructions are available, indicates
|
|
|
|
/// whether the FP VML[AS] instructions are slow (if so, don't use them).
|
|
|
|
bool SlowFPVMLx;
|
2010-03-25 06:31:46 +08:00
|
|
|
|
2011-04-01 03:38:48 +08:00
|
|
|
/// HasVMLxForwarding - If true, NEON has special multiplier accumulator
|
|
|
|
/// forwarding to allow mul + mla being issued back to back.
|
|
|
|
bool HasVMLxForwarding;
|
|
|
|
|
2010-07-14 03:21:50 +08:00
|
|
|
/// SlowFPBrcc - True if floating point compare + branch is slow.
|
|
|
|
bool SlowFPBrcc;
|
|
|
|
|
2011-07-08 03:09:06 +08:00
|
|
|
/// InThumbMode - True if compiling for Thumb, false for ARM.
|
2011-07-08 03:05:12 +08:00
|
|
|
bool InThumbMode;
|
2009-06-02 04:00:48 +08:00
|
|
|
|
2011-07-07 08:08:19 +08:00
|
|
|
/// HasThumb2 - True if Thumb2 instructions are supported.
|
|
|
|
bool HasThumb2;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-08-11 15:17:46 +08:00
|
|
|
/// NoARM - True if subtarget does not support ARM mode execution.
|
|
|
|
bool NoARM;
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
/// IsR9Reserved - True if R9 is a not available as general purpose register.
|
|
|
|
bool IsR9Reserved;
|
2007-02-14 03:52:28 +08:00
|
|
|
|
2009-11-24 08:44:37 +08:00
|
|
|
/// UseMovt - True if MOVT / MOVW pairs are used for materialization of 32-bit
|
|
|
|
/// imms (including global addresses).
|
|
|
|
bool UseMovt;
|
|
|
|
|
2011-10-08 01:17:49 +08:00
|
|
|
/// SupportsTailCall - True if the OS supports tail call. The dynamic linker
|
|
|
|
/// must be able to synthesize call stubs for interworking between ARM and
|
|
|
|
/// Thumb.
|
|
|
|
bool SupportsTailCall;
|
|
|
|
|
2010-03-15 02:42:38 +08:00
|
|
|
/// HasFP16 - True if subtarget supports half-precision FP (We support VFP+HF
|
|
|
|
/// only so far)
|
|
|
|
bool HasFP16;
|
|
|
|
|
2010-10-13 00:22:47 +08:00
|
|
|
/// HasD16 - True if subtarget is limited to 16 double precision
|
|
|
|
/// FP registers for VFPv3.
|
|
|
|
bool HasD16;
|
|
|
|
|
2010-05-06 07:44:43 +08:00
|
|
|
/// HasHardwareDivide - True if subtarget supports [su]div
|
|
|
|
bool HasHardwareDivide;
|
|
|
|
|
2012-09-30 05:43:49 +08:00
|
|
|
/// HasHardwareDivideInARM - True if subtarget supports [su]div in ARM mode
|
|
|
|
bool HasHardwareDivideInARM;
|
|
|
|
|
2010-05-06 07:44:43 +08:00
|
|
|
/// HasT2ExtractPack - True if subtarget supports thumb2 extract/pack
|
|
|
|
/// instructions.
|
|
|
|
bool HasT2ExtractPack;
|
|
|
|
|
2010-08-11 14:22:01 +08:00
|
|
|
/// HasDataBarrier - True if the subtarget supports DMB / DSB data barrier
|
|
|
|
/// instructions.
|
|
|
|
bool HasDataBarrier;
|
|
|
|
|
2010-08-10 02:35:19 +08:00
|
|
|
/// Pref32BitThumb - If true, codegen would prefer 32-bit Thumb instructions
|
|
|
|
/// over 16-bit ones.
|
|
|
|
bool Pref32BitThumb;
|
|
|
|
|
2011-04-20 02:11:49 +08:00
|
|
|
/// AvoidCPSRPartialUpdate - If true, codegen would avoid using instructions
|
|
|
|
/// that partially update CPSR and add false dependency on the previous
|
|
|
|
/// CPSR setting instruction.
|
|
|
|
bool AvoidCPSRPartialUpdate;
|
|
|
|
|
2012-12-21 03:59:30 +08:00
|
|
|
/// AvoidMOVsShifterOperand - If true, codegen should avoid using flag setting
|
|
|
|
/// movs with shifter operand (i.e. asr, lsl, lsr).
|
|
|
|
bool AvoidMOVsShifterOperand;
|
|
|
|
|
2012-02-29 02:51:51 +08:00
|
|
|
/// HasRAS - Some processors perform return stack prediction. CodeGen should
|
|
|
|
/// avoid issue "normal" call instructions to callees which do not return.
|
|
|
|
bool HasRAS;
|
|
|
|
|
2010-11-03 14:34:55 +08:00
|
|
|
/// HasMPExtension - True if the subtarget supports Multiprocessing
|
|
|
|
/// extension (ARMv7 only).
|
|
|
|
bool HasMPExtension;
|
|
|
|
|
2013-11-01 21:27:35 +08:00
|
|
|
/// HasVirtualization - True if the subtarget supports the Virtualization
|
|
|
|
/// extension.
|
|
|
|
bool HasVirtualization;
|
|
|
|
|
2010-08-11 23:44:15 +08:00
|
|
|
/// FPOnlySP - If true, the floating point unit only supports single
|
|
|
|
/// precision.
|
|
|
|
bool FPOnlySP;
|
|
|
|
|
2013-05-24 03:11:14 +08:00
|
|
|
/// If true, the processor supports the Performance Monitor Extensions. These
|
|
|
|
/// include a generic cycle-counter as well as more fine-grained (often
|
|
|
|
/// implementation-specific) events.
|
|
|
|
bool HasPerfMon;
|
|
|
|
|
2013-04-10 20:08:35 +08:00
|
|
|
/// HasTrustZone - if true, processor supports TrustZone security extensions
|
|
|
|
bool HasTrustZone;
|
|
|
|
|
2013-09-19 19:59:01 +08:00
|
|
|
/// HasCrypto - if true, processor supports Cryptography extensions
|
|
|
|
bool HasCrypto;
|
|
|
|
|
2013-10-29 17:47:35 +08:00
|
|
|
/// HasCRC - if true, processor supports CRC instructions
|
|
|
|
bool HasCRC;
|
|
|
|
|
2014-04-01 21:22:02 +08:00
|
|
|
/// If true, the instructions "vmov.i32 d0, #0" and "vmov.i32 q0, #0" are
|
|
|
|
/// particularly effective at zeroing a VFP register.
|
|
|
|
bool HasZeroCycleZeroing;
|
|
|
|
|
2010-09-28 12:09:35 +08:00
|
|
|
/// AllowsUnalignedMem - If true, the subtarget allows unaligned memory
|
|
|
|
/// accesses for some types. For details, see
|
2014-07-28 01:46:40 +08:00
|
|
|
/// ARMTargetLowering::allowsMisalignedMemoryAccesses().
|
2010-09-28 12:09:35 +08:00
|
|
|
bool AllowsUnalignedMem;
|
|
|
|
|
2013-11-14 02:29:49 +08:00
|
|
|
/// RestrictIT - If true, the subtarget disallows generation of deprecated IT
|
|
|
|
/// blocks to conform to ARMv8 rule.
|
|
|
|
bool RestrictIT;
|
|
|
|
|
2011-07-02 05:12:19 +08:00
|
|
|
/// Thumb2DSP - If true, the subtarget supports the v7 DSP (saturating arith
|
|
|
|
/// and such) instructions in Thumb2 code.
|
|
|
|
bool Thumb2DSP;
|
|
|
|
|
2013-01-31 00:30:19 +08:00
|
|
|
/// NaCl TRAP instruction is generated instead of the regular TRAP.
|
|
|
|
bool UseNaClTrap;
|
|
|
|
|
2013-03-22 02:47:47 +08:00
|
|
|
/// Target machine allowed unsafe FP math (such as use of NEON fp)
|
|
|
|
bool UnsafeFPMath;
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
/// stackAlignment - The minimum alignment known to hold of the stack frame on
|
|
|
|
/// entry to the function and which must be maintained by every function.
|
|
|
|
unsigned stackAlignment;
|
|
|
|
|
2009-05-24 03:50:50 +08:00
|
|
|
/// CPUString - String name of used CPU.
|
|
|
|
std::string CPUString;
|
|
|
|
|
2014-03-28 22:35:30 +08:00
|
|
|
/// IsLittle - The target is Little Endian
|
|
|
|
bool IsLittle;
|
|
|
|
|
2011-01-12 05:46:47 +08:00
|
|
|
/// TargetTriple - What processor and OS we're targeting.
|
|
|
|
Triple TargetTriple;
|
|
|
|
|
2012-08-08 10:44:16 +08:00
|
|
|
/// SchedModel - Processor specific instruction costs.
|
2014-09-03 01:43:54 +08:00
|
|
|
MCSchedModel SchedModel;
|
2012-08-08 10:44:16 +08:00
|
|
|
|
2009-06-19 09:51:50 +08:00
|
|
|
/// Selected instruction itineraries (one entry per itinerary class.)
|
|
|
|
InstrItineraryData InstrItins;
|
2009-08-11 23:33:49 +08:00
|
|
|
|
2013-03-22 02:47:47 +08:00
|
|
|
/// Options passed via command line that could influence the target
|
|
|
|
const TargetOptions &Options;
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
public:
|
2007-02-14 03:52:28 +08:00
|
|
|
enum {
|
2014-01-02 21:40:08 +08:00
|
|
|
ARM_ABI_UNKNOWN,
|
2007-02-14 03:52:28 +08:00
|
|
|
ARM_ABI_APCS,
|
|
|
|
ARM_ABI_AAPCS // ARM EABI
|
|
|
|
} TargetABI;
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
/// This constructor initializes the data members to match that
|
2009-08-03 06:11:08 +08:00
|
|
|
/// of the specified triple.
|
2007-01-19 15:51:42 +08:00
|
|
|
///
|
2011-06-30 09:53:36 +08:00
|
|
|
ARMSubtarget(const std::string &TT, const std::string &CPU,
|
2014-10-03 08:17:59 +08:00
|
|
|
const std::string &FS, const TargetMachine &TM, bool IsLittle);
|
2007-01-19 15:51:42 +08:00
|
|
|
|
Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not Legal
on any current target and aren't optimized in DAGCombiner. Instead
of using intermediate nodes, expand the operations, choosing between
simple loads/stores, target-specific code, and library calls,
immediately.
Previously, the code to emit optimized code for these operations
was only used at initial SelectionDAG construction time; now it is
used at all times. This fixes some cases where rep;movs was being
used for small copies where simple loads/stores would be better.
This also cleans up code that checks for alignments less than 4;
let the targets make that decision instead of doing it in
target-independent code. This allows x86 to use rep;movs in
low-alignment cases.
Also, this fixes a bug that resulted in the use of rep;stos for
memsets of 0 with non-constant memory size when the alignment was
at least 4. It's better to use the library in this case, which
can be significantly faster when the size is large.
This also preserves more SourceValue information when memory
intrinsics are lowered into simple loads/stores.
llvm-svn: 49572
2008-04-12 12:36:06 +08:00
|
|
|
/// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
|
|
|
|
/// that still makes it profitable to inline the call.
|
2007-10-31 22:39:58 +08:00
|
|
|
unsigned getMaxInlineSizeThreshold() const {
|
2014-05-16 22:24:22 +08:00
|
|
|
return 64;
|
2007-10-31 22:39:58 +08:00
|
|
|
}
|
2009-05-24 03:51:43 +08:00
|
|
|
/// ParseSubtargetFeatures - Parses features string setting specified
|
2007-01-19 15:51:42 +08:00
|
|
|
/// subtarget options. Definition of function is auto generated by tblgen.
|
2011-07-07 15:07:08 +08:00
|
|
|
void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2014-06-13 08:20:35 +08:00
|
|
|
/// initializeSubtargetDependencies - Initializes using a CPU and feature string
|
|
|
|
/// so that we can use initializer lists for subtarget initialization.
|
|
|
|
ARMSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
|
|
|
|
|
2014-08-05 05:25:23 +08:00
|
|
|
const DataLayout *getDataLayout() const override { return &DL; }
|
|
|
|
const ARMSelectionDAGInfo *getSelectionDAGInfo() const override {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
const ARMBaseInstrInfo *getInstrInfo() const override {
|
|
|
|
return InstrInfo.get();
|
|
|
|
}
|
|
|
|
const ARMTargetLowering *getTargetLowering() const override {
|
|
|
|
return &TLInfo;
|
|
|
|
}
|
|
|
|
const ARMFrameLowering *getFrameLowering() const override {
|
|
|
|
return FrameLowering.get();
|
|
|
|
}
|
|
|
|
const ARMBaseRegisterInfo *getRegisterInfo() const override {
|
2014-06-27 03:30:02 +08:00
|
|
|
return &InstrInfo->getRegisterInfo();
|
|
|
|
}
|
2014-06-13 08:20:35 +08:00
|
|
|
|
2013-02-16 09:36:26 +08:00
|
|
|
private:
|
2014-06-13 08:20:35 +08:00
|
|
|
const DataLayout DL;
|
2014-06-13 08:20:39 +08:00
|
|
|
ARMSelectionDAGInfo TSInfo;
|
2014-06-27 03:30:02 +08:00
|
|
|
// Either Thumb1InstrInfo or Thumb2InstrInfo.
|
|
|
|
std::unique_ptr<ARMBaseInstrInfo> InstrInfo;
|
|
|
|
ARMTargetLowering TLInfo;
|
|
|
|
// Either Thumb1FrameLowering or ARMFrameLowering.
|
|
|
|
std::unique_ptr<ARMFrameLowering> FrameLowering;
|
2014-06-13 08:20:35 +08:00
|
|
|
|
2013-02-16 09:36:26 +08:00
|
|
|
void initializeEnvironment();
|
2014-09-04 04:36:31 +08:00
|
|
|
void initSubtargetFeatures(StringRef CPU, StringRef FS);
|
2013-02-16 09:36:26 +08:00
|
|
|
public:
|
Various bits of framework needed for precise machine-level selection
DAG scheduling during isel. Most new functionality is currently
guarded by -enable-sched-cycles and -enable-sched-hazard.
Added InstrItineraryData::IssueWidth field, currently derived from
ARM itineraries, but could be initialized differently on other targets.
Added ScheduleHazardRecognizer::MaxLookAhead to indicate whether it is
active, and if so how many cycles of state it holds.
Added SchedulingPriorityQueue::HasReadyFilter to allowing gating entry
into the scheduler's available queue.
ScoreboardHazardRecognizer now accesses the ScheduleDAG in order to
get information about it's SUnits, provides RecedeCycle for bottom-up
scheduling, correctly computes scoreboard depth, tracks IssueCount, and
considers potential stall cycles when checking for hazards.
ScheduleDAGRRList now models machine cycles and hazards (under
flags). It tracks MinAvailableCycle, drives the hazard recognizer and
priority queue's ready filter, manages a new PendingQueue, properly
accounts for stall cycles, etc.
llvm-svn: 122541
2010-12-24 13:03:26 +08:00
|
|
|
void computeIssueWidth();
|
|
|
|
|
2011-07-07 11:55:05 +08:00
|
|
|
bool hasV4TOps() const { return HasV4TOps; }
|
|
|
|
bool hasV5TOps() const { return HasV5TOps; }
|
|
|
|
bool hasV5TEOps() const { return HasV5TEOps; }
|
|
|
|
bool hasV6Ops() const { return HasV6Ops; }
|
2013-10-08 00:55:23 +08:00
|
|
|
bool hasV6MOps() const { return HasV6MOps; }
|
2011-07-07 11:55:05 +08:00
|
|
|
bool hasV6T2Ops() const { return HasV6T2Ops; }
|
|
|
|
bool hasV7Ops() const { return HasV7Ops; }
|
2013-06-27 00:58:26 +08:00
|
|
|
bool hasV8Ops() const { return HasV8Ops; }
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2012-11-30 03:48:01 +08:00
|
|
|
bool isCortexA5() const { return ARMProcFamily == CortexA5; }
|
2014-04-01 22:10:07 +08:00
|
|
|
bool isCortexA7() const { return ARMProcFamily == CortexA7; }
|
2010-09-10 09:29:16 +08:00
|
|
|
bool isCortexA8() const { return ARMProcFamily == CortexA8; }
|
|
|
|
bool isCortexA9() const { return ARMProcFamily == CortexA9; }
|
2012-09-13 23:05:10 +08:00
|
|
|
bool isCortexA15() const { return ARMProcFamily == CortexA15; }
|
2012-09-30 05:43:49 +08:00
|
|
|
bool isSwift() const { return ARMProcFamily == Swift; }
|
2011-11-09 09:57:03 +08:00
|
|
|
bool isCortexM3() const { return CPUString == "cortex-m3"; }
|
2013-12-07 06:48:17 +08:00
|
|
|
bool isLikeA9() const { return isCortexA9() || isCortexA15() || isKrait(); }
|
2012-12-21 12:35:05 +08:00
|
|
|
bool isCortexR5() const { return ARMProcFamily == CortexR5; }
|
2013-12-07 06:48:17 +08:00
|
|
|
bool isKrait() const { return ARMProcFamily == Krait; }
|
2010-09-10 09:29:16 +08:00
|
|
|
|
2010-08-11 15:17:46 +08:00
|
|
|
bool hasARMOps() const { return !NoARM; }
|
|
|
|
|
2011-07-07 11:55:05 +08:00
|
|
|
bool hasVFP2() const { return HasVFPv2; }
|
|
|
|
bool hasVFP3() const { return HasVFPv3; }
|
2012-01-22 20:07:33 +08:00
|
|
|
bool hasVFP4() const { return HasVFPv4; }
|
2013-09-13 21:46:57 +08:00
|
|
|
bool hasFPARMv8() const { return HasFPARMv8; }
|
2011-07-07 11:55:05 +08:00
|
|
|
bool hasNEON() const { return HasNEON; }
|
2013-09-19 19:59:01 +08:00
|
|
|
bool hasCrypto() const { return HasCrypto; }
|
2013-10-29 17:47:35 +08:00
|
|
|
bool hasCRC() const { return HasCRC; }
|
2013-11-01 21:27:35 +08:00
|
|
|
bool hasVirtualization() const { return HasVirtualization; }
|
2009-08-11 23:33:49 +08:00
|
|
|
bool useNEONForSinglePrecisionFP() const {
|
2009-08-05 01:53:06 +08:00
|
|
|
return hasNEON() && UseNEONForSinglePrecisionFP; }
|
2011-07-07 11:55:05 +08:00
|
|
|
|
2010-05-06 22:57:47 +08:00
|
|
|
bool hasDivide() const { return HasHardwareDivide; }
|
2012-09-30 05:43:49 +08:00
|
|
|
bool hasDivideInARMMode() const { return HasHardwareDivideInARM; }
|
2010-05-06 22:57:47 +08:00
|
|
|
bool hasT2ExtractPack() const { return HasT2ExtractPack; }
|
2010-08-11 14:22:01 +08:00
|
|
|
bool hasDataBarrier() const { return HasDataBarrier; }
|
2013-10-25 17:30:24 +08:00
|
|
|
bool hasAnyDataBarrier() const {
|
|
|
|
return HasDataBarrier || (hasV6Ops() && !isThumb());
|
|
|
|
}
|
2012-09-30 05:43:49 +08:00
|
|
|
bool useMulOps() const { return UseMulOps; }
|
2010-12-06 06:04:16 +08:00
|
|
|
bool useFPVMLx() const { return !SlowFPVMLx; }
|
2011-04-01 03:38:48 +08:00
|
|
|
bool hasVMLxForwarding() const { return HasVMLxForwarding; }
|
2010-07-14 03:21:50 +08:00
|
|
|
bool isFPBrccSlow() const { return SlowFPBrcc; }
|
2010-08-11 23:44:15 +08:00
|
|
|
bool isFPOnlySP() const { return FPOnlySP; }
|
2013-05-24 03:11:14 +08:00
|
|
|
bool hasPerfMon() const { return HasPerfMon; }
|
2013-04-10 20:08:35 +08:00
|
|
|
bool hasTrustZone() const { return HasTrustZone; }
|
2014-04-01 21:22:02 +08:00
|
|
|
bool hasZeroCycleZeroing() const { return HasZeroCycleZeroing; }
|
2010-08-10 02:35:19 +08:00
|
|
|
bool prefers32BitThumb() const { return Pref32BitThumb; }
|
2011-04-20 02:11:49 +08:00
|
|
|
bool avoidCPSRPartialUpdate() const { return AvoidCPSRPartialUpdate; }
|
2012-12-21 03:59:30 +08:00
|
|
|
bool avoidMOVsShifterOperand() const { return AvoidMOVsShifterOperand; }
|
2012-02-29 02:51:51 +08:00
|
|
|
bool hasRAS() const { return HasRAS; }
|
2010-11-03 14:34:55 +08:00
|
|
|
bool hasMPExtension() const { return HasMPExtension; }
|
2011-07-02 05:12:19 +08:00
|
|
|
bool hasThumb2DSP() const { return Thumb2DSP; }
|
2013-01-31 00:30:19 +08:00
|
|
|
bool useNaClTrap() const { return UseNaClTrap; }
|
2009-08-11 23:33:49 +08:00
|
|
|
|
2010-03-15 02:42:38 +08:00
|
|
|
bool hasFP16() const { return HasFP16; }
|
2010-10-13 00:22:47 +08:00
|
|
|
bool hasD16() const { return HasD16; }
|
2010-03-15 02:42:38 +08:00
|
|
|
|
2011-04-21 06:20:12 +08:00
|
|
|
const Triple &getTargetTriple() const { return TargetTriple; }
|
|
|
|
|
2011-04-20 05:14:45 +08:00
|
|
|
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
|
2014-04-03 04:32:05 +08:00
|
|
|
bool isTargetIOS() const { return TargetTriple.isiOS(); }
|
2013-08-30 04:23:14 +08:00
|
|
|
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
2014-04-03 04:32:05 +08:00
|
|
|
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
|
|
|
|
bool isTargetNetBSD() const { return TargetTriple.getOS() == Triple::NetBSD; }
|
|
|
|
bool isTargetWindows() const { return TargetTriple.isOSWindows(); }
|
2014-01-06 22:28:05 +08:00
|
|
|
|
2014-04-03 04:32:05 +08:00
|
|
|
bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
|
2013-12-11 00:57:43 +08:00
|
|
|
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
|
2014-01-06 22:28:05 +08:00
|
|
|
bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
|
|
|
|
|
2013-07-16 17:32:17 +08:00
|
|
|
// ARM EABI is the bare-metal EABI described in ARM ABI documents and
|
|
|
|
// can be accessed via -target arm-none-eabi. This is NOT GNUEABI.
|
|
|
|
// FIXME: Add a flag for bare-metal for that target and set Triple::EABI
|
|
|
|
// even for GNUEABI, so we can make a distinction here and still conform to
|
|
|
|
// the EABI on GNU (and Android) mode. This requires change in Clang, too.
|
2014-01-06 20:00:44 +08:00
|
|
|
// FIXME: The Darwin exception is temporary, while we move users to
|
|
|
|
// "*-*-*-macho" triples as quickly as possible.
|
2013-07-16 17:32:17 +08:00
|
|
|
bool isTargetAEABI() const {
|
2014-01-06 20:00:44 +08:00
|
|
|
return (TargetTriple.getEnvironment() == Triple::EABI ||
|
|
|
|
TargetTriple.getEnvironment() == Triple::EABIHF) &&
|
2014-04-03 04:32:05 +08:00
|
|
|
!isTargetDarwin() && !isTargetWindows();
|
2013-12-18 17:27:33 +08:00
|
|
|
}
|
|
|
|
|
2014-01-29 19:50:56 +08:00
|
|
|
// ARM Targets that support EHABI exception handling standard
|
|
|
|
// Darwin uses SjLj. Other targets might need more checks.
|
|
|
|
bool isTargetEHABICompatible() const {
|
|
|
|
return (TargetTriple.getEnvironment() == Triple::EABI ||
|
|
|
|
TargetTriple.getEnvironment() == Triple::GNUEABI ||
|
|
|
|
TargetTriple.getEnvironment() == Triple::EABIHF ||
|
2014-01-30 22:18:25 +08:00
|
|
|
TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
|
|
|
|
TargetTriple.getEnvironment() == Triple::Android) &&
|
2014-04-03 04:32:05 +08:00
|
|
|
!isTargetDarwin() && !isTargetWindows();
|
2014-01-29 19:50:56 +08:00
|
|
|
}
|
|
|
|
|
2013-12-18 17:27:33 +08:00
|
|
|
bool isTargetHardFloat() const {
|
2014-04-03 04:32:05 +08:00
|
|
|
// FIXME: this is invalid for WindowsCE
|
2013-12-18 17:27:33 +08:00
|
|
|
return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
|
2014-04-03 04:32:05 +08:00
|
|
|
TargetTriple.getEnvironment() == Triple::EABIHF ||
|
|
|
|
isTargetWindows();
|
2013-07-16 17:32:17 +08:00
|
|
|
}
|
2014-04-03 00:10:33 +08:00
|
|
|
bool isTargetAndroid() const {
|
|
|
|
return TargetTriple.getEnvironment() == Triple::Android;
|
|
|
|
}
|
2007-01-20 03:22:40 +08:00
|
|
|
|
2014-01-02 21:40:08 +08:00
|
|
|
bool isAPCS_ABI() const {
|
|
|
|
assert(TargetABI != ARM_ABI_UNKNOWN);
|
|
|
|
return TargetABI == ARM_ABI_APCS;
|
|
|
|
}
|
|
|
|
bool isAAPCS_ABI() const {
|
|
|
|
assert(TargetABI != ARM_ABI_UNKNOWN);
|
|
|
|
return TargetABI == ARM_ABI_AAPCS;
|
|
|
|
}
|
2007-02-14 03:52:28 +08:00
|
|
|
|
2011-07-08 03:05:12 +08:00
|
|
|
bool isThumb() const { return InThumbMode; }
|
|
|
|
bool isThumb1Only() const { return InThumbMode && !HasThumb2; }
|
|
|
|
bool isThumb2() const { return InThumbMode && HasThumb2; }
|
2011-07-07 08:08:19 +08:00
|
|
|
bool hasThumb2() const { return HasThumb2; }
|
2013-09-23 22:26:15 +08:00
|
|
|
bool isMClass() const { return ARMProcClass == MClass; }
|
|
|
|
bool isRClass() const { return ARMProcClass == RClass; }
|
|
|
|
bool isAClass() const { return ARMProcClass == AClass; }
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2014-10-08 20:26:16 +08:00
|
|
|
bool isV6M() const {
|
|
|
|
return isThumb1Only() && isMClass();
|
|
|
|
}
|
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
bool isR9Reserved() const { return IsR9Reserved; }
|
|
|
|
|
2014-07-04 09:55:26 +08:00
|
|
|
bool useMovt(const MachineFunction &MF) const;
|
|
|
|
|
2011-10-08 01:17:49 +08:00
|
|
|
bool supportsTailCall() const { return SupportsTailCall; }
|
2009-11-24 08:44:37 +08:00
|
|
|
|
2010-09-28 12:09:35 +08:00
|
|
|
bool allowsUnalignedMem() const { return AllowsUnalignedMem; }
|
|
|
|
|
2013-11-14 02:29:49 +08:00
|
|
|
bool restrictIT() const { return RestrictIT; }
|
|
|
|
|
2009-05-24 03:50:50 +08:00
|
|
|
const std::string & getCPUString() const { return CPUString; }
|
2009-11-24 08:44:37 +08:00
|
|
|
|
2014-03-28 22:35:30 +08:00
|
|
|
bool isLittle() const { return IsLittle; }
|
|
|
|
|
2010-09-29 05:57:50 +08:00
|
|
|
unsigned getMispredictionPenalty() const;
|
2014-04-04 07:43:18 +08:00
|
|
|
|
2013-11-03 14:14:38 +08:00
|
|
|
/// This function returns true if the target has sincos() routine in its
|
|
|
|
/// compiler runtime or math libraries.
|
|
|
|
bool hasSinCos() const;
|
2010-12-24 12:28:06 +08:00
|
|
|
|
2014-06-04 15:06:27 +08:00
|
|
|
/// True for some subtargets at > -O0.
|
2014-07-16 06:39:58 +08:00
|
|
|
bool enablePostMachineScheduler() const override;
|
2009-05-24 03:50:50 +08:00
|
|
|
|
2014-08-22 05:50:01 +08:00
|
|
|
// enableAtomicExpand- True if we need to expand our atomics.
|
|
|
|
bool enableAtomicExpand() const override;
|
2014-06-20 05:03:04 +08:00
|
|
|
|
2014-08-16 06:17:28 +08:00
|
|
|
/// getInstrItins - Return the instruction itineraries based on subtarget
|
2009-06-19 09:51:50 +08:00
|
|
|
/// selection.
|
2014-09-03 19:41:21 +08:00
|
|
|
const InstrItineraryData *getInstrItineraryData() const override {
|
2014-08-05 05:25:23 +08:00
|
|
|
return &InstrItins;
|
|
|
|
}
|
2009-06-19 09:51:50 +08:00
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
/// getStackAlignment - Returns the minimum alignment known to hold of the
|
|
|
|
/// stack frame on entry to the function and which must be maintained by every
|
|
|
|
/// function for this subtarget.
|
|
|
|
unsigned getStackAlignment() const { return stackAlignment; }
|
2009-08-29 07:18:09 +08:00
|
|
|
|
|
|
|
/// GVIsIndirectSymbol - true if the GV will be accessed via an indirect
|
|
|
|
/// symbol.
|
2010-04-15 09:51:59 +08:00
|
|
|
bool GVIsIndirectSymbol(const GlobalValue *GV, Reloc::Model RelocM) const;
|
2014-07-16 01:18:41 +08:00
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
};
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif // ARMSUBTARGET_H
|