================ @@ -1097,6 +1150,47 @@ static void InitializePredefinedMacros(const TargetInfo &TI, TI.getTypeWidth(TI.getIntMaxType()) && "uintmax_t and intmax_t have different widths?"); + if (LangOpts.FixedPoint) { + // Each unsigned type has the same width as their signed type. + DefineFixedPointMacros(TI, Builder, "SFRACT", "hr", TI.getShortFractWidth(), + TI.getShortFractScale(), /*Signed=*/true); + DefineFixedPointMacros(TI, Builder, "USFRACT", "uhr", + TI.getShortFractWidth(), + TI.getUnsignedShortFractScale(), /*Signed=*/false); + DefineFixedPointMacros(TI, Builder, "FRACT", "r", TI.getFractWidth(), + TI.getFractScale(), /*Signed=*/true); + DefineFixedPointMacros(TI, Builder, "UFRACT", "ur", TI.getFractWidth(), + TI.getUnsignedFractScale(), /*Signed=*/false); + DefineFixedPointMacros(TI, Builder, "LFRACT", "lr", TI.getLongFractWidth(), ---------------- AaronBallman wrote:
Slight preference for using `L` instead of `l` because of font problems where the `l` may look like a `1`. Might be worth making them use the uppercase suffix consistently. https://github.com/llvm/llvm-project/pull/81207 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits