[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-03-05 Thread Leonard Chan via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rC355462: [Fixed Point Arithmetic] Fixed Point and Integer Conversions (authored by leonardchan, committed by ). Changed pr

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-03-05 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 189422. leonardchan marked 11 inline comments as done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56900/new/ https://reviews.llvm.org/D56900 Files: clang/include/clang/AST/OperationKinds.def clang/inc

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-03-05 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:45 + +short _Accum sa_const9 = 2u; // DEFAULT-DAG: @sa_const9 = {{.*}}global i16 256, align 2 +unsigned short _Accum usa_const3 = 2; bjope wrote: > Perhaps we should ver

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-03-01 Thread Bjorn Pettersson via Phabricator via cfe-commits
bjope added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:45 + +short _Accum sa_const9 = 2u; // DEFAULT-DAG: @sa_const9 = {{.*}}global i16 256, align 2 +unsigned short _Accum usa_const3 = 2; Perhaps we should verify that we do not me

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-27 Thread Bjorn Pettersson via Phabricator via cfe-commits
bjope added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1223 if (SrcType->isFixedPointType()) { -if (DstType->isFixedPointType()) { - return EmitFixedPointConversion(Src, SrcType, DstType, Loc); -} else if (DstType->isBooleanType()) { +if (

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. A couple tweaks, but otherwise LGTM. Comment at: clang/include/clang/AST/OperationKinds.def:203 +/// CK_FixedPointToIntegral - Fixed point to an integral. +///(int) 2.0k This is super-picky, but please either just say "integral"

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-26 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. @rjmccall @ebevhan @bjope *ping* any other comments on this patch? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56900/new/ https://reviews.llvm.org/D56900 ___ cfe-commits mailing list cf

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-20 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:437 + // DEFAULT-NEXT: [[RES:%[a-z0-9]+]] = trunc i39 [[SATMIN]] to i16 + // DEFAULT-NEXT: store i16 [[RES]], i16* %sat_sa, align 2 + -

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-20 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:437 + // DEFAULT-NEXT: [[RES:%[a-z0-9]+]] = trunc i39 [[SATMIN]] to i16 + // DEFAULT-NEXT: store i16 [[RES]], i16* %sat_sa, align 2 + ebevhan wrote: > leonardchan wrote

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-20 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 187706. leonardchan marked an inline comment as done. Herald added a subscriber: jdoerfert. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56900/new/ https://reviews.llvm.org/D56900 Files: clang/include/clang/AST/Operatio

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:437 + // DEFAULT-NEXT: [[RES:%[a-z0-9]+]] = trunc i39 [[SATMIN]] to i16 + // DEFAULT-NEXT: store i16 [[RES]], i16* %sat_sa, align 2 + leonardchan wrote: > leonardchan wrote

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-31 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:437 + // DEFAULT-NEXT: [[RES:%[a-z0-9]+]] = trunc i39 [[SATMIN]] to i16 + // DEFAULT-NEXT: store i16 [[RES]], i16* %sat_sa, align 2 + -

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-25 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan marked an inline comment as done. leonardchan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:437 + // DEFAULT-NEXT: [[RES:%[a-z0-9]+]] = trunc i39 [[SATMIN]] to i16 + // DEFAULT-NEXT: store i16 [[RES]], i16* %sat_sa, align 2 + -

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-25 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:437 + // DEFAULT-NEXT: [[RES:%[a-z0-9]+]] = trunc i39 [[SATMIN]] to i16 + // DEFAULT-NEXT: store i16 [[RES]], i16* %sat_sa, align 2 + leonardchan wrote: > ebevhan wrote: >

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-24 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. Oh I forgot to submit the comments. Comment at: clang/lib/AST/ExprConstant.cpp:9825 +if (Result.isSigned() && !DstSigned) { + Overflow = Result < 0 || Result.ugt(DstMax); +} else if (Result.isUnsigned() && DstSigned) {

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-22 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 182945. leonardchan marked 6 inline comments as done. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56900/new/ https://reviews.llvm.org/D56900 Files: clang/include/clang/AST/OperationKinds.def clang/include/clang/Basic

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-21 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9825 +if (Result.isSigned() && !DstSigned) { + Overflow = Result < 0 || Result.ugt(DstMax); +} else if (Result.isUnsigned() && DstSigned) { leonardchan wrote: > ebevhan wrote:

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-20 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9825 +if (Result.isSigned() && !DstSigned) { + Overflow = Result < 0 || Result.ugt(DstMax); +} else if (Result.isUnsigned() && DstSigned) { ebevhan wrote: > The `Result < 0

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-20 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 182717. leonardchan marked 6 inline comments as done. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56900/new/ https://reviews.llvm.org/D56900 Files: clang/include/clang/AST/OperationKinds.def clang/include/clang/Basic

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9825 +if (Result.isSigned() && !DstSigned) { + Overflow = Result < 0 || Result.ugt(DstMax); +} else if (Result.isUnsigned() && DstSigned) { The `Result < 0` is more clearly exp

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-17 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9839 +return Success(Result, E); + } + Can most of this reasonably be a method on `APFixedPoint`? (And likewise for `CK_IntegralToFixedPoint`.) If nothing else, I suspect you are g

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan updated this revision to Diff 182456. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56900/new/ https://reviews.llvm.org/D56900 Files: clang/include/clang/AST/OperationKinds.def clang/include/clang/Basic/FixedPoint.h clang/lib/AST/Expr.cpp clang

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-01-17 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan created this revision. leonardchan added reviewers: rjmccall, ebevhan, bjope. leonardchan added a project: clang. This patch includes the necessary code for converting between a fixed point type and integer. This also includes constant expression evaluation for conversions with these