[PATCH] D38988: [PowerPC] Use helper functions to check sign-/zero-extended value

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 00:58:55 PDT 2017


nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D38988#900526, @inouehrs wrote:

> In https://reviews.llvm.org/D38988#899532, @nemanjai wrote:
>
> > And FWIW, I still don't like the names of these helper functions. There isn't really much indication in the name what it is sign/zero extending from/to. Presume I want to do add/remove an instruction depending on whether the input is known to be sign-extended from a halfword to a doubleword, but not if it is only known to be sign-extended from a word to a doubleword, it isn't clear how I would use these functions to determine that.
>
>
> Is `isSignExtendedFromWord` better? Other candidates I have are `isSignExtendedWord` or `isSignExtended_32_64`. Any suggestions?


Well, I think it is important to also communicate that the zero/sign extendedness is a property of the instruction rather than a computation of known bits. So I'm thinking a name like `instrZeroExtends32To64()` and `instrSignExtends32To64()`. Or perhaps I'm being pedantic here, maybe @echristo or @hfinkel want to chime in. Of course, the rename can be done in a separate patch.

But this patch LGTM now.


https://reviews.llvm.org/D38988





More information about the llvm-commits mailing list