diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-07-27 21:09:25 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-07-27 21:09:25 +0000 |
commit | fb8989e64024547e4ad5ab6fe4d94fe146a7899f (patch) | |
tree | be6add2fd82a71a7244d7387558fe7fef0d00bc9 /test/MC | |
parent | c94eefb258fb35e6bb95ceea8f21ea030a907f08 (diff) |
ARM parsing and encoding of SBFX and UBFX.
Encode the width operand as it encodes in the instruction, which simplifies
the disassembler and the encoder, by using the imm1_32 operand def. Add a
diagnostic for the context-sensitive constraint that the width must be in
the range [1,32-lsb].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r-- | test/MC/ARM/basic-arm-instructions.s | 18 | ||||
-rw-r--r-- | test/MC/ARM/diagnostics.s | 11 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/MC/ARM/basic-arm-instructions.s b/test/MC/ARM/basic-arm-instructions.s index 02ccb9deb0..c08bb83c09 100644 --- a/test/MC/ARM/basic-arm-instructions.s +++ b/test/MC/ARM/basic-arm-instructions.s @@ -1309,6 +1309,16 @@ _func: @------------------------------------------------------------------------------ +@ SBFX +@------------------------------------------------------------------------------ + sbfx r4, r5, #16, #1 + sbfxgt r4, r5, #16, #16 + +@ CHECK: sbfx r4, r5, #16, #1 @ encoding: [0x55,0x48,0xa0,0xe7] +@ CHECK: sbfxgt r4, r5, #16, #16 @ encoding: [0x55,0x48,0xaf,0xc7] + + +@------------------------------------------------------------------------------ @ SEL @------------------------------------------------------------------------------ sel r9, r2, r1 @@ -2001,3 +2011,11 @@ _func: @ CHECK: uasxeq r9, r12, r0 @ encoding: [0x30,0x9f,0x5c,0x06] +@------------------------------------------------------------------------------ +@ UBFX +@------------------------------------------------------------------------------ + ubfx r4, r5, #16, #1 + ubfxgt r4, r5, #16, #16 + +@ CHECK: ubfx r4, r5, #16, #1 @ encoding: [0x55,0x48,0xe0,0xe7] +@ CHECK: ubfxgt r4, r5, #16, #16 @ encoding: [0x55,0x48,0xef,0xc7] diff --git a/test/MC/ARM/diagnostics.s b/test/MC/ARM/diagnostics.s index e086128f42..cc244164a4 100644 --- a/test/MC/ARM/diagnostics.s +++ b/test/MC/ARM/diagnostics.s @@ -272,3 +272,14 @@ @ CHECK-ERRORS: error: rotate operator 'ror' expected @ CHECK-ERRORS: sxtb16ge r2, r3, lsr #24 @ CHECK-ERRORS: ^ + + @ Out of range width for SBFX/UBFX + sbfx r4, r5, #31, #2 + ubfxgt r4, r5, #16, #17 + +@ CHECK-ERRORS: error: bitfield width must be in range [1,32-lsb] +@ CHECK-ERRORS: sbfx r4, r5, #31, #2 +@ CHECK-ERRORS: ^ +@ CHECK-ERRORS: error: bitfield width must be in range [1,32-lsb] +@ CHECK-ERRORS: ubfxgt r4, r5, #16, #17 +@ CHECK-ERRORS: ^ |