This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MC] Update one test case in 'test/MC/Disassembler/ARM/invalid-armv7.txt'
ClosedPublic

Authored by Higuoxing on Mar 2 2019, 4:58 AM.

Details

Summary

Instruction [0xfe 0xf0 0x20 0xe3] is a valid instruction on ARM-v7, which is dbg #14. See:
https://www.cl.cam.ac.uk/research/srg/han/ACS-P35/zynq/ARMv7-A-R-manual.pdf
(Page: 377)

Encoding A1:
DBG<c> #<option>

|31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16|15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00|
|      cond | 0  0  1  1  0| 0| 1  0| 0  0  0  0| 1  1  1  1| 0  0  0  0| 1  1  1  1|    option |

Diff Detail

Repository
rL LLVM

Event Timeline

Higuoxing created this revision.Mar 2 2019, 4:58 AM
Higuoxing updated this revision to Diff 189045.Mar 2 2019, 5:02 AM

Add CHECK-NEXT

Maybe leave the FIXME if the current decoding is wrong?

Maybe leave the FIXME if the current decoding is wrong?

The instruction [0xfe 0xf0 0x20 0xe3 is dbg #14, and it's a legal instruction. I think the test needs an invalid encoding which related with hint instruction.

Oh, I see, you changed the instruction bytes for the test.

Are you planning to fix the decoding for "dbg" instructions? If not, is there a bug filed?

Oh, I see, you changed the instruction bytes for the test.

Are you planning to fix the decoding for "dbg" instructions? If not, is there a bug filed?

I think there's no bug here, what we need is an undefined encoding space for hint instruction test. So, [0xfe 0xf0 0x20 0xf3] is an invalid instruction which has an invalid cond field. According to the manual, there's only one invalid instruction in dbg hint instruction, which is this.

efriedma accepted this revision.Mar 4 2019, 6:55 PM

Oh, okay. LGTM.

This revision is now accepted and ready to land.Mar 4 2019, 6:55 PM

I spotted this FIXME when I trying to find some typos in llvm. I don't know if it's a deliberate typo to skip CHECK, because the encoding is a valid arm instruction.

Oh, okay. LGTM.

Thanks for reviewing :)

This revision was automatically updated to reflect the committed changes.