10b57cec5SDimitry Andric//===-- ARMPredicates.td - ARM Instruction Predicates ------*- tablegen -*-===// 20b57cec5SDimitry Andric// 30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric// 70b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 90b57cec5SDimitry Andricdef HasV4T : Predicate<"Subtarget->hasV4TOps()">, 10*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV4TOps), "armv4t">; 110b57cec5SDimitry Andricdef NoV4T : Predicate<"!Subtarget->hasV4TOps()">; 120b57cec5SDimitry Andricdef HasV5T : Predicate<"Subtarget->hasV5TOps()">, 13*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV5TOps), "armv5t">; 140b57cec5SDimitry Andricdef NoV5T : Predicate<"!Subtarget->hasV5TOps()">; 150b57cec5SDimitry Andricdef HasV5TE : Predicate<"Subtarget->hasV5TEOps()">, 16*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV5TEOps), "armv5te">; 170b57cec5SDimitry Andricdef HasV6 : Predicate<"Subtarget->hasV6Ops()">, 18*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV6Ops), "armv6">; 190b57cec5SDimitry Andricdef NoV6 : Predicate<"!Subtarget->hasV6Ops()">; 200b57cec5SDimitry Andricdef HasV6M : Predicate<"Subtarget->hasV6MOps()">, 21*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV6MOps), 220b57cec5SDimitry Andric "armv6m or armv6t2">; 230b57cec5SDimitry Andricdef HasV8MBaseline : Predicate<"Subtarget->hasV8MBaselineOps()">, 24*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8MBaselineOps), 250b57cec5SDimitry Andric "armv8m.base">; 260b57cec5SDimitry Andricdef HasV8MMainline : Predicate<"Subtarget->hasV8MMainlineOps()">, 27*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8MMainlineOps), 280b57cec5SDimitry Andric "armv8m.main">; 290b57cec5SDimitry Andricdef HasV8_1MMainline : Predicate<"Subtarget->hasV8_1MMainlineOps()">, 30*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8_1MMainlineOps), 310b57cec5SDimitry Andric "armv8.1m.main">; 320b57cec5SDimitry Andricdef HasMVEInt : Predicate<"Subtarget->hasMVEIntegerOps()">, 33*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasMVEIntegerOps), 340b57cec5SDimitry Andric "mve">; 350b57cec5SDimitry Andricdef HasMVEFloat : Predicate<"Subtarget->hasMVEFloatOps()">, 36*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasMVEFloatOps), 370b57cec5SDimitry Andric "mve.fp">; 38*5ffd83dbSDimitry Andricdef HasCDE : Predicate<"Subtarget->hasCDEOps()">, 39*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasCDEOps), 40*5ffd83dbSDimitry Andric "cde">; 410b57cec5SDimitry Andricdef HasFPRegs : Predicate<"Subtarget->hasFPRegs()">, 42*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFPRegs), 430b57cec5SDimitry Andric "fp registers">; 440b57cec5SDimitry Andricdef HasFPRegs16 : Predicate<"Subtarget->hasFPRegs16()">, 45*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFPRegs16), 46*5ffd83dbSDimitry Andric "16-bit fp registers">; 47*5ffd83dbSDimitry Andricdef HasNoFPRegs16 : Predicate<"!Subtarget->hasFPRegs16()">, 48*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of (not FeatureFPRegs16)), 490b57cec5SDimitry Andric "16-bit fp registers">; 500b57cec5SDimitry Andricdef HasFPRegs64 : Predicate<"Subtarget->hasFPRegs64()">, 51*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFPRegs64), 520b57cec5SDimitry Andric "64-bit fp registers">; 530b57cec5SDimitry Andricdef HasFPRegsV8_1M : Predicate<"Subtarget->hasFPRegs() && Subtarget->hasV8_1MMainlineOps()">, 54*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFPRegs, HasV8_1MMainlineOps), 550b57cec5SDimitry Andric "armv8.1m.main with FP or MVE">; 560b57cec5SDimitry Andricdef HasV6T2 : Predicate<"Subtarget->hasV6T2Ops()">, 57*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV6T2Ops), "armv6t2">; 580b57cec5SDimitry Andricdef NoV6T2 : Predicate<"!Subtarget->hasV6T2Ops()">; 590b57cec5SDimitry Andricdef HasV6K : Predicate<"Subtarget->hasV6KOps()">, 60*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV6KOps), "armv6k">; 610b57cec5SDimitry Andricdef NoV6K : Predicate<"!Subtarget->hasV6KOps()">; 620b57cec5SDimitry Andricdef HasV7 : Predicate<"Subtarget->hasV7Ops()">, 63*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV7Ops), "armv7">; 640b57cec5SDimitry Andricdef HasV8 : Predicate<"Subtarget->hasV8Ops()">, 65*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8Ops), "armv8">; 660b57cec5SDimitry Andricdef PreV8 : Predicate<"!Subtarget->hasV8Ops()">, 67*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of (not HasV8Ops)), "armv7 or earlier">; 680b57cec5SDimitry Andricdef HasV8_1a : Predicate<"Subtarget->hasV8_1aOps()">, 69*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8_1aOps), "armv8.1a">; 700b57cec5SDimitry Andricdef HasV8_2a : Predicate<"Subtarget->hasV8_2aOps()">, 71*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8_2aOps), "armv8.2a">; 720b57cec5SDimitry Andricdef HasV8_3a : Predicate<"Subtarget->hasV8_3aOps()">, 73*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8_3aOps), "armv8.3a">; 740b57cec5SDimitry Andricdef HasV8_4a : Predicate<"Subtarget->hasV8_4aOps()">, 75*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8_4aOps), "armv8.4a">; 760b57cec5SDimitry Andricdef HasV8_5a : Predicate<"Subtarget->hasV8_5aOps()">, 77*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8_5aOps), "armv8.5a">; 78*5ffd83dbSDimitry Andricdef HasV8_6a : Predicate<"Subtarget->hasV8_6aOps()">, 79*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of HasV8_6aOps), "armv8.6a">; 800b57cec5SDimitry Andricdef NoVFP : Predicate<"!Subtarget->hasVFP2Base()">; 810b57cec5SDimitry Andricdef HasVFP2 : Predicate<"Subtarget->hasVFP2Base()">, 82*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureVFP2_SP), "VFP2">; 830b57cec5SDimitry Andricdef HasVFP3 : Predicate<"Subtarget->hasVFP3Base()">, 84*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureVFP3_D16_SP), "VFP3">; 850b57cec5SDimitry Andricdef HasVFP4 : Predicate<"Subtarget->hasVFP4Base()">, 86*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureVFP4_D16_SP), "VFP4">; 870b57cec5SDimitry Andricdef HasDPVFP : Predicate<"Subtarget->hasFP64()">, 88*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFP64), 890b57cec5SDimitry Andric "double precision VFP">; 900b57cec5SDimitry Andricdef HasFPARMv8 : Predicate<"Subtarget->hasFPARMv8Base()">, 91*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFPARMv8_D16_SP), "FPARMv8">; 920b57cec5SDimitry Andricdef HasNEON : Predicate<"Subtarget->hasNEON()">, 93*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureNEON), "NEON">; 940b57cec5SDimitry Andricdef HasSHA2 : Predicate<"Subtarget->hasSHA2()">, 95*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureSHA2), "sha2">; 960b57cec5SDimitry Andricdef HasAES : Predicate<"Subtarget->hasAES()">, 97*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureAES), "aes">; 980b57cec5SDimitry Andricdef HasCrypto : Predicate<"Subtarget->hasCrypto()">, 99*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureCrypto), "crypto">; 1000b57cec5SDimitry Andricdef HasDotProd : Predicate<"Subtarget->hasDotProd()">, 101*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureDotProd), "dotprod">; 1020b57cec5SDimitry Andricdef HasCRC : Predicate<"Subtarget->hasCRC()">, 103*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureCRC), "crc">; 1040b57cec5SDimitry Andricdef HasRAS : Predicate<"Subtarget->hasRAS()">, 105*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureRAS), "ras">; 1060b57cec5SDimitry Andricdef HasLOB : Predicate<"Subtarget->hasLOB()">, 107*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureLOB), "lob">; 1080b57cec5SDimitry Andricdef HasFP16 : Predicate<"Subtarget->hasFP16()">, 109*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFP16),"half-float conversions">; 1100b57cec5SDimitry Andricdef HasFullFP16 : Predicate<"Subtarget->hasFullFP16()">, 111*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFullFP16),"full half-float">; 1120b57cec5SDimitry Andricdef HasFP16FML : Predicate<"Subtarget->hasFP16FML()">, 113*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureFP16FML),"full half-float fml">; 114*5ffd83dbSDimitry Andricdef HasBF16 : Predicate<"Subtarget->hasBF16()">, 115*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureBF16),"BFloat16 floating point extension">; 116*5ffd83dbSDimitry Andricdef HasMatMulInt8 : Predicate<"Subtarget->hasMatMulInt8()">, 117*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureMatMulInt8),"8-bit integer matrix multiply">; 1180b57cec5SDimitry Andricdef HasDivideInThumb : Predicate<"Subtarget->hasDivideInThumbMode()">, 119*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureHWDivThumb), "divide in THUMB">; 1200b57cec5SDimitry Andricdef HasDivideInARM : Predicate<"Subtarget->hasDivideInARMMode()">, 121*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureHWDivARM), "divide in ARM">; 1220b57cec5SDimitry Andricdef HasDSP : Predicate<"Subtarget->hasDSP()">, 123*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureDSP), "dsp">; 1240b57cec5SDimitry Andricdef HasDB : Predicate<"Subtarget->hasDataBarrier()">, 125*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureDB), 1260b57cec5SDimitry Andric "data-barriers">; 1270b57cec5SDimitry Andricdef HasDFB : Predicate<"Subtarget->hasFullDataBarrier()">, 128*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureDFB), 1290b57cec5SDimitry Andric "full-data-barrier">; 1300b57cec5SDimitry Andricdef HasV7Clrex : Predicate<"Subtarget->hasV7Clrex()">, 131*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureV7Clrex), 1320b57cec5SDimitry Andric "v7 clrex">; 1330b57cec5SDimitry Andricdef HasAcquireRelease : Predicate<"Subtarget->hasAcquireRelease()">, 134*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureAcquireRelease), 1350b57cec5SDimitry Andric "acquire/release">; 1360b57cec5SDimitry Andricdef HasMP : Predicate<"Subtarget->hasMPExtension()">, 137*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureMP), 1380b57cec5SDimitry Andric "mp-extensions">; 1390b57cec5SDimitry Andricdef HasVirtualization: Predicate<"false">, 140*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureVirtualization), 1410b57cec5SDimitry Andric "virtualization-extensions">; 1420b57cec5SDimitry Andricdef HasTrustZone : Predicate<"Subtarget->hasTrustZone()">, 143*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureTrustZone), 1440b57cec5SDimitry Andric "TrustZone">; 1450b57cec5SDimitry Andricdef Has8MSecExt : Predicate<"Subtarget->has8MSecExt()">, 146*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of Feature8MSecExt), 1470b57cec5SDimitry Andric "ARMv8-M Security Extensions">; 1480b57cec5SDimitry Andricdef HasZCZ : Predicate<"Subtarget->hasZeroCycleZeroing()">; 1490b57cec5SDimitry Andricdef UseNEONForFP : Predicate<"Subtarget->useNEONForSinglePrecisionFP()">; 1500b57cec5SDimitry Andricdef DontUseNEONForFP : Predicate<"!Subtarget->useNEONForSinglePrecisionFP()">; 1510b57cec5SDimitry Andricdef IsThumb : Predicate<"Subtarget->isThumb()">, 152*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of ModeThumb), "thumb">; 1530b57cec5SDimitry Andricdef IsThumb1Only : Predicate<"Subtarget->isThumb1Only()">; 1540b57cec5SDimitry Andricdef IsThumb2 : Predicate<"Subtarget->isThumb2()">, 155*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of ModeThumb, FeatureThumb2), 1560b57cec5SDimitry Andric "thumb2">; 1570b57cec5SDimitry Andricdef IsMClass : Predicate<"Subtarget->isMClass()">, 158*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureMClass), "armv*m">; 1590b57cec5SDimitry Andricdef IsNotMClass : Predicate<"!Subtarget->isMClass()">, 160*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of (not FeatureMClass)), 1610b57cec5SDimitry Andric "!armv*m">; 1620b57cec5SDimitry Andricdef IsARM : Predicate<"!Subtarget->isThumb()">, 163*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of (not ModeThumb)), "arm-mode">; 1640b57cec5SDimitry Andricdef IsMachO : Predicate<"Subtarget->isTargetMachO()">; 1650b57cec5SDimitry Andricdef IsNotMachO : Predicate<"!Subtarget->isTargetMachO()">; 1660b57cec5SDimitry Andricdef IsNaCl : Predicate<"Subtarget->isTargetNaCl()">; 1670b57cec5SDimitry Andricdef IsWindows : Predicate<"Subtarget->isTargetWindows()">; 1680b57cec5SDimitry Andricdef IsNotWindows : Predicate<"!Subtarget->isTargetWindows()">; 1690b57cec5SDimitry Andricdef IsReadTPHard : Predicate<"Subtarget->isReadTPHard()">; 1700b57cec5SDimitry Andricdef IsReadTPSoft : Predicate<"!Subtarget->isReadTPHard()">; 1710b57cec5SDimitry Andricdef UseNaClTrap : Predicate<"Subtarget->useNaClTrap()">, 172*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureNaClTrap), "NaCl">; 1730b57cec5SDimitry Andricdef DontUseNaClTrap : Predicate<"!Subtarget->useNaClTrap()">; 1740b57cec5SDimitry Andric 1750b57cec5SDimitry Andricdef UseNegativeImmediates : 1760b57cec5SDimitry Andric Predicate<"false">, 177*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of (not FeatureNoNegativeImmediates)), 1780b57cec5SDimitry Andric "NegativeImmediates">; 1790b57cec5SDimitry Andric 1800b57cec5SDimitry Andric// FIXME: Eventually this will be just "hasV6T2Ops". 1810b57cec5SDimitry Andriclet RecomputePerFunction = 1 in { 1820b57cec5SDimitry Andric def UseMovt : Predicate<"Subtarget->useMovt()">; 1830b57cec5SDimitry Andric def DontUseMovt : Predicate<"!Subtarget->useMovt()">; 1840b57cec5SDimitry Andric def UseMovtInPic : Predicate<"Subtarget->useMovt() && Subtarget->allowPositionIndependentMovt()">; 1850b57cec5SDimitry Andric def DontUseMovtInPic : Predicate<"!Subtarget->useMovt() || !Subtarget->allowPositionIndependentMovt()">; 1860b57cec5SDimitry Andric 1870b57cec5SDimitry Andric def UseFPVMLx: Predicate<"((Subtarget->useFPVMLx() &&" 1880b57cec5SDimitry Andric " TM.Options.AllowFPOpFusion != FPOpFusion::Fast) ||" 1890b57cec5SDimitry Andric "Subtarget->hasMinSize())">; 1900b57cec5SDimitry Andric} 1910b57cec5SDimitry Andricdef UseMulOps : Predicate<"Subtarget->useMulOps()">; 1920b57cec5SDimitry Andric 1930b57cec5SDimitry Andric// Prefer fused MAC for fp mul + add over fp VMLA / VMLS if they are available. 1940b57cec5SDimitry Andric// But only select them if more precision in FP computation is allowed, and when 1950b57cec5SDimitry Andric// they are not slower than a mul + add sequence. 1960b57cec5SDimitry Andric// Do not use them for Darwin platforms. 197480093f4SDimitry Andricdef UseFusedMAC : Predicate<"TM.Options.AllowFPOpFusion ==" 1980b57cec5SDimitry Andric " FPOpFusion::Fast && " 199480093f4SDimitry Andric "Subtarget->useFPVFMx()">; 2000b57cec5SDimitry Andric 2010b57cec5SDimitry Andricdef HasFastVGETLNi32 : Predicate<"!Subtarget->hasSlowVGETLNi32()">; 2020b57cec5SDimitry Andricdef HasSlowVGETLNi32 : Predicate<"Subtarget->hasSlowVGETLNi32()">; 2030b57cec5SDimitry Andric 2040b57cec5SDimitry Andricdef HasFastVDUP32 : Predicate<"!Subtarget->hasSlowVDUP32()">; 2050b57cec5SDimitry Andricdef HasSlowVDUP32 : Predicate<"Subtarget->hasSlowVDUP32()">; 2060b57cec5SDimitry Andric 2070b57cec5SDimitry Andricdef UseVMOVSR : Predicate<"Subtarget->preferVMOVSR() ||" 2080b57cec5SDimitry Andric "!Subtarget->useNEONForSinglePrecisionFP()">; 2090b57cec5SDimitry Andricdef DontUseVMOVSR : Predicate<"!Subtarget->preferVMOVSR() &&" 2100b57cec5SDimitry Andric "Subtarget->useNEONForSinglePrecisionFP()">; 2110b57cec5SDimitry Andric 2120b57cec5SDimitry Andriclet RecomputePerFunction = 1 in { 2130b57cec5SDimitry Andric def IsLE : Predicate<"MF->getDataLayout().isLittleEndian()">; 2140b57cec5SDimitry Andric def IsBE : Predicate<"MF->getDataLayout().isBigEndian()">; 2150b57cec5SDimitry Andric} 2160b57cec5SDimitry Andric 2170b57cec5SDimitry Andricdef GenExecuteOnly : Predicate<"Subtarget->genExecuteOnly()">; 2180b57cec5SDimitry Andric 2190b57cec5SDimitry Andric// Armv8.5-A extensions 2200b57cec5SDimitry Andricdef HasSB : Predicate<"Subtarget->hasSB()">, 221*5ffd83dbSDimitry Andric AssemblerPredicate<(all_of FeatureSB), "sb">; 222