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);
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
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
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
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
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
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
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
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:
-
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
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
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
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
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
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
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) ==
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
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
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
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
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:
> > >
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
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:
>
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
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
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
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
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
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
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
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:
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:
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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;
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
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 `>>`.
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
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
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;
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
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
801 - 863 of 863 matches
Mail list logo