[PATCH] D112435: [GlobalISel] Add G_BFI (bitfield insertion opcode)

Konstantin Schwarz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 04:09:23 PDT 2021


kschwarz created this revision.
kschwarz added reviewers: paquette, aemerson, foad, arsenm.
Herald added subscribers: dexonsmith, hiraditya, rovka.
kschwarz requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Similar to G_[SU]BFX, many targets support similar bitfield insertion operations.

The most generic form extracts a number of bits (width) from a register (val), starting at bit 0.
Those bits are shifted by a certain shift amount (pos), and inserted into another register (src).
The resulting value is written into the output register:

  %x = G_BFI %src, %val, %pos, %width

There are several patterns that can be combined to a generic bitfield insertion operation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112435

Files:
  llvm/docs/GlobalISel/GenericOpcode.rst
  llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
  llvm/include/llvm/Support/TargetOpcodes.def
  llvm/include/llvm/Target/GenericOpcodes.td
  llvm/lib/CodeGen/MachineVerifier.cpp
  llvm/test/MachineVerifier/test_g_bfi.mir
  llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112435.381926.patch
Type: text/x-patch
Size: 5523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211025/cfb26317/attachment.bin>


More information about the llvm-commits mailing list