[all-commits] [llvm/llvm-project] f0b0ba: [X86] Use GF2P8AFFINEQB to implement vector bitrev...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Nov 17 23:50:17 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f0b0bab34dd82c07d153d31363d89ebd04cc733d
      https://github.com/llvm/llvm-project/commit/f0b0bab34dd82c07d153d31363d89ebd04cc733d
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/bitreverse.ll
    M llvm/test/CodeGen/X86/vector-bitreverse.ll

  Log Message:
  -----------
  [X86] Use GF2P8AFFINEQB to implement vector bitreverse.

We can use GF2P8AFFINEQB to reverse bits in a byte. Shuffles are needed to reverse the bytes in elements larger than i8. LegalizeVectorOps takes care of inserting the shuffle for the larger element size.

We already have Custom lowering for v16i8 with SSSE3, v32i8 with AVX, and v64i8 with AVX512BW.

I think we might be able to use this for scalars too by moving into a vector and back. But I'll save that for a follow up as its a little more involved.

Reviewed By: RKSimon, pengfei

Differential Revision: https://reviews.llvm.org/D91515




More information about the All-commits mailing list