This is an archive of the discontinued LLVM Phabricator instance.

[PATCH][mips] Add range checks and transformation to octeon instructions in AsmParser.
ClosedPublic

Authored by Kai on Jan 20 2015, 10:04 PM.

Details

Summary

Hi Daniel!

This patch adds range checks to the immediate operands of octeon
instructions in the AsmParser. Like gas, it applies the following
transformations if the immediate is to large:

bbit0 $8, 42, foo => bbit032 $8, 10, foo
bbit1 $8, 46, foo => bbit132 $8, 14, foo
cins $8, $31, 32, 31 => cins32 $8, $31, 0, 31
exts $7, $4, 54, 9 => exts32 $7, $4, 22, 9

Please review.

Regards,
Kai

Diff Detail

Repository
rL LLVM

Event Timeline

Kai updated this revision to Diff 18481.Jan 20 2015, 10:04 PM
Kai retitled this revision from to [PATCH][mips] Add range checks and transformation to octeon instructions in AsmParser..
Kai updated this object.
Kai edited the test plan for this revision. (Show Details)
Kai added a reviewer: dsanders.
Kai set the repository for this revision to rL LLVM.
Kai added a subscriber: Unknown Object (MLST).
dsanders accepted this revision.Jan 22 2015, 8:16 AM
dsanders edited edge metadata.

LGTM with a couple nits.

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
1177 ↗(On Diff #18481)

Please add a comment to show that the fall through is deliberate.

1254 ↗(On Diff #18481)

C++ style comments are preferred. Likewise for the others below.

1264 ↗(On Diff #18481)

Indentation. The ':' should line up with the '?'.

This revision is now accepted and ready to land.Jan 22 2015, 8:16 AM
This revision was automatically updated to reflect the committed changes.
Kai added a comment.Jan 27 2015, 11:14 AM

Thanks. Committed as r227225.

Regards,
Kai