[PATCH] D53738: [Fixed Point Arithmetic] Fixed Point Addition

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 25 16:09:01 PDT 2018


leonardchan created this revision.
leonardchan added reviewers: ebevhan, bjope, rjmccall.
leonardchan added a project: clang.

This patch covers addition between fixed point types and other fixed point types or integers, using the conversion rules  described in 4.1.4 of N1169.

Usual arithmetic rules do not apply to binary operations when one of the operands is a fixed point type, and the result of the operation must be calculated with the full precision of the operands, so we should not perform any casting to a common type.

This patch does not include constant expression evaluation for addition of fixed point types. That will be addressed in another patch since I think this one is already big enough.


Repository:
  rC Clang

https://reviews.llvm.org/D53738

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/test/Frontend/fixed_point_add.c
  clang/test/Frontend/fixed_point_add_ast.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53738.171212.patch
Type: text/x-patch
Size: 44380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181025/dbcce946/attachment-0001.bin>


More information about the cfe-commits mailing list