[PATCH] D32415: [APInt] Add ashrInPlace method and rewrite in ashr using it.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 23 22:49:20 PDT 2017


craig.topper created this revision.

This patch adds an in place version of ashr to match lshr and shl which were recently added.

I've tried to make this similar to the lshr code with additions to handle the sign extension. I've also tried to do this with less if checks than the current ashr code by sign extending the original result to a word boundary before doing any of the shifting. This removes a lot of the complexity of determining where to fill in sign bits after the shifting.


https://reviews.llvm.org/D32415

Files:
  include/llvm/ADT/APInt.h
  include/llvm/ADT/APSInt.h
  lib/Support/APInt.cpp
  unittests/ADT/APIntTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32415.96345.patch
Type: text/x-patch
Size: 8851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170424/a7b8490a/attachment.bin>


More information about the llvm-commits mailing list