[PATCH] D73257: [AST] Compress the FixedPointSemantics type better.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: rjmccall, leonardchan, bjope. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D73257 Files: clang/include/clang/Basic/FixedPoint.h Index: clang/includ

[PATCH] D73257: [AST] Compress the FixedPointSemantics type better.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239796. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73257/new/ https://reviews.llvm.org/D73257 Files: clang/include/clang/Basic/FixedPoint.h Index: clang/include/clang/B

[PATCH] D73182: [CodeGen] Emit IR for fixed-point multiplication and division.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239793. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73182/new/ https://reviews.llvm.org/D73182 Files: clang/lib/CodeGen/CGExprScalar.cpp clang/test/Frontend/fixed_point_

[PATCH] D73184: [CodeGen] Emit IR for compound assignment with fixed-point operands.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239795. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73184/new/ https://reviews.llvm.org/D73184 Files: clang/lib/CodeGen/CGExprScalar.cpp clang/lib/Sema/SemaExpr.cpp cl

[PATCH] D73187: [AST] Add fixed-point division constant evaluation.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239798. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73187/new/ https://reviews.llvm.org/D73187 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/AST/ExprConstant.c

[PATCH] D73183: [CodeGen] Emit IR for fixed-point unary operators.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239794. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73183/new/ https://reviews.llvm.org/D73183 Files: clang/lib/CodeGen/CGExprScalar.cpp clang/test/Frontend/fixed_point_

[PATCH] D73186: [AST] Add fixed-point multiplication constant evaluation.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239797. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73186/new/ https://reviews.llvm.org/D73186 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/AST/ExprConstant.c

[PATCH] D73188: [AST] Improve overflow diagnostics for fixed-point constant evaluation.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239799. ebevhan added a comment. Added tests for saturating types. Changed the warning group name for consistency. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73188/new/ https://reviews.llvm.org/D73188 File

[PATCH] D73189: [AST] Fix certain consteval assignment and comma operator issues with fixed-point types.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 239800. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73189/new/ https://reviews.llvm.org/D73189 Files: clang/lib/AST/ExprConstant.cpp clang/test/Frontend/fixed_point_cras

[PATCH] D73186: [AST] Add fixed-point multiplication constant evaluation.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Basic/FixedPoint.cpp:242 + } else +Overflowed = Result < Min || Result > Max; + rjmccall wrote: > If the maximum expressible value is *k*, and the fully-precise multiplication > yields *k+e* for some epsi

[PATCH] D73186: [AST] Add fixed-point multiplication constant evaluation.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Basic/FixedPoint.cpp:242 + } else +Overflowed = Result < Min || Result > Max; + ebevhan wrote: > rjmccall wrote: > > If the maximum expressible value is *k*, and the fully-precise > > multiplication yield

[PATCH] D73186: [AST] Add fixed-point multiplication constant evaluation.

2020-01-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Basic/FixedPoint.cpp:242 + } else +Overflowed = Result < Min || Result > Max; + rjmccall wrote: > ebevhan wrote: > > ebevhan wrote: > > > rjmccall wrote: > > > > If the maximum expressible value is *k*, an

[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

2023-05-21 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D58346#4359291 , @jhuber6 wrote: > should C++ really be limited by OpenCL here? It probably shouldn't. There's many places in the codebase where OpenCL flags restrict generic address space behavior. I have a patch at D62574 <

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. What would be the semantics of such an operation if the address spaces are disjoint? Or, if the underlying pointer widths aren't the same? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151087/new/ https://reviews.llvm.org/

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4360606 , @jhuber6 wrote: > In D151087#4360577 , @ebevhan wrote: > >> What would be the semantics of such an operation if the address spaces are >> disjoint? Or, if the underly

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4360743 , @jhuber6 wrote: > The problem is we don't have `addrspace_cast` in freestanding C++, so as it > stands we currently have no way to perform this operation in C++ which is > preventing me from implementing thi

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4360859 , @jhuber6 wrote: > You can have address spaced in freestanding C++, they just need to be > assigned according to the backens, e.g. https://godbolt.org/z/ahazae6Ta. And > I don't think that's a desirable solut

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4361263 , @jhuber6 wrote: > I'd rather have an operation whose semantics are a little dangerous than > something that doesn't work at all. As it stands we need to use C-style casts > for this and I don't think there's

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4362059 , @aaron.ballman wrote: > Based on all this, I think we should go with `__addrspace_cast` as a named > cast and not allow the conversion through `reinterpret_cast` unless going > to/from a `[u]intptr_t`. I t

<    1   2   3   4