1 //===-- ARMSubtarget.h - Define Subtarget for the ARM ----------*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the ARM specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
15 #define LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
17 #include "ARMBaseInstrInfo.h"
18 #include "ARMBaseRegisterInfo.h"
19 #include "ARMFrameLowering.h"
20 #include "ARMISelLowering.h"
21 #include "ARMSelectionDAGInfo.h"
22 #include "llvm/ADT/Triple.h"
23 #include "llvm/CodeGen/GlobalISel/GISelAccessor.h"
24 #include "llvm/CodeGen/MachineFunction.h"
25 #include "llvm/MC/MCInstrItineraries.h"
26 #include "llvm/MC/MCSchedule.h"
27 #include "llvm/Target/TargetOptions.h"
28 #include "llvm/Target/TargetSubtargetInfo.h"
32 #define GET_SUBTARGETINFO_HEADER
33 #include "ARMGenSubtargetInfo.inc"
37 class ARMBaseTargetMachine;
41 class ARMSubtarget : public ARMGenSubtargetInfo {
43 enum ARMProcFamilyEnum {
70 enum ARMProcClassEnum {
108 /// What kind of timing do load multiple/store multiple instructions have.
109 enum ARMLdStMultipleTiming {
110 /// Can load/store 2 registers/cycle.
112 /// Can load/store 2 registers/cycle, but needs an extra cycle if the access
113 /// is not 64-bit aligned.
114 DoubleIssueCheckUnalignedAccess,
115 /// Can load/store 1 register/cycle.
117 /// Can load/store 1 register/cycle, but needs an extra cycle for address
118 /// computation and potentially also for register writeback.
119 SingleIssuePlusExtras,
123 /// ARMProcFamily - ARM processor family: Cortex-A8, Cortex-A9, and others.
124 ARMProcFamilyEnum ARMProcFamily = Others;
126 /// ARMProcClass - ARM processor class: None, AClass, RClass or MClass.
127 ARMProcClassEnum ARMProcClass = None;
129 /// ARMArch - ARM architecture
130 ARMArchEnum ARMArch = ARMv4t;
132 /// HasV4TOps, HasV5TOps, HasV5TEOps,
133 /// HasV6Ops, HasV6MOps, HasV6KOps, HasV6T2Ops, HasV7Ops, HasV8Ops -
134 /// Specify whether target support specific ARM ISA variants.
135 bool HasV4TOps = false;
136 bool HasV5TOps = false;
137 bool HasV5TEOps = false;
138 bool HasV6Ops = false;
139 bool HasV6MOps = false;
140 bool HasV6KOps = false;
141 bool HasV6T2Ops = false;
142 bool HasV7Ops = false;
143 bool HasV8Ops = false;
144 bool HasV8_1aOps = false;
145 bool HasV8_2aOps = false;
146 bool HasV8MBaselineOps = false;
147 bool HasV8MMainlineOps = false;
149 /// HasVFPv2, HasVFPv3, HasVFPv4, HasFPARMv8, HasNEON - Specify what
150 /// floating point ISAs are supported.
151 bool HasVFPv2 = false;
152 bool HasVFPv3 = false;
153 bool HasVFPv4 = false;
154 bool HasFPARMv8 = false;
155 bool HasNEON = false;
157 /// UseNEONForSinglePrecisionFP - if the NEONFP attribute has been
158 /// specified. Use the method useNEONForSinglePrecisionFP() to
159 /// determine if NEON should actually be used.
160 bool UseNEONForSinglePrecisionFP = false;
162 /// UseMulOps - True if non-microcoded fused integer multiply-add and
163 /// multiply-subtract instructions should be used.
164 bool UseMulOps = false;
166 /// SlowFPVMLx - If the VFP2 / NEON instructions are available, indicates
167 /// whether the FP VML[AS] instructions are slow (if so, don't use them).
168 bool SlowFPVMLx = false;
170 /// HasVMLxForwarding - If true, NEON has special multiplier accumulator
171 /// forwarding to allow mul + mla being issued back to back.
172 bool HasVMLxForwarding = false;
174 /// SlowFPBrcc - True if floating point compare + branch is slow.
175 bool SlowFPBrcc = false;
177 /// InThumbMode - True if compiling for Thumb, false for ARM.
178 bool InThumbMode = false;
180 /// UseSoftFloat - True if we're using software floating point features.
181 bool UseSoftFloat = false;
183 /// HasThumb2 - True if Thumb2 instructions are supported.
184 bool HasThumb2 = false;
186 /// NoARM - True if subtarget does not support ARM mode execution.
189 /// ReserveR9 - True if R9 is not available as a general purpose register.
190 bool ReserveR9 = false;
192 /// NoMovt - True if MOVT / MOVW pairs are not used for materialization of
193 /// 32-bit imms (including global addresses).
196 /// SupportsTailCall - True if the OS supports tail call. The dynamic linker
197 /// must be able to synthesize call stubs for interworking between ARM and
199 bool SupportsTailCall = false;
201 /// HasFP16 - True if subtarget supports half-precision FP conversions
202 bool HasFP16 = false;
204 /// HasFullFP16 - True if subtarget supports half-precision FP operations
205 bool HasFullFP16 = false;
207 /// HasD16 - True if subtarget is limited to 16 double precision
208 /// FP registers for VFPv3.
211 /// HasHardwareDivide - True if subtarget supports [su]div in Thumb mode
212 bool HasHardwareDivideInThumb = false;
214 /// HasHardwareDivideInARM - True if subtarget supports [su]div in ARM mode
215 bool HasHardwareDivideInARM = false;
217 /// HasDataBarrier - True if the subtarget supports DMB / DSB data barrier
219 bool HasDataBarrier = false;
221 /// HasV7Clrex - True if the subtarget supports CLREX instructions
222 bool HasV7Clrex = false;
224 /// HasAcquireRelease - True if the subtarget supports v8 atomics (LDA/LDAEX etc)
226 bool HasAcquireRelease = false;
228 /// Pref32BitThumb - If true, codegen would prefer 32-bit Thumb instructions
229 /// over 16-bit ones.
230 bool Pref32BitThumb = false;
232 /// AvoidCPSRPartialUpdate - If true, codegen would avoid using instructions
233 /// that partially update CPSR and add false dependency on the previous
234 /// CPSR setting instruction.
235 bool AvoidCPSRPartialUpdate = false;
237 /// CheapPredicableCPSRDef - If true, disable +1 predication cost
238 /// for instructions updating CPSR. Enabled for Cortex-A57.
239 bool CheapPredicableCPSRDef = false;
241 /// AvoidMOVsShifterOperand - If true, codegen should avoid using flag setting
242 /// movs with shifter operand (i.e. asr, lsl, lsr).
243 bool AvoidMOVsShifterOperand = false;
245 /// HasRetAddrStack - Some processors perform return stack prediction. CodeGen should
246 /// avoid issue "normal" call instructions to callees which do not return.
247 bool HasRetAddrStack = false;
249 /// HasMPExtension - True if the subtarget supports Multiprocessing
250 /// extension (ARMv7 only).
251 bool HasMPExtension = false;
253 /// HasVirtualization - True if the subtarget supports the Virtualization
255 bool HasVirtualization = false;
257 /// FPOnlySP - If true, the floating point unit only supports single
259 bool FPOnlySP = false;
261 /// If true, the processor supports the Performance Monitor Extensions. These
262 /// include a generic cycle-counter as well as more fine-grained (often
263 /// implementation-specific) events.
264 bool HasPerfMon = false;
266 /// HasTrustZone - if true, processor supports TrustZone security extensions
267 bool HasTrustZone = false;
269 /// Has8MSecExt - if true, processor supports ARMv8-M Security Extensions
270 bool Has8MSecExt = false;
272 /// HasCrypto - if true, processor supports Cryptography extensions
273 bool HasCrypto = false;
275 /// HasCRC - if true, processor supports CRC instructions
278 /// HasRAS - if true, the processor supports RAS extensions
281 /// If true, the instructions "vmov.i32 d0, #0" and "vmov.i32 q0, #0" are
282 /// particularly effective at zeroing a VFP register.
283 bool HasZeroCycleZeroing = false;
285 /// HasFPAO - if true, processor does positive address offset computation faster
286 bool HasFPAO = false;
288 /// If true, if conversion may decide to leave some instructions unpredicated.
289 bool IsProfitableToUnpredicate = false;
291 /// If true, VMOV will be favored over VGETLNi32.
292 bool HasSlowVGETLNi32 = false;
294 /// If true, VMOV will be favored over VDUP.
295 bool HasSlowVDUP32 = false;
297 /// If true, VMOVSR will be favored over VMOVDRR.
298 bool PreferVMOVSR = false;
300 /// If true, ISHST barriers will be used for Release semantics.
301 bool PreferISHST = false;
303 /// If true, a VLDM/VSTM starting with an odd register number is considered to
304 /// take more microops than single VLDRS/VSTRS.
305 bool SlowOddRegister = false;
307 /// If true, loading into a D subregister will be penalized.
308 bool SlowLoadDSubregister = false;
310 /// If true, the AGU and NEON/FPU units are multiplexed.
311 bool HasMuxedUnits = false;
313 /// If true, VMOVS will never be widened to VMOVD
314 bool DontWidenVMOVS = false;
316 /// If true, run the MLx expansion pass.
317 bool ExpandMLx = false;
319 /// If true, VFP/NEON VMLA/VMLS have special RAW hazards.
320 bool HasVMLxHazards = false;
322 /// If true, VMOVRS, VMOVSR and VMOVS will be converted from VFP to NEON.
323 bool UseNEONForFPMovs = false;
325 /// If true, VLDn instructions take an extra cycle for unaligned accesses.
326 bool CheckVLDnAlign = false;
328 /// If true, VFP instructions are not pipelined.
329 bool NonpipelinedVFP = false;
331 /// StrictAlign - If true, the subtarget disallows unaligned memory
332 /// accesses for some types. For details, see
333 /// ARMTargetLowering::allowsMisalignedMemoryAccesses().
334 bool StrictAlign = false;
336 /// RestrictIT - If true, the subtarget disallows generation of deprecated IT
337 /// blocks to conform to ARMv8 rule.
338 bool RestrictIT = false;
340 /// HasDSP - If true, the subtarget supports the DSP (saturating arith
341 /// and such) instructions.
344 /// NaCl TRAP instruction is generated instead of the regular TRAP.
345 bool UseNaClTrap = false;
347 /// Generate calls via indirect call instructions.
348 bool GenLongCalls = false;
350 /// Generate code that does not contain data access to code sections.
351 bool GenExecuteOnly = false;
353 /// Target machine allowed unsafe FP math (such as use of NEON fp)
354 bool UnsafeFPMath = false;
356 /// UseSjLjEH - If true, the target uses SjLj exception handling (e.g. iOS).
357 bool UseSjLjEH = false;
359 /// Implicitly convert an instruction to a different one if its immediates
360 /// cannot be encoded. For example, ADD r0, r1, #FFFFFFFF -> SUB r0, r1, #1.
361 bool NegativeImmediates = true;
363 /// stackAlignment - The minimum alignment known to hold of the stack frame on
364 /// entry to the function and which must be maintained by every function.
365 unsigned stackAlignment = 4;
367 /// CPUString - String name of used CPU.
368 std::string CPUString;
370 unsigned MaxInterleaveFactor = 1;
372 /// Clearance before partial register updates (in number of instructions)
373 unsigned PartialUpdateClearance = 0;
375 /// What kind of timing do load multiple/store multiple have (double issue,
376 /// single issue etc).
377 ARMLdStMultipleTiming LdStMultipleTiming = SingleIssue;
379 /// The adjustment that we need to apply to get the operand latency from the
380 /// operand cycle returned by the itinerary data for pre-ISel operands.
381 int PreISelOperandLatencyAdjustment = 2;
383 /// IsLittle - The target is Little Endian
386 /// TargetTriple - What processor and OS we're targeting.
389 /// SchedModel - Processor specific instruction costs.
390 MCSchedModel SchedModel;
392 /// Selected instruction itineraries (one entry per itinerary class.)
393 InstrItineraryData InstrItins;
395 /// Options passed via command line that could influence the target
396 const TargetOptions &Options;
398 const ARMBaseTargetMachine &TM;
401 /// This constructor initializes the data members to match that
402 /// of the specified triple.
404 ARMSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
405 const ARMBaseTargetMachine &TM, bool IsLittle);
407 /// This object will take onwership of \p GISelAccessor.
408 void setGISelAccessor(GISelAccessor &GISel) { this->GISel.reset(&GISel); }
410 /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
411 /// that still makes it profitable to inline the call.
412 unsigned getMaxInlineSizeThreshold() const {
416 /// ParseSubtargetFeatures - Parses features string setting specified
417 /// subtarget options. Definition of function is auto generated by tblgen.
418 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
420 /// initializeSubtargetDependencies - Initializes using a CPU and feature string
421 /// so that we can use initializer lists for subtarget initialization.
422 ARMSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
424 const ARMSelectionDAGInfo *getSelectionDAGInfo() const override {
428 const ARMBaseInstrInfo *getInstrInfo() const override {
429 return InstrInfo.get();
432 const ARMTargetLowering *getTargetLowering() const override {
436 const ARMFrameLowering *getFrameLowering() const override {
437 return FrameLowering.get();
440 const ARMBaseRegisterInfo *getRegisterInfo() const override {
441 return &InstrInfo->getRegisterInfo();
444 const CallLowering *getCallLowering() const override;
445 const InstructionSelector *getInstructionSelector() const override;
446 const LegalizerInfo *getLegalizerInfo() const override;
447 const RegisterBankInfo *getRegBankInfo() const override;
450 ARMSelectionDAGInfo TSInfo;
451 // Either Thumb1FrameLowering or ARMFrameLowering.
452 std::unique_ptr<ARMFrameLowering> FrameLowering;
453 // Either Thumb1InstrInfo or Thumb2InstrInfo.
454 std::unique_ptr<ARMBaseInstrInfo> InstrInfo;
455 ARMTargetLowering TLInfo;
457 /// Gather the accessor points to GlobalISel-related APIs.
458 /// This is used to avoid ifndefs spreading around while GISel is
459 /// an optional library.
460 std::unique_ptr<GISelAccessor> GISel;
462 void initializeEnvironment();
463 void initSubtargetFeatures(StringRef CPU, StringRef FS);
464 ARMFrameLowering *initializeFrameLowering(StringRef CPU, StringRef FS);
467 void computeIssueWidth();
469 bool hasV4TOps() const { return HasV4TOps; }
470 bool hasV5TOps() const { return HasV5TOps; }
471 bool hasV5TEOps() const { return HasV5TEOps; }
472 bool hasV6Ops() const { return HasV6Ops; }
473 bool hasV6MOps() const { return HasV6MOps; }
474 bool hasV6KOps() const { return HasV6KOps; }
475 bool hasV6T2Ops() const { return HasV6T2Ops; }
476 bool hasV7Ops() const { return HasV7Ops; }
477 bool hasV8Ops() const { return HasV8Ops; }
478 bool hasV8_1aOps() const { return HasV8_1aOps; }
479 bool hasV8_2aOps() const { return HasV8_2aOps; }
480 bool hasV8MBaselineOps() const { return HasV8MBaselineOps; }
481 bool hasV8MMainlineOps() const { return HasV8MMainlineOps; }
484 /// These functions are obsolete, please consider adding subtarget features
485 /// or properties instead of calling them.
486 bool isCortexA5() const { return ARMProcFamily == CortexA5; }
487 bool isCortexA7() const { return ARMProcFamily == CortexA7; }
488 bool isCortexA8() const { return ARMProcFamily == CortexA8; }
489 bool isCortexA9() const { return ARMProcFamily == CortexA9; }
490 bool isCortexA15() const { return ARMProcFamily == CortexA15; }
491 bool isSwift() const { return ARMProcFamily == Swift; }
492 bool isCortexM3() const { return ARMProcFamily == CortexM3; }
493 bool isLikeA9() const { return isCortexA9() || isCortexA15() || isKrait(); }
494 bool isCortexR5() const { return ARMProcFamily == CortexR5; }
495 bool isKrait() const { return ARMProcFamily == Krait; }
498 bool hasARMOps() const { return !NoARM; }
500 bool hasVFP2() const { return HasVFPv2; }
501 bool hasVFP3() const { return HasVFPv3; }
502 bool hasVFP4() const { return HasVFPv4; }
503 bool hasFPARMv8() const { return HasFPARMv8; }
504 bool hasNEON() const { return HasNEON; }
505 bool hasCrypto() const { return HasCrypto; }
506 bool hasCRC() const { return HasCRC; }
507 bool hasRAS() const { return HasRAS; }
508 bool hasVirtualization() const { return HasVirtualization; }
510 bool useNEONForSinglePrecisionFP() const {
511 return hasNEON() && UseNEONForSinglePrecisionFP;
514 bool hasDivideInThumbMode() const { return HasHardwareDivideInThumb; }
515 bool hasDivideInARMMode() const { return HasHardwareDivideInARM; }
516 bool hasDataBarrier() const { return HasDataBarrier; }
517 bool hasV7Clrex() const { return HasV7Clrex; }
518 bool hasAcquireRelease() const { return HasAcquireRelease; }
520 bool hasAnyDataBarrier() const {
521 return HasDataBarrier || (hasV6Ops() && !isThumb());
524 bool useMulOps() const { return UseMulOps; }
525 bool useFPVMLx() const { return !SlowFPVMLx; }
526 bool hasVMLxForwarding() const { return HasVMLxForwarding; }
527 bool isFPBrccSlow() const { return SlowFPBrcc; }
528 bool isFPOnlySP() const { return FPOnlySP; }
529 bool hasPerfMon() const { return HasPerfMon; }
530 bool hasTrustZone() const { return HasTrustZone; }
531 bool has8MSecExt() const { return Has8MSecExt; }
532 bool hasZeroCycleZeroing() const { return HasZeroCycleZeroing; }
533 bool hasFPAO() const { return HasFPAO; }
534 bool isProfitableToUnpredicate() const { return IsProfitableToUnpredicate; }
535 bool hasSlowVGETLNi32() const { return HasSlowVGETLNi32; }
536 bool hasSlowVDUP32() const { return HasSlowVDUP32; }
537 bool preferVMOVSR() const { return PreferVMOVSR; }
538 bool preferISHSTBarriers() const { return PreferISHST; }
539 bool expandMLx() const { return ExpandMLx; }
540 bool hasVMLxHazards() const { return HasVMLxHazards; }
541 bool hasSlowOddRegister() const { return SlowOddRegister; }
542 bool hasSlowLoadDSubregister() const { return SlowLoadDSubregister; }
543 bool hasMuxedUnits() const { return HasMuxedUnits; }
544 bool dontWidenVMOVS() const { return DontWidenVMOVS; }
545 bool useNEONForFPMovs() const { return UseNEONForFPMovs; }
546 bool checkVLDnAccessAlignment() const { return CheckVLDnAlign; }
547 bool nonpipelinedVFP() const { return NonpipelinedVFP; }
548 bool prefers32BitThumb() const { return Pref32BitThumb; }
549 bool avoidCPSRPartialUpdate() const { return AvoidCPSRPartialUpdate; }
550 bool cheapPredicableCPSRDef() const { return CheapPredicableCPSRDef; }
551 bool avoidMOVsShifterOperand() const { return AvoidMOVsShifterOperand; }
552 bool hasRetAddrStack() const { return HasRetAddrStack; }
553 bool hasMPExtension() const { return HasMPExtension; }
554 bool hasDSP() const { return HasDSP; }
555 bool useNaClTrap() const { return UseNaClTrap; }
556 bool useSjLjEH() const { return UseSjLjEH; }
557 bool genLongCalls() const { return GenLongCalls; }
558 bool genExecuteOnly() const { return GenExecuteOnly; }
560 bool hasFP16() const { return HasFP16; }
561 bool hasD16() const { return HasD16; }
562 bool hasFullFP16() const { return HasFullFP16; }
564 const Triple &getTargetTriple() const { return TargetTriple; }
566 bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
567 bool isTargetIOS() const { return TargetTriple.isiOS(); }
568 bool isTargetWatchOS() const { return TargetTriple.isWatchOS(); }
569 bool isTargetWatchABI() const { return TargetTriple.isWatchABI(); }
570 bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
571 bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
572 bool isTargetNetBSD() const { return TargetTriple.isOSNetBSD(); }
573 bool isTargetWindows() const { return TargetTriple.isOSWindows(); }
575 bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
576 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
577 bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
579 // ARM EABI is the bare-metal EABI described in ARM ABI documents and
580 // can be accessed via -target arm-none-eabi. This is NOT GNUEABI.
581 // FIXME: Add a flag for bare-metal for that target and set Triple::EABI
582 // even for GNUEABI, so we can make a distinction here and still conform to
583 // the EABI on GNU (and Android) mode. This requires change in Clang, too.
584 // FIXME: The Darwin exception is temporary, while we move users to
585 // "*-*-*-macho" triples as quickly as possible.
586 bool isTargetAEABI() const {
587 return (TargetTriple.getEnvironment() == Triple::EABI ||
588 TargetTriple.getEnvironment() == Triple::EABIHF) &&
589 !isTargetDarwin() && !isTargetWindows();
591 bool isTargetGNUAEABI() const {
592 return (TargetTriple.getEnvironment() == Triple::GNUEABI ||
593 TargetTriple.getEnvironment() == Triple::GNUEABIHF) &&
594 !isTargetDarwin() && !isTargetWindows();
596 bool isTargetMuslAEABI() const {
597 return (TargetTriple.getEnvironment() == Triple::MuslEABI ||
598 TargetTriple.getEnvironment() == Triple::MuslEABIHF) &&
599 !isTargetDarwin() && !isTargetWindows();
602 // ARM Targets that support EHABI exception handling standard
603 // Darwin uses SjLj. Other targets might need more checks.
604 bool isTargetEHABICompatible() const {
605 return (TargetTriple.getEnvironment() == Triple::EABI ||
606 TargetTriple.getEnvironment() == Triple::GNUEABI ||
607 TargetTriple.getEnvironment() == Triple::MuslEABI ||
608 TargetTriple.getEnvironment() == Triple::EABIHF ||
609 TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
610 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
611 isTargetAndroid()) &&
612 !isTargetDarwin() && !isTargetWindows();
615 bool isTargetHardFloat() const {
616 // FIXME: this is invalid for WindowsCE
617 return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
618 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
619 TargetTriple.getEnvironment() == Triple::EABIHF ||
620 isTargetWindows() || isAAPCS16_ABI();
623 bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
625 bool isXRaySupported() const override;
627 bool isAPCS_ABI() const;
628 bool isAAPCS_ABI() const;
629 bool isAAPCS16_ABI() const;
634 bool useSoftFloat() const { return UseSoftFloat; }
635 bool isThumb() const { return InThumbMode; }
636 bool isThumb1Only() const { return InThumbMode && !HasThumb2; }
637 bool isThumb2() const { return InThumbMode && HasThumb2; }
638 bool hasThumb2() const { return HasThumb2; }
639 bool isMClass() const { return ARMProcClass == MClass; }
640 bool isRClass() const { return ARMProcClass == RClass; }
641 bool isAClass() const { return ARMProcClass == AClass; }
643 bool isR9Reserved() const {
644 return isTargetMachO() ? (ReserveR9 || !HasV6Ops) : ReserveR9;
647 bool useR7AsFramePointer() const {
648 return isTargetDarwin() || (!isTargetWindows() && isThumb());
651 /// Returns true if the frame setup is split into two separate pushes (first
652 /// r0-r7,lr then r8-r11), principally so that the frame pointer is adjacent
653 /// to lr. This is always required on Thumb1-only targets, as the push and
654 /// pop instructions can't access the high registers.
655 bool splitFramePushPop(const MachineFunction &MF) const {
656 return (useR7AsFramePointer() &&
657 MF.getTarget().Options.DisableFramePointerElim(MF)) ||
661 bool useStride4VFPs(const MachineFunction &MF) const;
663 bool useMovt(const MachineFunction &MF) const;
665 bool supportsTailCall() const { return SupportsTailCall; }
667 bool allowsUnalignedMem() const { return !StrictAlign; }
669 bool restrictIT() const { return RestrictIT; }
671 const std::string & getCPUString() const { return CPUString; }
673 bool isLittle() const { return IsLittle; }
675 unsigned getMispredictionPenalty() const;
677 /// This function returns true if the target has sincos() routine in its
678 /// compiler runtime or math libraries.
679 bool hasSinCos() const;
681 /// Returns true if machine scheduler should be enabled.
682 bool enableMachineScheduler() const override;
684 /// True for some subtargets at > -O0.
685 bool enablePostRAScheduler() const override;
687 // enableAtomicExpand- True if we need to expand our atomics.
688 bool enableAtomicExpand() const override;
690 /// getInstrItins - Return the instruction itineraries based on subtarget
692 const InstrItineraryData *getInstrItineraryData() const override {
696 /// getStackAlignment - Returns the minimum alignment known to hold of the
697 /// stack frame on entry to the function and which must be maintained by every
698 /// function for this subtarget.
699 unsigned getStackAlignment() const { return stackAlignment; }
701 unsigned getMaxInterleaveFactor() const { return MaxInterleaveFactor; }
703 unsigned getPartialUpdateClearance() const { return PartialUpdateClearance; }
705 ARMLdStMultipleTiming getLdStMultipleTiming() const {
706 return LdStMultipleTiming;
709 int getPreISelOperandLatencyAdjustment() const {
710 return PreISelOperandLatencyAdjustment;
713 /// True if the GV will be accessed via an indirect symbol.
714 bool isGVIndirectSymbol(const GlobalValue *GV) const;
716 /// True if fast-isel is used.
717 bool useFastISel() const;
720 } // end namespace llvm
722 #endif // LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H