[mips] Add range checks and transformation to octeon instructions in AsmParser.
authorKai Nacke <kai.nacke@redstar.de>
Tue, 27 Jan 2015 19:11:28 +0000 (19:11 +0000)
committerKai Nacke <kai.nacke@redstar.de>
Tue, 27 Jan 2015 19:11:28 +0000 (19:11 +0000)
commit47b633d4a50d351a79f297e093a571ee1a2e84bb
tree723e201495441f76a83b3ff4a56e6bad42c36fd6
parented9cdced007c6e05e89af420638b2f1bf359efae
[mips] Add range checks and transformation to octeon instructions in AsmParser.

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

Reviewed By: dsanders

Differential Revision: http://reviews.llvm.org/D7080

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227225 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
test/MC/Mips/octeon-instructions.s