[PATCH] D46915: [Fixed Point Arithmetic] Set Fixed Point Precision Bits and Create Fixed Point Literals

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 6 20:10:41 PDT 2018


leonardchan updated this revision to Diff 150248.
leonardchan marked 20 inline comments as done.
leonardchan added a comment.

- Moved definition of the fractional/integral bits to TargetInfo. Checks are also performed to make sure any target specific definitions of the F/IBits follow the restrictions set in clause 6.2.6.3 in N1169.
- Added flag `-fsame-fbits` to force the number of fractional bits in unsigned types to be the same as those of their their corresponding signed types. The default values for all fractional bits is of signed fixed point types are one less than the default values for their unsigned counterparts.
- Implemented custom parsing for fixed point literals and added tests for them. Both decimal and hexadecimal exponentiation are supported.
- I do not have many examples involving assignment to saturated types because this patch does not include conversions yet between fixed point types. This will be in a future patch. The same goes for testing the minimum values for each type because I have not yet implemented folding on binary expressions involving fixed point types.


Repository:
  rC Clang

https://reviews.llvm.org/D46915

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/Expr.h
  include/clang/AST/OperationKinds.def
  include/clang/AST/RecursiveASTVisitor.h
  include/clang/AST/Type.h
  include/clang/Basic/DiagnosticCommonKinds.td
  include/clang/Basic/LangOptions.def
  include/clang/Basic/StmtNodes.td
  include/clang/Basic/TargetInfo.h
  include/clang/Driver/Options.td
  include/clang/Lex/LiteralSupport.h
  lib/AST/ASTContext.cpp
  lib/AST/ASTDumper.cpp
  lib/AST/Expr.cpp
  lib/AST/ExprClassification.cpp
  lib/AST/ExprConstant.cpp
  lib/AST/ItaniumMangle.cpp
  lib/AST/StmtPrinter.cpp
  lib/AST/StmtProfile.cpp
  lib/AST/Type.cpp
  lib/Basic/TargetInfo.cpp
  lib/Basic/Targets.cpp
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CGExprAgg.cpp
  lib/CodeGen/CGExprComplex.cpp
  lib/CodeGen/CGExprConstant.cpp
  lib/CodeGen/CGExprScalar.cpp
  lib/Driver/ToolChains/Clang.cpp
  lib/Edit/RewriteObjCFoundationAPI.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Index/USRGeneration.cpp
  lib/Lex/LiteralSupport.cpp
  lib/Sema/Sema.cpp
  lib/Sema/SemaExceptionSpec.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/TreeTransform.h
  lib/Serialization/ASTReaderStmt.cpp
  lib/Serialization/ASTWriterStmt.cpp
  lib/StaticAnalyzer/Core/ExprEngine.cpp
  lib/StaticAnalyzer/Core/ExprEngineC.cpp
  test/Frontend/fixed_point.c
  test/Frontend/fixed_point_declarations.c
  test/Frontend/fixed_point_errors.c
  test/Frontend/fixed_point_same_fbits.c
  test/Frontend/fixed_point_validation.c
  tools/libclang/CXCursor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46915.150248.patch
Type: text/x-patch
Size: 88284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180607/70665f85/attachment-0001.bin>


More information about the cfe-commits mailing list