llvm.org GIT mirror llvm / 1b91231
[ARM] In ARMAsmParser, MatchCoprocessorOperandName() permitted p10 and p11 as operands for coprocessor instructions, resulting in encodings that clash with FP/NEON instruction encodings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194253 91177308-0d34-0410-b5e6-96231b3b80d8 Artyom Skrobov 6 years ago
5 changed file(s) with 34 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
28712871 return -1;
28722872 switch (Name[2]) {
28732873 default: return -1;
2874 case '0': return 10;
2875 case '1': return 11;
2874 // p10 and p11 are invalid for coproc instructions (reserved for FP/NEON)
2875 case '0': return CoprocOp == 'p'? -1: 10;
2876 case '1': return CoprocOp == 'p'? -1: 11;
28762877 case '2': return 12;
28772878 case '3': return 13;
28782879 case '4': return 14;
459459 @------------------------------------------------------------------------------
460460 cdp p7, #1, c1, c1, c1, #4
461461 cdp2 p7, #1, c1, c1, c1, #4
462 cdp2 p10, #0, c6, c12, c0, #7
462 cdp2 p12, #0, c6, c12, c0, #7
463463
464464 @ CHECK: cdp p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xee]
465465 @ CHECK: cdp2 p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xfe]
466 @ CHECK: cdp2 p10, #0, c6, c12, c0, #7 @ encoding: [0xe0,0x6a,0x0c,0xfe]
466 @ CHECK: cdp2 p12, #0, c6, c12, c0, #7 @ encoding: [0xe0,0x6c,0x0c,0xfe]
467467
468468 cdpne p7, #1, c1, c1, c1, #4
469469 @ CHECK: cdpne p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0x1e]
804804 ldc2l p7, c1, [r8]
805805 ldc2l p8, c0, [r9, #-224]
806806 ldc2l p9, c1, [r10, #-120]!
807 ldc2l p10, c2, [r11], #16
808 ldc2l p11, c3, [r12], #-72
807 ldc2l p0, c2, [r11], #16
808 ldc2l p1, c3, [r12], #-72
809809
810810 ldc p12, c4, [r0, #4]
811811 ldc p13, c5, [r1]
845845 @ CHECK: ldc2l p7, c1, [r8] @ encoding: [0x00,0x17,0xd8,0xfd]
846846 @ CHECK: ldc2l p8, c0, [r9, #-224] @ encoding: [0x38,0x08,0x59,0xfd]
847847 @ CHECK: ldc2l p9, c1, [r10, #-120]! @ encoding: [0x1e,0x19,0x7a,0xfd]
848 @ CHECK: ldc2l p10, c2, [r11], #16 @ encoding: [0x04,0x2a,0xfb,0xfc]
849 @ CHECK: ldc2l p11, c3, [r12], #-72 @ encoding: [0x12,0x3b,0x7c,0xfc]
848 @ CHECK: ldc2l p0, c2, [r11], #16 @ encoding: [0x04,0x20,0xfb,0xfc]
849 @ CHECK: ldc2l p1, c3, [r12], #-72 @ encoding: [0x12,0x31,0x7c,0xfc]
850850
851851 @ CHECK: ldc p12, c4, [r0, #4] @ encoding: [0x01,0x4c,0x90,0xed]
852852 @ CHECK: ldc p13, c5, [r1] @ encoding: [0x00,0x5d,0x91,0xed]
10771077 mrc p14, #0, r1, c1, c2, #4
10781078 mrc p15, #7, apsr_nzcv, c15, c6, #6
10791079 mrc2 p14, #0, r1, c1, c2, #4
1080 mrc2 p10, #7, apsr_nzcv, c15, c0, #1
1080 mrc2 p9, #7, apsr_nzcv, c15, c0, #1
10811081
10821082 @ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x92,0x1e,0x11,0xee]
10831083 @ CHECK: mrc p15, #7, apsr_nzcv, c15, c6, #6 @ encoding: [0xd6,0xff,0xff,0xee]
10841084 @ CHECK: mrc2 p14, #0, r1, c1, c2, #4 @ encoding: [0x92,0x1e,0x11,0xfe]
1085 @ CHECK: mrc2 p10, #7, apsr_nzcv, c15, c0, #1 @ encoding: [0x30,0xfa,0xff,0xfe]
1085 @ CHECK: mrc2 p9, #7, apsr_nzcv, c15, c0, #1 @ encoding: [0x30,0xf9,0xff,0xfe]
10861086
10871087 mrceq p15, #7, apsr_nzcv, c15, c6, #6
10881088 @ CHECK: mrceq p15, #7, apsr_nzcv, c15, c6, #6 @ encoding: [0xd6,0xff,0xff,0x0e]
22392239 stc2l p7, c1, [r8]
22402240 stc2l p8, c0, [r9, #-224]
22412241 stc2l p9, c1, [r10, #-120]!
2242 stc2l p10, c2, [r11], #16
2243 stc2l p11, c3, [r12], #-72
2242 stc2l p0, c2, [r11], #16
2243 stc2l p1, c3, [r12], #-72
22442244
22452245 stc p12, c4, [r0, #4]
22462246 stc p13, c5, [r1]
22802280 @ CHECK: stc2l p7, c1, [r8] @ encoding: [0x00,0x17,0xc8,0xfd]
22812281 @ CHECK: stc2l p8, c0, [r9, #-224] @ encoding: [0x38,0x08,0x49,0xfd]
22822282 @ CHECK: stc2l p9, c1, [r10, #-120]! @ encoding: [0x1e,0x19,0x6a,0xfd]
2283 @ CHECK: stc2l p10, c2, [r11], #16 @ encoding: [0x04,0x2a,0xeb,0xfc]
2284 @ CHECK: stc2l p11, c3, [r12], #-72 @ encoding: [0x12,0x3b,0x6c,0xfc]
2283 @ CHECK: stc2l p0, c2, [r11], #16 @ encoding: [0x04,0x20,0xeb,0xfc]
2284 @ CHECK: stc2l p1, c3, [r12], #-72 @ encoding: [0x12,0x31,0x6c,0xfc]
22852285
22862286 @ CHECK: stc p12, c4, [r0, #4] @ encoding: [0x01,0x4c,0x80,0xed]
22872287 @ CHECK: stc p13, c5, [r1] @ encoding: [0x00,0x5d,0x81,0xed]
661661 ldc2l p7, c1, [r8]
662662 ldc2l p8, c0, [r9, #-224]
663663 ldc2l p9, c1, [r10, #-120]!
664 ldc2l p10, c2, [r11], #16
665 ldc2l p11, c3, [r12], #-72
664 ldc2l p0, c2, [r11], #16
665 ldc2l p1, c3, [r12], #-72
666666
667667 ldc p12, c4, [r0, #4]
668668 ldc p13, c5, [r1]
689689 @ CHECK: ldc2l p7, c1, [r8] @ encoding: [0xd8,0xfd,0x00,0x17]
690690 @ CHECK: ldc2l p8, c0, [r9, #-224] @ encoding: [0x59,0xfd,0x38,0x08]
691691 @ CHECK: ldc2l p9, c1, [r10, #-120]! @ encoding: [0x7a,0xfd,0x1e,0x19]
692 @ CHECK: ldc2l p10, c2, [r11], #16 @ encoding: [0xfb,0xfc,0x04,0x2a]
693 @ CHECK: ldc2l p11, c3, [r12], #-72 @ encoding: [0x7c,0xfc,0x12,0x3b]
692 @ CHECK: ldc2l p0, c2, [r11], #16 @ encoding: [0xfb,0xfc,0x04,0x20]
693 @ CHECK: ldc2l p1, c3, [r12], #-72 @ encoding: [0x7c,0xfc,0x12,0x31]
694694
695695 @ CHECK: ldc p12, c4, [r0, #4] @ encoding: [0x90,0xed,0x01,0x4c]
696696 @ CHECK: ldc p13, c5, [r1] @ encoding: [0x91,0xed,0x00,0x5d]
14161416 @------------------------------------------------------------------------------
14171417 mrc p14, #0, r1, c1, c2, #4
14181418 mrc p15, #7, apsr_nzcv, c15, c6, #6
1419 mrc p11, #1, r1, c2, c2
1419 mrc p9, #1, r1, c2, c2
14201420 mrc2 p12, #3, r3, c3, c4
14211421 mrc2 p14, #0, r1, c1, c2, #4
1422 mrc2 p10, #7, apsr_nzcv, c15, c0, #1
1422 mrc2 p8, #7, apsr_nzcv, c15, c0, #1
14231423
14241424 @ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xee,0x92,0x1e]
14251425 @ CHECK: mrc p15, #7, apsr_nzcv, c15, c6, #6 @ encoding: [0xff,0xee,0xd6,0xff]
1426 @ CHECK: mrc p11, #1, r1, c2, c2, #0 @ encoding: [0x32,0xee,0x12,0x1b]
1426 @ CHECK: mrc p9, #1, r1, c2, c2, #0 @ encoding: [0x32,0xee,0x12,0x19]
14271427 @ CHECK: mrc2 p12, #3, r3, c3, c4, #0 @ encoding: [0x73,0xfe,0x14,0x3c]
14281428 @ CHECK: mrc2 p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xfe,0x92,0x1e]
1429 @ CHECK: mrc2 p10, #7, apsr_nzcv, c15, c0, #1 @ encoding: [0xff,0xfe,0x30,0xfa]
1429 @ CHECK: mrc2 p8, #7, apsr_nzcv, c15, c0, #1 @ encoding: [0xff,0xfe,0x30,0xf8]
14301430
14311431 @------------------------------------------------------------------------------
14321432 @ MRRC/MRRC2
25532553 stc2l p7, c1, [r8]
25542554 stc2l p8, c0, [r9, #-224]
25552555 stc2l p9, c1, [r10, #-120]!
2556 stc2l p10, c2, [r11], #16
2557 stc2l p11, c3, [r12], #-72
2556 stc2l p0, c2, [r11], #16
2557 stc2l p1, c3, [r12], #-72
25582558
25592559 stc p12, c4, [r0, #4]
25602560 stc p13, c5, [r1]
25812581 @ CHECK: stc2l p7, c1, [r8] @ encoding: [0xc8,0xfd,0x00,0x17]
25822582 @ CHECK: stc2l p8, c0, [r9, #-224] @ encoding: [0x49,0xfd,0x38,0x08]
25832583 @ CHECK: stc2l p9, c1, [r10, #-120]! @ encoding: [0x6a,0xfd,0x1e,0x19]
2584 @ CHECK: stc2l p10, c2, [r11], #16 @ encoding: [0xeb,0xfc,0x04,0x2a]
2585 @ CHECK: stc2l p11, c3, [r12], #-72 @ encoding: [0x6c,0xfc,0x12,0x3b]
2584 @ CHECK: stc2l p0, c2, [r11], #16 @ encoding: [0xeb,0xfc,0x04,0x20]
2585 @ CHECK: stc2l p1, c3, [r12], #-72 @ encoding: [0x6c,0xfc,0x12,0x31]
25862586
25872587 @ CHECK: stc p12, c4, [r0, #4] @ encoding: [0x80,0xed,0x01,0x4c]
25882588 @ CHECK: stc p13, c5, [r1] @ encoding: [0x81,0xed,0x00,0x5d]
150150 @ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
151151 @ CHECK-ERRORS: error: immediate operand must be in the range [0,15]
152152
153 @ p10 and p11 are reserved for NEON
154 mcr p10, #2, r5, c1, c1, #4
155 mcrr p11, #8, r5, r4, c1
156 @ CHECK-ERRORS: error: invalid operand for instruction
157 @ CHECK-ERRORS: error: invalid operand for instruction
153158
154159 @ Out of range immediate for MOV
155160 movw r9, 0x10000
3939 @ CHECK-NEXT: mcrr2gt p7, #15, r5, r4, c1
4040
4141 ite eq
42 mrceq p11, #1, r1, c2, c2
42 mrceq p9, #1, r1, c2, c2
4343 mrc2ne p12, #3, r3, c3, c4
4444 @ CHECK: ite eq
45 @ CHECK-NEXT: mrceq p11, #1, r1, c2, c2
45 @ CHECK-NEXT: mrceq p9, #1, r1, c2, c2
4646 @ CHECK-NEXT: mrc2ne p12, #3, r3, c3, c4
4747
4848 itt lo