[PATCH] D46987: [Fixed Point Arithmetic] Validation Test for Saturated Subtraction on Signed _Fracts

Leonard Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 16 16:03:32 PDT 2018


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

This patch includes the logic for subtraction on saturated _Fract types and a test for thm.

- Also fixed incorrect minimum value for each _Fract type
- Getters for each fixed point min and max value for a given type
- Correction when casting from a fixed point to a float. If the fixed point data and sign bits do not take up the whole width of the integer (ie. has padding), we will need to either zero out the padding or extend the sign into the padding if it is negative to ensure the correct floating point value is produced after casting.

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


Repository:
  rC Clang

https://reviews.llvm.org/D46987

Files:
  include/clang/AST/Type.h
  include/clang/Basic/FixedPoint.h.in
  lib/AST/Type.cpp
  lib/CodeGen/CGExprScalar.cpp
  test/Frontend/fixed_point_all_builtin_operations.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46987.147209.patch
Type: text/x-patch
Size: 13690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180516/9b8463e7/attachment.bin>


More information about the cfe-commits mailing list