[ARM] SSAT/USAT with an 'asr #32' shift should result in an undefined encoding rather than unpredictable

llvm-svn: 226469
This commit is contained in:
Bradley Smith 2015-01-19 16:37:17 +00:00
parent 30057b245e
commit 3131e85edd
2 changed files with 5 additions and 2 deletions

View File

@ -4971,7 +4971,7 @@ static DecodeStatus DecodeT2ShifterImmOperand(MCInst &Inst, uint32_t Val,
DecodeStatus S = MCDisassembler::Success; DecodeStatus S = MCDisassembler::Success;
// Shift of "asr #32" is not allowed in Thumb2 mode. // Shift of "asr #32" is not allowed in Thumb2 mode.
if (Val == 0x20) S = MCDisassembler::SoftFail; if (Val == 0x20) S = MCDisassembler::Fail;
Inst.addOperand(MCOperand::CreateImm(Val)); Inst.addOperand(MCOperand::CreateImm(Val));
return S; return S;
} }

View File

@ -87,4 +87,7 @@ foo2:
@ CHECK-ERRORS: error: invalid operand for instruction @ CHECK-ERRORS: error: invalid operand for instruction
@ CHECK-ERRORS: error: invalid operand for instruction @ CHECK-ERRORS: error: invalid operand for instruction
ssat r0, #1, r0, asr #32
usat r0, #1, r0, asr #32
@ CHECK-ERRORS: error: 'asr #32' shift amount not allowed in Thumb mode
@ CHECK-ERRORS: error: 'asr #32' shift amount not allowed in Thumb mode