[PATCH] D46960: [Fixed Point Arithmetic] Predefined Precision Macros

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 16 09:54:06 PDT 2018


leonardchan created this revision.
leonardchan added reviewers: phosek, mcgrathr, jakehehrlich.
leonardchan added a project: clang.

This patch contains the addition of the precision macros for integral and fractional bits according to clause 7.18a.3 of http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf. The macros are integer constants and added as predefined macros.

  // Fractional bits of _Accum types
  __SACCUM_FBIT__
  __ACCUM_FBIT__
  __LACCUM_FBIT__
  __USACCUM_FBIT__
  __UACCUM_FBIT__
  __ULACCUM_FBIT__
  
  // Fractional bits of _Fract types
  __SFRACT_FBIT__
  __FRACT_FBIT__
  __LFRACT_FBIT__
  __USFRACT_FBIT__
  __UFRACT_FBIT__
  __ULFRACT_FBIT__
  
  // Integral bits of _Accum types
  __SACCUM_IBIT__
  __ACCUM_IBIT__
  __LACCUM_IBIT__
  __USACCUM_IBIT__
  __UACCUM_IBIT__
  __ULACCUM_IBIT__

This is a child of https://reviews.llvm.org/D46927


Repository:
  rC Clang

https://reviews.llvm.org/D46960

Files:
  include/clang/Lex/Preprocessor.h
  lib/Lex/PPMacroExpansion.cpp
  test/Frontend/fixed_point_builtin_macros.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46960.147116.patch
Type: text/x-patch
Size: 7980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180516/d7d64ae8/attachment.bin>


More information about the cfe-commits mailing list