llvm.org GIT mirror llvm / 04b03fa
This fixes the Thumb2 CPS assembly syntax. In Thumb1, only one variant is supported: CPS{effect} {flags} Thumb2 supports three: CPS{effect}.W {flags} CPS{effect} {flags} {mode} CPS {mode} Canonically, .W should be used only when ambiguity is present between encodings of different width. The wide suffix is still accepted for the latter two forms via aliases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188071 91177308-0d34-0410-b5e6-96231b3b80d8 Mihai Popa 6 years ago
4 changed file(s) with 41 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
35033503
35043504 let M = 1 in
35053505 def t2CPS3p : t2CPS<(ins imod_op:$imod, iflags_op:$iflags, i32imm:$mode),
3506 "$imod.w\t$iflags, $mode">;
3506 "$imod\t$iflags, $mode">;
35073507 let mode = 0, M = 0 in
35083508 def t2CPS2p : t2CPS<(ins imod_op:$imod, iflags_op:$iflags),
35093509 "$imod.w\t$iflags">;
35103510 let imod = 0, iflags = 0, M = 1 in
35113511 def t2CPS1p : t2CPS<(ins imm0_31:$mode), "\t$mode">;
3512
3513 def : t2InstAlias<"cps$imod.w $iflags, $mode",
3514 (t2CPS3p imod_op:$imod, iflags_op:$iflags, i32imm:$mode), 0>;
3515 def : t2InstAlias<"cps.w $mode", (t2CPS1p imm0_31:$mode), 0>;
35123516
35133517 // A6.3.4 Branches and miscellaneous control
35143518 // Table A6-14 Change Processor State, and hint instructions
215215 @ CHECK: cmp r8, r1 @ encoding: [0x88,0x45]
216216
217217 @------------------------------------------------------------------------------
218 @ CPS
219 @------------------------------------------------------------------------------
220
221 cpsie f
222 cpsid a
223
224 @ CHECK: cpsie f @ encoding: [0x61,0xb6]
225 @ CHECK: cpsid a @ encoding: [0x74,0xb6]
226
227 @------------------------------------------------------------------------------
218228 @ EOR
219229 @------------------------------------------------------------------------------
220230 eors r4, r5
404404 @ CHECK: cmn.w r2, #2 @ encoding: [0x12,0xf1,0x02,0x0f]
405405 @ CHECK: cmp.w r9, #1 @ encoding: [0xb9,0xf1,0x01,0x0f]
406406
407 @------------------------------------------------------------------------------
408 @ CPS
409 @------------------------------------------------------------------------------
410
411 cpsie f
412 cpsid a
413 cpsie.w f
414 cpsid.w a
415 cpsie i, #3
416 cpsie.w i, #3
417 cpsid f, #9
418 cpsid.w f, #9
419 cps #0
420 cps.w #0
421
422 @ CHECK: cpsie f @ encoding: [0x61,0xb6]
423 @ CHECK: cpsid a @ encoding: [0x74,0xb6]
424 @ CHECK: cpsie.w f @ encoding: [0xaf,0xf3,0x20,0x84]
425 @ CHECK: cpsid.w a @ encoding: [0xaf,0xf3,0x80,0x86]
426 @ CHECK: cpsie i, #3 @ encoding: [0xaf,0xf3,0x43,0x85]
427 @ CHECK: cpsie i, #3 @ encoding: [0xaf,0xf3,0x43,0x85]
428 @ CHECK: cpsid f, #9 @ encoding: [0xaf,0xf3,0x29,0x87]
429 @ CHECK: cpsid f, #9 @ encoding: [0xaf,0xf3,0x29,0x87]
430 @ CHECK: cps #0 @ encoding: [0xaf,0xf3,0x00,0x81]
431 @ CHECK: cps #0 @ encoding: [0xaf,0xf3,0x00,0x81]
407432
408433 @------------------------------------------------------------------------------
409434 @ DBG
124124 # CHECK: cps #15
125125 0xaf 0xf3 0x0f 0x81
126126
127 # CHECK: cpsie.w if, #10
127 # CHECK: cpsie if, #10
128128 0xaf 0xf3 0x6a 0x85
129129
130130 # CHECK: cpsie aif