[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/Sema/DeclSpec.cpp:1123 +if (!(TypeSpecType == TST_accum || TypeSpecType == TST_fract)) { + S.Diag(TSSatLoc, diag::err_invalid_saturation_spec) + << getSpecifierName((TST)TypeSpecType, Policy);

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/Basic/TargetInfo.cpp:45 + AccumWidth = AccumAlign = 32; + LongAccumWidth = LongAccumAlign = 64; SuitableAlign = 64; leonardchan wrote: > ebevhan wrote: > > leonardchan wrote: > > > rsmith wrote: > > > > jfb

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TokenKinds.def:393 +// ISO/IEC JTC1 SC22 WG14 N1169 Extension +KEYWORD(_Accum , KEYALL) + rsmith wrote: > leonardchan wrote: > > jfb wrote: > > > ebevhan wrote: > > > > I

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149305. leonardchan marked 6 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149169. leonardchan added a comment. Forgot to include tests for the `_Fract` and `_Sat` keywords in c++ usage Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TokenKinds.def:393 +// ISO/IEC JTC1 SC22 WG14 N1169 Extension +KEYWORD(_Accum , KEYALL) + jfb wrote: > ebevhan wrote: > > I believe that having KEYALL will enable the keyword

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-30 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 149162. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/LangOptions.def

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-29 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Hi all, I think I've addressed all comments on this patch and will be committing tomorrow morning unless anyone has any more comments they'd like to bring up. Repository: rC Clang https://reviews.llvm.org/D46084

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-29 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: lib/Sema/SemaType.cpp:1430 } else { - switch (DS.getTypeSpecWidth()) { -case DeclSpec::TSW_short: - Result = Context.UnsignedShortAccumTy; - break; -case DeclSpec::TSW_unspecified: -

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-29 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148918. leonardchan marked 4 inline comments as done. Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/AST/Type.h

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-25 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked 2 inline comments as done. leonardchan added inline comments. Comment at: include/clang/Driver/Options.td:882 +def enable_fixed_point : Flag<["-", "--"], "enable-fixed-point">, Group, + Flags<[CC1Option]>, HelpText<"Enable fixed

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-25 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148637. leonardchan added a comment. Changed flag names Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/TargetInfo.h:382 +// enough bits to fit the minumum. +if (getIntWidth() < MinSignedAccumDataBits) + return getLongWidth(); ebevhan wrote: > I'm not sure I agree with this

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148506. leonardchan added a comment. Re-added individual getters/members for _Accum types Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In https://reviews.llvm.org/D46084#374, @jfb wrote: > Can you also add a test for `_Bool _Accum`. > > Also, `-enable-fixed-point -x c++` failing. . Done. Also the failing c++ case is under `test/Frontend/fixed_point_errors.cpp` Repository: rC Clang

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148481. leonardchan marked 2 inline comments as done. leonardchan added a comment. - Added test case for `_Bool _Accum` - Getters for the `_Accum` bit widths return values for their corresponding integral types (ie. `sizeof(short _Accum) ==

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148452. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/LangOptions.def

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked 6 inline comments as done. leonardchan added inline comments. Comment at: lib/CodeGen/ItaniumCXXABI.cpp:2684 // Types added here must also be added to EmitFundamentalRTTIDescriptors. switch (Ty->getKind()) { rsmith wrote: > Note this

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148445. leonardchan added a comment. - Reverted changes involving name mangling since we will only support c++ for now. Will concurrently raise an issue on https://github.com/itanium-cxx-abi/cxx-abi/ to get characters for name mangling. - Added a flag

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-23 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. After further discussion, we think the best approach for now would be only supporting fixed point types in C, then go back and support C++ once there is a standardized way for mangling the fixed point types under itanium. Repository: rC Clang

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-23 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/DiagnosticCommonKinds.td:172 +def err_fixed_point_only_allowed_in_c : Error< + "Fixed point types are only allowed in C">; leonardchan wrote: > leonardchan wrote: > > rsmith wrote: > > >

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-23 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: include/clang/Basic/DiagnosticCommonKinds.td:172 +def err_fixed_point_only_allowed_in_c : Error< + "Fixed point types are only allowed in C">; leonardchan wrote: > rsmith wrote: > > Diagnostics should not be

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-23 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a subscriber: sammccall. leonardchan added inline comments. Comment at: include/clang/Basic/DiagnosticCommonKinds.td:172 +def err_fixed_point_only_allowed_in_c : Error< + "Fixed point types are only allowed in C">; rsmith wrote: >

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148148. leonardchan added a comment. pulled changes from source tree Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148121. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/Specifiers.h

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148117. leonardchan marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D46986: [Fixed Point Arithmetic] Validation Test for Fixed Point Binary Operations and Saturated Addition

2018-05-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148116. leonardchan added a comment. - formatting - Running `lli` threw a segfault in the test, though this was probably because it was using whatever hist jit was available to optimize the code instead of just interpreting it. Forcing it just interpret

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked 2 inline comments as done. leonardchan added inline comments. Comment at: lib/Index/USRGeneration.cpp:731 + + if (c == '~') { +switch (BT->getKind()) { jakehehrlich wrote: > You can make the 'c' a Twine instead. That will let you

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 148025. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/Specifiers.h

[PATCH] D46979: [Fixed Point Arithmetic] Test for Conversion Between Valid Builtin Types

2018-05-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147902. leonardchan added a comment. formatting Repository: rC Clang https://reviews.llvm.org/D46979 Files: include/clang/AST/OperationKinds.def lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CGExprAgg.cpp

[PATCH] D46963: [Fixed Point Arithmetic] Test for All Builtin Operations

2018-05-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147888. leonardchan added a comment. formatting Repository: rC Clang https://reviews.llvm.org/D46963 Files: lib/AST/ASTContext.cpp lib/CodeGen/CGExprScalar.cpp test/Frontend/fixed_point_all_builtin_operations.c Index:

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

2018-05-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147883. leonardchan added a comment. formatting 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 Index:

[PATCH] D46927: [Fixed Point Arithmetic] Augmented Assignment for Fixed Point Types

2018-05-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147882. leonardchan added a comment. formatting Repository: rC Clang https://reviews.llvm.org/D46927 Files: include/clang/AST/Type.h lib/AST/Type.cpp lib/CodeGen/CGExprScalar.cpp lib/Sema/SemaExpr.cpp test/Frontend/fixed_point_validation.c

[PATCH] D46926: [Fixed Point Arithmetic] Conversion between Fixed Point and Floating Point Numbers

2018-05-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147881. leonardchan added a comment. formatting Repository: rC Clang https://reviews.llvm.org/D46926 Files: include/clang/AST/OperationKinds.def include/clang/Basic/DiagnosticSemaKinds.td lib/AST/Expr.cpp lib/AST/ExprConstant.cpp

[PATCH] D46925: [Fixed Point Arithmetic] Remaining Binary Operations on Primary Fixed Point Types

2018-05-21 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147880. leonardchan added a comment. formatting Repository: rC Clang https://reviews.llvm.org/D46925 Files: include/clang/AST/ASTContext.h include/clang/AST/OperationKinds.def include/clang/AST/Type.h lib/AST/ASTContext.cpp

[PATCH] D46917: [Fixed Point Arithmetic] Comparison and Unary Operations for Fixed Point Types

2018-05-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147631. leonardchan added a comment. formatting Repository: rC Clang https://reviews.llvm.org/D46917 Files: lib/CodeGen/CGExprScalar.cpp lib/Sema/SemaExpr.cpp test/Frontend/fixed_point_declarations.c test/Frontend/fixed_point_validation.c

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

2018-05-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147595. leonardchan added a comment. formatting Repository: rC Clang https://reviews.llvm.org/D46915 Files: CMakeLists.txt cmake/modules/InitFixedPointBits.cmake include/clang/AST/Expr.h include/clang/AST/OperationKinds.def

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147568. Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/Specifiers.h

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147566. Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/Specifiers.h

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147560. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/Specifiers.h

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147549. Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/Specifiers.h

[PATCH] D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents

2018-05-18 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147541. leonardchan added a comment. Updated formatting Repository: rC Clang https://reviews.llvm.org/D46911 Files: include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147406. leonardchan marked an inline comment as done. leonardchan added a comment. Undid git-clang-formatting on ASTBitcodes.h Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked 2 inline comments as done. leonardchan added inline comments. Comment at: lib/Index/USRGeneration.cpp:691 +case BuiltinType::ULongAccum: + llvm_unreachable("No USR name mangling for fixed point types."); case BuiltinType::Float16:

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147400. leonardchan added a comment. Added break. We still assign `Result` since it cannot be null at the end of the switch stmt, though the value doesn't matter. Added character `~` to indicate fixed point type followed by string detailing the type. I

[PATCH] D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type

2018-05-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 147386. leonardchan added a comment. Ran git-clang-tidy on all affected files Repository: rC Clang https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D47030: [Fixed Point Arithmetic] Checks for Precision Macros

2018-05-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. Herald added a subscriber: mgorny. This patch includes checks that the precision macros used for the fixed point fractional and integral bits meet the requirements

[PATCH] D47017: [Fixed Point Arithmetic] Validation Test for Saturated Shift Left, Saturated Unsigned _Fract Types, and Fix for Saturated Unsigned Addition

2018-05-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch includes changes for the shift left operator involving saturated fixed point types. For unsigned shifting, overflow occurs if the number of bits we

[PATCH] D47016: [Fixed Point Arithmetic] Validation Test for Saturated Division and Comparison Fix

2018-05-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch includes changes for division on saturated fixed point types. Overflow occurs when the resulting value cannot fit into the number of data bits for the

[PATCH] D46990: [Fixed Point Arithmetic] Validation Test for Saturated Multiplication

2018-05-16 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch contains changes for multiplication on saturated _Fract types. Since we already upcast the underlying integer for the fixed point type, we can do a

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

2018-05-16 Thread Leonard Chan via Phabricator via cfe-commits
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

[PATCH] D46986: [Fixed Point Arithmetic] Validation Test for Fixed Point Binary Operations and Saturated Addition

2018-05-16 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch contains tests for validating the logic behind each builtin operation on fixed point types and tests on addition between saturated _Fract types. - More

[PATCH] D46979: [Fixed Point Arithmetic] Test for Conversion Between Valid Builtin Types

2018-05-16 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch contains changes and a test for checking that fixed point types can be converted between all other valid types. Fixed point types can be converted

[PATCH] D46963: [Fixed Point Arithmetic] Test for All Builtin Operations

2018-05-16 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch includes a test for checking that all supported builtin operations can be syntactically declared with fixed point types. Tests for asserting the

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

2018-05-16 Thread Leonard Chan via Phabricator via cfe-commits
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

[PATCH] D46927: Augmented Assignment for Fixed Point Types

2018-05-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch contains the changes and tests for augmented assignments for primary fixed point types. s_accum = 7.5hk; s_accum2 = 2.0hk; s_accum += s_accum2;

[PATCH] D46926: Conversion between Fixed Point and Floating Point Numbers

2018-05-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch has the implementation and tests for converting between fixed point and floating point numbers. The conversion process is simply dividing the fixed

[PATCH] D46925: Remaining Binary Operations on Primary Fixed Point Types

2018-05-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. This patch implements the remaining arithmetic and logical operations on the primary fixed point types. The operations are `+`, `-`, `*`, `/`, `<<`, and `>>`.

[PATCH] D46917: Comparison and Unary Operations for Fixed Point Types

2018-05-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr. leonardchan added a project: clang. This patch contains logic and tests for different unary and comparison operations on fixed point types, and casting between integers and fixed point types. The operations are

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

2018-05-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr, jakehehrlich. leonardchan added a project: clang. Herald added a subscriber: mgorny. This diff includes the logic for setting the precision bits for each primary fixed point type when building clang and logic for

[PATCH] D46911: Addition of the remaining fixed point types and their saturated equivalents

2018-05-15 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added a project: clang. This diff includes changes for the remaining _Fract and _Sat fixed point types. signed short _Fract s_short_fract; signed _Fract s_fract; signed long _Fract s_long_fract; unsigned short _Fract u_short_fract;

[PATCH] D46084: Addition of the Fixed Point _Accum type

2018-05-09 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 145993. leonardchan added a comment. - Restrict usage of fixed point types only to C https://reviews.llvm.org/D46084 Files: include/clang-c/Index.h include/clang/AST/ASTContext.h include/clang/AST/BuiltinTypes.def

[PATCH] D46084: Addition of the Fixed Point _Accum type

2018-04-25 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: phosek, mcgrathr. leonardchan added a project: clang. This diff includes changes for supporting the following types. // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum

<    4   5   6   7   8   9