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));
259 const TargetInfo &TI,
261 int TypeWidth = TI.getTypeWidth(Ty);
262 bool IsSigned = TI.isTypeSigned(Ty);
267 Ty = IsSigned ? TI.getInt64Type() : TI.getUInt64Type();
272 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
277 const TargetInfo &TI,
279 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);
288 DefineTypeSizeAndWidth(Prefix + Twine(TypeWidth), Ty, TI, Builder);
290 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
291 DefineFmt(LangOpts, Prefix + Twine(TypeWidth), Ty, TI, Builder);
295 bool IsSigned, const TargetInfo &TI,
299 TargetInfo::IntType Ty = TI.getLeastIntTypeByWidth(TypeWidth, IsSigned);
308 DefineTypeSizeAndWidth(Prefix + Twine(TypeWidth), Ty, TI, Builder);
310 DefineTypeSize(Prefix + Twine(TypeWidth) + "_MAX__", Ty, TI, Builder);
311 DefineFmt(LangOpts, Prefix + Twine(TypeWidth), Ty, TI, Builder);
317 static const char *getLockFreeValue(unsigned TypeWidth, const TargetInfo &TI) {
322 if (TI.hasBuiltinAtomic(TypeWidth, TypeWidth))
386 static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
421 hlsl::getStageFromEnvironment(TI.getTriple().getEnvironment()));
425 if (TI.getTriple().getOS() == llvm::Triple::ShaderModel) {
426 VersionTuple Version = TI.getTriple().getOSVersion();
500 Twine(TI.getNewAlign() / TI.getCharWidth()) +
501 TI.getTypeConstantSuffix(TI.getSizeType()));
578 if (TI.isLittleEndian())
620 if (!TI.hasHIPImageSupport()) {
776 void InitializeOpenCLFeatureTestMacros(const TargetInfo &TI,
779 const llvm::StringMap<bool> &OpenCLFeaturesMap = TI.getSupportedOpenCLOpts();
785 if (TI.hasFeatureEnabled(OpenCLFeaturesMap, Name) &&
825 void DefineFixedPointMacros(const TargetInfo &TI, MacroBuilder &Builder,
832 !Signed && TI.doUnsignedFixedPointTypesHavePadding());
851 static void InitializePredefinedMacros(const TargetInfo &TI,
945 if (TI.getTriple().isWindowsGNUEnvironment()) {
999 Twine(TI.useSignedCharForObjCBool() ? "0" : "1"));
1030 (TI.getTriple().isThumb() || TI.getTriple().isARM()))
1032 else if (LangOpts.hasWasmExceptions() && TI.getTriple().isWasm())
1053 if (TI.getTypeWidth(TI.getWCharType()) >= 32) {
1082 if (TI.isBigEndian()) {
1090 if (TI.getPointerWidth(LangAS::Default) == 64 && TI.getLongWidth() == 64 &&
1091 TI.getIntWidth() == 32) {
1096 if (TI.getPointerWidth(LangAS::Default) == 32 && TI.getLongWidth() == 32 &&
1097 TI.getIntWidth() == 32) {
1103 assert(TI.getCharWidth() == 8 && "Only support 8-bit char so far");
1104 Builder.defineMacro("__CHAR_BIT__", Twine(TI.getCharWidth()));
1106 Builder.defineMacro("__BOOL_WIDTH__", Twine(TI.getBoolWidth()));
1107 Builder.defineMacro("__SHRT_WIDTH__", Twine(TI.getShortWidth()));
1108 Builder.defineMacro("__INT_WIDTH__", Twine(TI.getIntWidth()));
1109 Builder.defineMacro("__LONG_WIDTH__", Twine(TI.getLongWidth()));
1110 Builder.defineMacro("__LLONG_WIDTH__", Twine(TI.getLongLongWidth()));
1112 size_t BitIntMaxWidth = TI.getMaxBitIntWidth();
1115 assert(BitIntMaxWidth >= TI.getLongLongWidth() &&
1119 DefineTypeSize("__SCHAR_MAX__", TargetInfo::SignedChar, TI, Builder);
1120 DefineTypeSize("__SHRT_MAX__", TargetInfo::SignedShort, TI, Builder);
1121 DefineTypeSize("__INT_MAX__", TargetInfo::SignedInt, TI, Builder);
1122 DefineTypeSize("__LONG_MAX__", TargetInfo::SignedLong, TI, Builder);
1123 DefineTypeSize("__LONG_LONG_MAX__", TargetInfo::SignedLongLong, TI, Builder);
1124 DefineTypeSizeAndWidth("__WCHAR", TI.getWCharType(), TI, Builder);
1125 DefineTypeSizeAndWidth("__WINT", TI.getWIntType(), TI, Builder);
1126 DefineTypeSizeAndWidth("__INTMAX", TI.getIntMaxType(), TI, Builder);
1127 DefineTypeSizeAndWidth("__SIZE", TI.getSizeType(), TI, Builder);
1129 DefineTypeSizeAndWidth("__UINTMAX", TI.getUIntMaxType(), TI, Builder);
1130 DefineTypeSizeAndWidth("__PTRDIFF", TI.getPtrDiffType(LangAS::Default), TI,
1132 DefineTypeSizeAndWidth("__INTPTR", TI.getIntPtrType(), TI, Builder);
1133 DefineTypeSizeAndWidth("__UINTPTR", TI.getUIntPtrType(), TI, Builder);
1135 DefineTypeSizeof("__SIZEOF_DOUBLE__", TI.getDoubleWidth(), TI, Builder);
1136 DefineTypeSizeof("__SIZEOF_FLOAT__", TI.getFloatWidth(), TI, Builder);
1137 DefineTypeSizeof("__SIZEOF_INT__", TI.getIntWidth(), TI, Builder);
1138 DefineTypeSizeof("__SIZEOF_LONG__", TI.getLongWidth(), TI, Builder);
1139 DefineTypeSizeof("__SIZEOF_LONG_DOUBLE__",TI.getLongDoubleWidth(),TI,Builder);
1140 DefineTypeSizeof("__SIZEOF_LONG_LONG__", TI.getLongLongWidth(), TI, Builder);
1141 DefineTypeSizeof("__SIZEOF_POINTER__", TI.getPointerWidth(LangAS::Default),
1142 TI, Builder);
1143 DefineTypeSizeof("__SIZEOF_SHORT__", TI.getShortWidth(), TI, Builder);
1145 TI.getTypeWidth(TI.getPtrDiffType(LangAS::Default)), TI,
1148 TI.getTypeWidth(TI.getSizeType()), TI, Builder);
1150 TI.getTypeWidth(TI.getWCharType()), TI, Builder);
1152 TI.getTypeWidth(TI.getWIntType()), TI, Builder);
1153 if (TI.hasInt128Type())
1154 DefineTypeSizeof("__SIZEOF_INT128__", 128, TI, Builder);
1156 DefineType("__INTMAX_TYPE__", TI.getIntMaxType(), Builder);
1157 DefineFmt(LangOpts, "__INTMAX", TI.getIntMaxType(), TI, Builder);
1159 TI.getTypeConstantSuffix(TI.getIntMaxType()));
1160 DefineType("__UINTMAX_TYPE__", TI.getUIntMaxType(), Builder);
1161 DefineFmt(LangOpts, "__UINTMAX", TI.getUIntMaxType(), TI, Builder);
1163 TI.getTypeConstantSuffix(TI.getUIntMaxType()));
1164 DefineType("__PTRDIFF_TYPE__", TI.getPtrDiffType(LangAS::Default), Builder);
1165 DefineFmt(LangOpts, "__PTRDIFF", TI.getPtrDiffType(LangAS::Default), TI,
1167 DefineType("__INTPTR_TYPE__", TI.getIntPtrType(), Builder);
1168 DefineFmt(LangOpts, "__INTPTR", TI.getIntPtrType(), TI, Builder);
1169 DefineType("__SIZE_TYPE__", TI.getSizeType(), Builder);
1170 DefineFmt(LangOpts, "__SIZE", TI.getSizeType(), TI, Builder);
1171 DefineType("__WCHAR_TYPE__", TI.getWCharType(), Builder);
1172 DefineType("__WINT_TYPE__", TI.getWIntType(), Builder);
1173 DefineTypeSizeAndWidth("__SIG_ATOMIC", TI.getSigAtomicType(), TI, Builder);
1175 DefineType("__CHAR8_TYPE__", TI.UnsignedChar, Builder);
1176 DefineType("__CHAR16_TYPE__", TI.getChar16Type(), Builder);
1177 DefineType("__CHAR32_TYPE__", TI.getChar32Type(), Builder);
1179 DefineType("__UINTPTR_TYPE__", TI.getUIntPtrType(), Builder);
1180 DefineFmt(LangOpts, "__UINTPTR", TI.getUIntPtrType(), TI, Builder);
1184 assert(TI.getTypeWidth(TI.getUIntPtrType()) ==
1185 TI.getTypeWidth(TI.getIntPtrType()) &&
1187 assert(TI.getTypeWidth(TI.getUIntMaxType()) ==
1188 TI.getTypeWidth(TI.getIntMaxType()) &&
1193 DefineFixedPointMacros(TI, Builder, "SFRACT", "HR", TI.getShortFractWidth(),
1194 TI.getShortFractScale(), /*Signed=*/true);
1195 DefineFixedPointMacros(TI, Builder, "USFRACT", "UHR",
1196 TI.getShortFractWidth(),
1197 TI.getUnsignedShortFractScale(), /*Signed=*/false);
1198 DefineFixedPointMacros(TI, Builder, "FRACT", "R", TI.getFractWidth(),
1199 TI.getFractScale(), /*Signed=*/true);
1200 DefineFixedPointMacros(TI, Builder, "UFRACT", "UR", TI.getFractWidth(),
1201 TI.getUnsignedFractScale(), /*Signed=*/false);
1202 DefineFixedPointMacros(TI, Builder, "LFRACT", "LR", TI.getLongFractWidth(),
1203 TI.getLongFractScale(), /*Signed=*/true);
1204 DefineFixedPointMacros(TI, Builder, "ULFRACT", "ULR",
1205 TI.getLongFractWidth(),
1206 TI.getUnsignedLongFractScale(), /*Signed=*/false);
1207 DefineFixedPointMacros(TI, Builder, "SACCUM", "HK", TI.getShortAccumWidth(),
1208 TI.getShortAccumScale(), /*Signed=*/true);
1209 DefineFixedPointMacros(TI, Builder, "USACCUM", "UHK",
1210 TI.getShortAccumWidth(),
1211 TI.getUnsignedShortAccumScale(), /*Signed=*/false);
1212 DefineFixedPointMacros(TI, Builder, "ACCUM", "K", TI.getAccumWidth(),
1213 TI.getAccumScale(), /*Signed=*/true);
1214 DefineFixedPointMacros(TI, Builder, "UACCUM", "UK", TI.getAccumWidth(),
1215 TI.getUnsignedAccumScale(), /*Signed=*/false);
1216 DefineFixedPointMacros(TI, Builder, "LACCUM", "LK", TI.getLongAccumWidth(),
1217 TI.getLongAccumScale(), /*Signed=*/true);
1218 DefineFixedPointMacros(TI, Builder, "ULACCUM", "ULK",
1219 TI.getLongAccumWidth(),
1220 TI.getUnsignedLongAccumScale(), /*Signed=*/false);
1222 Builder.defineMacro("__SACCUM_IBIT__", Twine(TI.getShortAccumIBits()));
1224 Twine(TI.getUnsignedShortAccumIBits()));
1225 Builder.defineMacro("__ACCUM_IBIT__", Twine(TI.getAccumIBits()));
1226 Builder.defineMacro("__UACCUM_IBIT__", Twine(TI.getUnsignedAccumIBits()));
1227 Builder.defineMacro("__LACCUM_IBIT__", Twine(TI.getLongAccumIBits()));
1229 Twine(TI.getUnsignedLongAccumIBits()));
1232 if (TI.hasFloat16Type())
1233 DefineFloatMacros(Builder, "FLT16", &TI.getHalfFormat(), "F16");
1234 DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F");
1235 DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), "");
1236 DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L");
1240 Twine((int)TI.getPointerWidth(LangAS::Default)));
1244 Twine(TI.getSuitableAlign() / TI.getCharWidth()) );
1249 if (!TargetInfo::isTypeSigned(TI.getWCharType()))
1252 if (!TargetInfo::isTypeSigned(TI.getWIntType()))
1256 DefineExactWidthIntType(LangOpts, TargetInfo::SignedChar, TI, Builder);
1258 if (TI.getShortWidth() > TI.getCharWidth())
1259 DefineExactWidthIntType(LangOpts, TargetInfo::SignedShort, TI, Builder);
1261 if (TI.getIntWidth() > TI.getShortWidth())
1262 DefineExactWidthIntType(LangOpts, TargetInfo::SignedInt, TI, Builder);
1264 if (TI.getLongWidth() > TI.getIntWidth())
1265 DefineExactWidthIntType(LangOpts, TargetInfo::SignedLong, TI, Builder);
1267 if (TI.getLongLongWidth() > TI.getLongWidth())
1268 DefineExactWidthIntType(LangOpts, TargetInfo::SignedLongLong, TI, Builder);
1270 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedChar, TI, Builder);
1271 DefineExactWidthIntTypeSize(TargetInfo::UnsignedChar, TI, Builder);
1272 DefineExactWidthIntTypeSize(TargetInfo::SignedChar, TI, Builder);
1274 if (TI.getShortWidth() > TI.getCharWidth()) {
1275 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedShort, TI, Builder);
1276 DefineExactWidthIntTypeSize(TargetInfo::UnsignedShort, TI, Builder);
1277 DefineExactWidthIntTypeSize(TargetInfo::SignedShort, TI, Builder);
1280 if (TI.getIntWidth() > TI.getShortWidth()) {
1281 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedInt, TI, Builder);
1282 DefineExactWidthIntTypeSize(TargetInfo::UnsignedInt, TI, Builder);
1283 DefineExactWidthIntTypeSize(TargetInfo::SignedInt, TI, Builder);
1286 if (TI.getLongWidth() > TI.getIntWidth()) {
1287 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedLong, TI, Builder);
1288 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLong, TI, Builder);
1289 DefineExactWidthIntTypeSize(TargetInfo::SignedLong, TI, Builder);
1292 if (TI.getLongLongWidth() > TI.getLongWidth()) {
1293 DefineExactWidthIntType(LangOpts, TargetInfo::UnsignedLongLong, TI,
1295 DefineExactWidthIntTypeSize(TargetInfo::UnsignedLongLong, TI, Builder);
1296 DefineExactWidthIntTypeSize(TargetInfo::SignedLongLong, TI, Builder);
1299 DefineLeastWidthIntType(LangOpts, 8, true, TI, Builder);
1300 DefineLeastWidthIntType(LangOpts, 8, false, TI, Builder);
1301 DefineLeastWidthIntType(LangOpts, 16, true, TI, Builder);
1302 DefineLeastWidthIntType(LangOpts, 16, false, TI, Builder);
1303 DefineLeastWidthIntType(LangOpts, 32, true, TI, Builder);
1304 DefineLeastWidthIntType(LangOpts, 32, false, TI, Builder);
1305 DefineLeastWidthIntType(LangOpts, 64, true, TI, Builder);
1306 DefineLeastWidthIntType(LangOpts, 64, false, TI, Builder);
1308 DefineFastIntType(LangOpts, 8, true, TI, Builder);
1309 DefineFastIntType(LangOpts, 8, false, TI, Builder);
1310 DefineFastIntType(LangOpts, 16, true, TI, Builder);
1311 DefineFastIntType(LangOpts, 16, false, TI, Builder);
1312 DefineFastIntType(LangOpts, 32, true, TI, Builder);
1313 DefineFastIntType(LangOpts, 32, false, TI, Builder);
1314 DefineFastIntType(LangOpts, 64, true, TI, Builder);
1315 DefineFastIntType(LangOpts, 64, false, TI, Builder);
1317 Builder.defineMacro("__USER_LABEL_PREFIX__", TI.getUserLabelPrefix());
1340 auto [Destructive, Constructive] = TI.hardwareInterferenceSizes();
1352 getLockFreeValue(TI.get##Type##Width(), TI));
1368 getLockFreeValue(TI.getPointerWidth(LangAS::Default), TI));
1421 if (TI.getTriple().isOSDarwin()) {
1429 if (TI.getTriple().isOSDarwin() && TI.getTriple().isSimulatorEnvironment())
1484 InitializeOpenCLFeatureTestMacros(TI, LangOpts, Builder);
1486 if (TI.getTriple().isSPIR() || TI.getTriple().isSPIRV())
1490 if (TI.hasInt128Type() && LangOpts.CPlusPlus && LangOpts.GNUMode) {
1499 if (TI.getTriple().isOSBinFormatELF())
1504 const llvm::Triple &Triple = TI.getTriple();
1512 TI.getTargetDefines(LangOpts, Builder);