[PATCH] D110725: [MSP430] Add codegen support for MSP430X shift instructions

Jozef Lawrynowicz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 08:51:58 PDT 2021


jozefl created this revision.
jozefl added a reviewer: asl.
Herald added a subscriber: hiraditya.
jozefl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

MSP430X devices can utilize the RxxX and RxxM types of shift
instructions, which are more efficient than the default MSP430 shift
instructions. MSP430 shifts can only shift by one bit position at a
time, whilst RxxM and RxxX can shift by multiple bit positions.

RxxM shifts only support shift counts up to 4, but are cheaper than RxxX
shifts, which can shift by up to 16 bit positions. Therefore, there are
some situations where it is preferable to generate one or two RxxM
shifts instead of an RxxX shift.

RRCM and RRCX are not currently implemented as they are not required
when MSP430TargetLowering only lowers shifts with 8-bit or 16-bit
operands. They could be used in the future to improve the efficiency of
shifts for 32-bit or 64-bit operands.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110725

Files:
  llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
  llvm/lib/Target/MSP430/MSP430ISelLowering.h
  llvm/lib/Target/MSP430/MSP430InstrInfoExtended.td
  llvm/test/CodeGen/MSP430/shift-amount-threshold.ll
  llvm/test/CodeGen/MSP430/shifts-430x-byte.ll
  llvm/test/CodeGen/MSP430/shifts-430x-word.ll
  llvm/test/CodeGen/MSP430/shifts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110725.375907.patch
Type: text/x-patch
Size: 39751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210929/3a12975c/attachment.bin>


More information about the llvm-commits mailing list