[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-08-24 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan abandoned this revision. ebevhan added a comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82663/new/ https://reviews.llvm.org/D82663 ___ cfe-commits mailing list

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-16 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2153834 , @rjmccall wrote: > I don't understand. The problem statement as I understood it is that using > unsigned intrinsics to do unsigned-with-padding operations is leading to poor > code-gen, so you want to start

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-15 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D82663#2153176 , @ebevhan wrote: > In D82663#2144551 , @rjmccall wrote: > > > In D82663#2144219 , @ebevhan wrote: > > > > > In D82663#2142426

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-15 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2144551 , @rjmccall wrote: > In D82663#2144219 , @ebevhan wrote: > > > In D82663#2142426 , @rjmccall > > wrote: > > > > > Would it be

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-10 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D82663#2144219 , @ebevhan wrote: > In D82663#2142426 , @rjmccall wrote: > > > Would it be sensible to use a technical design more like what the matrix > > folks are doing, where LLVM

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-10 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2142426 , @rjmccall wrote: > Would it be sensible to use a technical design more like what the matrix > folks are doing, where LLVM provides a small interface for emitting > operations with various semantics?

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Would it be sensible to use a technical design more like what the matrix folks are doing, where LLVM provides a small interface for emitting operations with various semantics? FixedPointSemantics would move to that header, and Clang would just call into it. That way

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-09 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. > It wouldn't just be restricted to fixed-point intrinsics, though. It would > have to be added to intrinsics like uadd.sat and usub.sat as well, which > aren't really tied to fixed-point at all. Oh wait, sorry. I think I'm starting to understand now. You're saying

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-09 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2140507 , @leonardchan wrote: > In D82663#2130355 , @ebevhan wrote: > > > Well, it's not so much as adding the bit, but adding the information that > > the bit exists. That means

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-08 Thread Leonard Chan via Phabricator via cfe-commits
leonardchan added a comment. In D82663#2130355 , @ebevhan wrote: > Well, it's not so much as adding the bit, but adding the information that the > bit exists. That means either new intrinsics for all of the operations, or > adding flags to the existing

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

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

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-03 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Well, it's not so much as adding the bit, but adding the information that the bit exists. That means either new intrinsics for all of the operations, or adding flags to the existing ones. That's a fair bit of added complexity. Also, + would do virtually the exact

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-01 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Can the missing bit just be added? It seems to me that frontends ought to be able to emit the obvious intrinsic for the semantic operation here rather than having to second-guess the backend. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-06-30 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Another point is, if we for example have an i16 umul.fix in legalization, we have no way of knowing in the general case that it is safe to replace it with an smul.fix, since the information that the MSB is not significant does not exist on IR level. This is the 'loss

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-06-30 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2117451 , @rjmccall wrote: > Why not legalize to the signed operation? My feeling was that it wasn't right do so in LLVM, because LLVM has no notion of the padding bit and therefore doesn't really care about Clang's

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-06-26 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Why not legalize to the signed operation? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82663/new/ https://reviews.llvm.org/D82663 ___ cfe-commits mailing list

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 273762. ebevhan added a comment. Fixed some broken CHECK lines. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82663/new/ https://reviews.llvm.org/D82663 Files: clang/include/clang/Basic/FixedPoint.h

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: leonardchan, rjmccall, bjope. Herald added a project: clang. Herald added a subscriber: cfe-commits. The design of unsigned fixed-point with padding did not really work as originally intended downstream. The issue with the design is that