[PATCH] D48606: [X86] Use bts/btr/btc for single bit set/clear/complement of a variable bit position

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 13:51:02 PDT 2018


craig.topper created this revision.
craig.topper added reviewers: lebedev.ri, spatel, RKSimon.

If we are just modifying a single bit at a variable bit position we can use the BT* instructions to make the change instead of shifting a 1(or rotating a -1) and doing a binop. These instruction also ignore the upper bits of their index input so we can also remove an and if one is present on the index.

I'll see if I can spread some multiclass goodness on the td file to reduce the repetition.


https://reviews.llvm.org/D48606

Files:
  lib/Target/X86/X86InstrCompiler.td
  test/CodeGen/X86/btc_bts_btr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48606.152950.patch
Type: text/x-patch
Size: 11507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180626/59392c4c/attachment.bin>


More information about the llvm-commits mailing list