This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Change shift amount operand of RVC shift instructions to uimmlog2xlennonzero
ClosedPublic

Authored by shiva0217 on Dec 13 2017, 6:02 PM.

Details

Summary

c.slli/c.srli/c.srai shift amount constraint should accrding to rv32/rv64.
For rv32, shift amount constraint should be [1, 31].
For rv64, shift amount constraint should be [1, 63].

Add uimmlog2xlennonzero to reflect the constraints.

Diff Detail

Repository
rL LLVM

Event Timeline

shiva0217 created this revision.Dec 13 2017, 6:02 PM
asb accepted this revision.Dec 14 2017, 2:15 AM

Thanks, this is a good fix. As a nitpick I'd put the UImmLog2XLenNonZeroAsmOperand and uimmlog2xlennonzero defs exactly where uimm5nonzero was in RISCVInstrInfoC.td, this retains sorting by bitwidth.

This revision is now accepted and ready to land.Dec 14 2017, 2:15 AM
This revision was automatically updated to reflect the committed changes.