The ARM Thumb2 assembly code SSAT<c> <Rd>,#<imm>,<Rn>,ASR #32 and USAT<c> <Rd>,#<imm>,<Rn>,ASR #32 should produce an error (these are only valid when not in Thumb mode). They instead compile to SSAT16<c> <Rd>,#<imm>,<Rn> and USAT16<c> <Rd>,#<imm>,<Rn> For example: $ echo ".code 16 ssat r1,#2,r3,asr #32" | arm-elf-as -aln -EB -o /dev/null 1 0000 F3230101 .code 16 ssat r1,#2,r3,asr#32 $ echo ".code 16 ssat16 r1,#2,r3" | arm-elf-as -aln -EB -o /dev/null 1 0000 F3230101 .code 16 ssat16 r1,#2,r3 $ echo ".code 16 usat r1,#2,r3,asr #32" | arm-elf-as -aln -EB -o /dev/null 1 0000 F3A30102 .code 16 usat r1,#2,r3,asr#32 $ echo ".code 16 usat16 r1,#2,r3" | arm-elf-as -aln -EB -o /dev/null 1 0000 F3A30102 .code 16 usat16 r1,#2,r3
Created attachment 4007 [details] Catch out of range shift values for SSAT and USAT instructions.
Hi Anthony, Thank you for reporting this bug. I am going to apply the uploaded patch to fix the assembler and also a test case for the erroneous instructions. Cheers Nick gas/ChangeLog 2009-06-18 Nick Clifton <nickc@redhat.com> PR 10169 * gas/tc-arm.c (do_t_ssat): Move common code from here... (do_t_usat): ... and here to... (do_t_ssat_usat): New function: ... here. Add code to check that the shift value, if present, is in range. gas/testsuite/ChangeLog 2009-06-18 Nick Clifton <nickc@redhat.com> PR 10169 * gas/arm/thumb2_bad_reg.s: Add tests for SSAT and USAT with an out of range shift. * gas/arm/thumb2_bad_reg.l: Update expected error messages.
Subject: Bug 10169 CVSROOT: /cvs/src Module name: src Changes by: nickc@sourceware.org 2009-06-18 16:36:05 Modified files: gas/config : tc-arm.c gas : ChangeLog gas/testsuite : ChangeLog gas/testsuite/gas/arm: thumb2_bad_reg.l thumb2_bad_reg.s Log message: PR 10169 * gas/tc-arm.c (do_t_ssat): Move common code from here... (do_t_usat): ... and here to... (do_t_ssat_usat): New function: ... here. Add code to check that the shift value, if present, is in range. * gas/arm/thumb2_bad_reg.s: Add tests for SSAT and USAT with an out of range shift. * gas/arm/thumb2_bad_reg.l: Update expected error messages. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?cvsroot=src&r1=1.386&r2=1.387 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.3829&r2=1.3830 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1493&r2=1.1494 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/arm/thumb2_bad_reg.l.diff?cvsroot=src&r1=1.2&r2=1.3 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/arm/thumb2_bad_reg.s.diff?cvsroot=src&r1=1.2&r2=1.3