[all-commits] [llvm/llvm-project] 86797f: Add BITINT_MAXWIDTH support

Aaron Ballman via All-commits all-commits at lists.llvm.org
Fri Jan 28 12:04:47 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 86797fdb6f51d32f285e48b6d3e0fc5b8b852734
      https://github.com/llvm/llvm-project/commit/86797fdb6f51d32f285e48b6d3e0fc5b8b852734
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2022-01-28 (Fri, 28 Jan 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/TargetInfo.h
    M clang/lib/Frontend/InitPreprocessor.cpp
    M clang/lib/Headers/limits.h
    M clang/lib/Sema/SemaType.cpp
    M clang/test/CodeGen/ext-int-cc.c
    M clang/test/CodeGen/ext-int.c
    M clang/test/CodeGenCXX/ext-int.cpp
    M clang/test/Headers/limits.cpp
    M clang/test/Preprocessor/init-aarch64.c
    M clang/test/Preprocessor/init.c
    M clang/test/Sema/builtins-overflow.c
    M clang/test/SemaCXX/ext-int.cpp

  Log Message:
  -----------
  Add BITINT_MAXWIDTH support

Part of the _BitInt feature in C2x
(http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2763.pdf) is a new
macro in limits.h named BITINT_MAXWIDTH that can be used to determine
the maximum width of a bit-precise integer type. This macro must expand
to a value that is at least as large as ULLONG_WIDTH.

This adds an implementation-defined macro named __BITINT_MAXWIDTH__ to
specify that value, which is used by limits.h for the standard macro.

This also limits the maximum bit width to 128 bits because backends do
not currently support all mathematical operations (such as division) on
wider types yet. This maximum is expected to be increased in the future.




More information about the All-commits mailing list