Lines Matching defs:TI

184                            const TargetInfo &TI, MacroBuilder &Builder) {
185 DefineTypeSize(MacroName, TI.getTypeWidth(Ty), TI.getTypeConstantSuffix(Ty),
186 TI.isTypeSigned(Ty), Builder);
190 TargetInfo::IntType Ty, const TargetInfo &TI,
192 StringRef FmtModifier = TI.getTypeFormatModifier(Ty);
197 bool IsSigned = TI.isTypeSigned(Ty);
212 const TargetInfo &TI, MacroBuilder &Builder) {
213 Builder.defineMacro(MacroName, Twine(TI.getTypeWidth(Ty)));
217 const TargetInfo &TI, MacroBuilder &Builder) {
219 Twine(BitWidth / TI.getCharWidth()));
226 const TargetInfo &TI,
228 DefineTypeSize(Prefix + "_MAX__", Ty, TI, Builder);
229 DefineTypeWidth(Prefix + "_WIDTH__", Ty, TI, Builder);
234 const TargetInfo &TI,
236 int TypeWidth = TI.getTypeWidth(Ty);
237 bool IsSigned = TI.isTypeSigned(Ty);
242 Ty = IsSigned ? TI.getInt64Type() : TI.getUInt64Type();
247 Ty = IsSigned ? TI.getInt16Type() : TI.getUInt16Type();
252 DefineFmt(LangOpts, Prefix + Twine(TypeWidth), Ty, TI, Builder);
254 StringRef ConstSuffix(TI.getTypeConstantSuffix(Ty));
261 const TargetInfo &TI,
263 int TypeWidth = TI.getTypeWidth(Ty);
264 bool IsSigned = TI.isTypeSigned(Ty);
269 Ty = IsSigned ? TI.getInt64Type() : TI.getUInt64Type();
274 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
279 const TargetInfo &TI,
281 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);
290 DefineTypeSizeAndWidth(Prefix + Twine(TypeWidth), Ty, TI, Builder);
292 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
293 DefineFmt(LangOpts, Prefix + Twine(TypeWidth), Ty, TI, Builder);
297 bool IsSigned, const TargetInfo &TI,
301 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);
310 DefineTypeSizeAndWidth(Prefix + Twine(TypeWidth), Ty, TI, Builder);
312 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
313 DefineFmt(LangOpts, Prefix + Twine(TypeWidth), Ty, TI, Builder);
319 static const char *getLockFreeValue(unsigned TypeWidth, const TargetInfo &TI) {
324 if (TI.hasBuiltinAtomic(TypeWidth, TypeWidth))
388 static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
423 hlsl::getStageFromEnvironment(TI.getTriple().getEnvironment()));
427 if (TI.getTriple().getOS() == llvm::Triple::ShaderModel) {
428 VersionTuple Version = TI.getTriple().getOSVersion();
502 Twine(TI.getNewAlign() / TI.getCharWidth()) +
503 TI.getTypeConstantSuffix(TI.getSizeType()));
580 if (TI.isLittleEndian())
622 if (!TI.hasHIPImageSupport()) {
779 void InitializeOpenCLFeatureTestMacros(const TargetInfo &TI,
782 const llvm::StringMap<bool> &OpenCLFeaturesMap = TI.getSupportedOpenCLOpts();
788 if (TI.hasFeatureEnabled(OpenCLFeaturesMap, Name) &&
828 void DefineFixedPointMacros(const TargetInfo &TI, MacroBuilder &Builder,
835 !Signed && TI.doUnsignedFixedPointTypesHavePadding());
854 static void InitializePredefinedMacros(const TargetInfo &TI,
948 if (TI.getTriple().isWindowsGNUEnvironment()) {
1002 Twine(TI.useSignedCharForObjCBool() ? "0" : "1"));
1033 (TI.getTriple().isThumb() || TI.getTriple().isARM()))
1035 else if (LangOpts.hasWasmExceptions() && TI.getTriple().isWasm())
1056 if (TI.getTypeWidth(TI.getWCharType()) >= 32) {
1085 if (TI.isBigEndian()) {
1093 if (TI.getPointerWidth(LangAS::Default) == 64 && TI.getLongWidth() == 64 &&
1094 TI.getIntWidth() == 32) {
1099 if (TI.getPointerWidth(LangAS::Default) == 32 && TI.getLongWidth() == 32 &&
1100 TI.getIntWidth() == 32) {
1106 assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far");
1107 Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth()));
1118 Builder.defineMacro("__SHRT_WIDTH__", Twine(TI.getShortWidth()));
1119 Builder.defineMacro("__INT_WIDTH__", Twine(TI.getIntWidth()));
1120 Builder.defineMacro("__LONG_WIDTH__", Twine(TI.getLongWidth()));
1121 Builder.defineMacro("__LLONG_WIDTH__", Twine(TI.getLongLongWidth()));
1123 size_t BitIntMaxWidth = TI.getMaxBitIntWidth();
1126 assert(BitIntMaxWidth >= TI.getLongLongWidth() &&
1130 DefineTypeSize("__SCHAR_MAX__", TargetInfo::SignedChar, TI, Builder);
1131 DefineTypeSize("__SHRT_MAX__", TargetInfo::SignedShort, TI, Builder);
1132 DefineTypeSize("__INT_MAX__", TargetInfo::SignedInt, TI, Builder);
1133 DefineTypeSize("__LONG_MAX__", TargetInfo::SignedLong, TI, Builder);
1134 DefineTypeSize("__LONG_LONG_MAX__", TargetInfo::SignedLongLong, TI, Builder);
1135 DefineTypeSizeAndWidth("__WCHAR", TI.getWCharType(), TI, Builder);
1136 DefineTypeSizeAndWidth("__WINT", TI.getWIntType(), TI, Builder);
1137 DefineTypeSizeAndWidth("__INTMAX", TI.getIntMaxType(), TI, Builder);
1138 DefineTypeSizeAndWidth("__SIZE", TI.getSizeType(), TI, Builder);
1140 DefineTypeSizeAndWidth("__UINTMAX", TI.getUIntMaxType(), TI, Builder);
1141 DefineTypeSizeAndWidth("__PTRDIFF", TI.getPtrDiffType(LangAS::Default), TI,
1143 DefineTypeSizeAndWidth("__INTPTR", TI.getIntPtrType(), TI, Builder);
1144 DefineTypeSizeAndWidth("__UINTPTR", TI.getUIntPtrType(), TI, Builder);
1146 DefineTypeSizeof("__SIZEOF_DOUBLE__", TI.getDoubleWidth(), TI, Builder);
1147 DefineTypeSizeof("__SIZEOF_FLOAT__", TI.getFloatWidth(), TI, Builder);
1148 DefineTypeSizeof("__SIZEOF_INT__", TI.getIntWidth(), TI, Builder);
1149 DefineTypeSizeof("__SIZEOF_LONG__", TI.getLongWidth(), TI, Builder);
1150 DefineTypeSizeof("__SIZEOF_LONG_DOUBLE__",TI.getLongDoubleWidth(),TI,Builder);
1151 DefineTypeSizeof("__SIZEOF_LONG_LONG__", TI.getLongLongWidth(), TI, Builder);
1152 DefineTypeSizeof("__SIZEOF_POINTER__", TI.getPointerWidth(LangAS::Default),
1153 TI, Builder);
1154 DefineTypeSizeof("__SIZEOF_SHORT__", TI.getShortWidth(), TI, Builder);
1156 TI.getTypeWidth(TI.getPtrDiffType(LangAS::Default)), TI,
1159 TI.getTypeWidth(TI.getSizeType()), TI, Builder);
1161 TI.getTypeWidth(TI.getWCharType()), TI, Builder);
1163 TI.getTypeWidth(TI.getWIntType()), TI, Builder);
1164 if (TI.hasInt128Type())
1165 DefineTypeSizeof("__SIZEOF_INT128__", 128, TI, Builder);
1167 DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder);
1168 DefineFmt(LangOpts, "__INTMAX", TI.getIntMaxType(), TI, Builder);
1169 StringRef ConstSuffix(TI.getTypeConstantSuffix(TI.getIntMaxType()));
1173 DefineType("__UINTMAX_TYPE__", TI.getUIntMaxType(), Builder);
1174 DefineFmt(LangOpts, "__UINTMAX", TI.getUIntMaxType(), TI, Builder);
1175 ConstSuffix = TI.getTypeConstantSuffix(TI.getUIntMaxType());
1179 DefineType("__PTRDIFF_TYPE__", TI.getPtrDiffType(LangAS::Default), Builder);
1180 DefineFmt(LangOpts, "__PTRDIFF", TI.getPtrDiffType(LangAS::Default), TI,
1182 DefineType("__INTPTR_TYPE__", TI.getIntPtrType(), Builder);
1183 DefineFmt(LangOpts, "__INTPTR", TI.getIntPtrType(), TI, Builder);
1184 DefineType("__SIZE_TYPE__", TI.getSizeType(), Builder);
1185 DefineFmt(LangOpts, "__SIZE", TI.getSizeType(), TI, Builder);
1186 DefineType("__WCHAR_TYPE__", TI.getWCharType(), Builder);
1187 DefineType("__WINT_TYPE__", TI.getWIntType(), Builder);
1188 DefineTypeSizeAndWidth("__SIG_ATOMIC", TI.getSigAtomicType(), TI, Builder);
1190 DefineType("__CHAR8_TYPE__", TI.UnsignedChar, Builder);
1191 DefineType("__CHAR16_TYPE__", TI.getChar16Type(), Builder);
1192 DefineType("__CHAR32_TYPE__", TI.getChar32Type(), Builder);
1194 DefineType("__UINTPTR_TYPE__", TI.getUIntPtrType(), Builder);
1195 DefineFmt(LangOpts, "__UINTPTR", TI.getUIntPtrType(), TI, Builder);
1199 assert(TI.getTypeWidth(TI.getUIntPtrType()) ==
1200 TI.getTypeWidth(TI.getIntPtrType()) &&
1202 assert(TI.getTypeWidth(TI.getUIntMaxType()) ==
1203 TI.getTypeWidth(TI.getIntMaxType()) &&
1208 DefineFixedPointMacros(TI, Builder, "SFRACT", "HR", TI.getShortFractWidth(),
1209 TI.getShortFractScale(), /*Signed=*/true);
1210 DefineFixedPointMacros(TI, Builder, "USFRACT", "UHR",
1211 TI.getShortFractWidth(),
1212 TI.getUnsignedShortFractScale(), /*Signed=*/false);
1213 DefineFixedPointMacros(TI, Builder, "FRACT", "R", TI.getFractWidth(),
1214 TI.getFractScale(), /*Signed=*/true);
1215 DefineFixedPointMacros(TI, Builder, "UFRACT", "UR", TI.getFractWidth(),
1216 TI.getUnsignedFractScale(), /*Signed=*/false);
1217 DefineFixedPointMacros(TI, Builder, "LFRACT", "LR", TI.getLongFractWidth(),
1218 TI.getLongFractScale(), /*Signed=*/true);
1219 DefineFixedPointMacros(TI, Builder, "ULFRACT", "ULR",
1220 TI.getLongFractWidth(),
1221 TI.getUnsignedLongFractScale(), /*Signed=*/false);
1222 DefineFixedPointMacros(TI, Builder, "SACCUM", "HK", TI.getShortAccumWidth(),
1223 TI.getShortAccumScale(), /*Signed=*/true);
1224 DefineFixedPointMacros(TI, Builder, "USACCUM", "UHK",
1225 TI.getShortAccumWidth(),
1226 TI.getUnsignedShortAccumScale(), /*Signed=*/false);
1227 DefineFixedPointMacros(TI, Builder, "ACCUM", "K", TI.getAccumWidth(),
1228 TI.getAccumScale(), /*Signed=*/true);
1229 DefineFixedPointMacros(TI, Builder, "UACCUM", "UK", TI.getAccumWidth(),
1230 TI.getUnsignedAccumScale(), /*Signed=*/false);
1231 DefineFixedPointMacros(TI, Builder, "LACCUM", "LK", TI.getLongAccumWidth(),
1232 TI.getLongAccumScale(), /*Signed=*/true);
1233 DefineFixedPointMacros(TI, Builder, "ULACCUM", "ULK",
1234 TI.getLongAccumWidth(),
1235 TI.getUnsignedLongAccumScale(), /*Signed=*/false);
1237 Builder.defineMacro("__SACCUM_IBIT__", Twine(TI.getShortAccumIBits()));
1239 Twine(TI.getUnsignedShortAccumIBits()));
1240 Builder.defineMacro("__ACCUM_IBIT__", Twine(TI.getAccumIBits()));
1241 Builder.defineMacro("__UACCUM_IBIT__", Twine(TI.getUnsignedAccumIBits()));
1242 Builder.defineMacro("__LACCUM_IBIT__", Twine(TI.getLongAccumIBits()));
1244 Twine(TI.getUnsignedLongAccumIBits()));
1247 if (TI.hasFloat16Type())
1248 DefineFloatMacros(Builder, "FLT16", &TI.getHalfFormat(), "F16");
1249 DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F");
1250 DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), "");
1251 DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L");
1255 Twine((int)TI.getPointerWidth(LangAS::Default)));
1259 Twine(TI.getSuitableAlign() / TI.getCharWidth()) );
1264 if (!TargetInfo::isTypeSigned(TI.getWCharType()))
1267 if (!TargetInfo::isTypeSigned(TI.getWIntType()))
1271 DefineExactWidthIntType(LangOpts, TargetInfo::SignedChar, TI, Builder);
1273 if (TI.getShortWidth() > TI.getCharWidth())
1274 DefineExactWidthIntType(LangOpts, TargetInfo::SignedShort, TI, Builder);
1276 if (TI.getIntWidth() > TI.getShortWidth())
1277 DefineExactWidthIntType(LangOpts, TargetInfo::SignedInt, TI, Builder);
1279 if (TI.getLongWidth() > TI.getIntWidth())
1280 DefineExactWidthIntType(LangOpts, TargetInfo::SignedLong, TI, Builder);
1282 if (TI.getLongLongWidth() > TI.getLongWidth())
1283 DefineExactWidthIntType(LangOpts, TargetInfo::SignedLongLong, TI, Builder);
1285 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedChar, TI, Builder);
1286 DefineExactWidthIntTypeSize(TargetInfo::UnsignedChar, TI, Builder);
1287 DefineExactWidthIntTypeSize(TargetInfo::SignedChar, TI, Builder);
1289 if (TI.getShortWidth() > TI.getCharWidth()) {
1290 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedShort, TI, Builder);
1291 DefineExactWidthIntTypeSize(TargetInfo::UnsignedShort, TI, Builder);
1292 DefineExactWidthIntTypeSize(TargetInfo::SignedShort, TI, Builder);
1295 if (TI.getIntWidth() > TI.getShortWidth()) {
1296 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedInt, TI, Builder);
1297 DefineExactWidthIntTypeSize(TargetInfo::UnsignedInt, TI, Builder);
1298 DefineExactWidthIntTypeSize(TargetInfo::SignedInt, TI, Builder);
1301 if (TI.getLongWidth() > TI.getIntWidth()) {
1302 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedLong, TI, Builder);
1303 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLong, TI, Builder);
1304 DefineExactWidthIntTypeSize(TargetInfo::SignedLong, TI, Builder);
1307 if (TI.getLongLongWidth() > TI.getLongWidth()) {
1308 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedLongLong, TI,
1310 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLongLong, TI, Builder);
1311 DefineExactWidthIntTypeSize(TargetInfo::SignedLongLong, TI, Builder);
1314 DefineLeastWidthIntType(LangOpts, 8, true, TI, Builder);
1315 DefineLeastWidthIntType(LangOpts, 8, false, TI, Builder);
1316 DefineLeastWidthIntType(LangOpts, 16, true, TI, Builder);
1317 DefineLeastWidthIntType(LangOpts, 16, false, TI, Builder);
1318 DefineLeastWidthIntType(LangOpts, 32, true, TI, Builder);
1319 DefineLeastWidthIntType(LangOpts, 32, false, TI, Builder);
1320 DefineLeastWidthIntType(LangOpts, 64, true, TI, Builder);
1321 DefineLeastWidthIntType(LangOpts, 64, false, TI, Builder);
1323 DefineFastIntType(LangOpts, 8, true, TI, Builder);
1324 DefineFastIntType(LangOpts, 8, false, TI, Builder);
1325 DefineFastIntType(LangOpts, 16, true, TI, Builder);
1326 DefineFastIntType(LangOpts, 16, false, TI, Builder);
1327 DefineFastIntType(LangOpts, 32, true, TI, Builder);
1328 DefineFastIntType(LangOpts, 32, false, TI, Builder);
1329 DefineFastIntType(LangOpts, 64, true, TI, Builder);
1330 DefineFastIntType(LangOpts, 64, false, TI, Builder);
1332 Builder.defineMacro("__USER_LABEL_PREFIX__", TI.getUserLabelPrefix());
1355 auto [Destructive, Constructive] = TI.hardwareInterferenceSizes();
1367 getLockFreeValue(TI.get##Type##Width(), TI));
1383 getLockFreeValue(TI.getPointerWidth(LangAS::Default), TI));
1436 if (TI.getTriple().isOSDarwin()) {
1444 if (TI.getTriple().isOSDarwin() && TI.getTriple().isSimulatorEnvironment())
1505 InitializeOpenCLFeatureTestMacros(TI, LangOpts, Builder);
1507 if (TI.getTriple().isSPIR() || TI.getTriple().isSPIRV())
1511 if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) {
1520 if (TI.getTriple().isOSBinFormatELF())
1525 const llvm::Triple &Triple = TI.getTriple();
1533 TI.getTargetDefines(LangOpts, Builder);