This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3] gas: Emit A2 encoding for ARM PUSH/POP with single register


On 04/03/2012 11:33 AM, Richard Earnshaw wrote:

> On 02/04/12 20:00, Meador Inge wrote:
>> Hi,
>>
>> This patch changes GAS to emit the A2 encoding for PUSH/POP instructions
>> with a single register.  This case is specified by the ARMARM: A8.8.132,
>> A8.8.133 [1].  The A2 encoding is allowed on the following architecture
>> versions: ARMv4*, ARMv5T*, ARMv6*, and ARMv7.
>>
>> Tested with arm-none-eabi configuration.  No regressions.
>>
>> OK?
>>
>> P.S. If this is OK, then can someone commit for me?  I don't have write
>> access.
>>
>> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0406c/index.html
>>
>> Changes since v2 (Fixed issues pointed out by Richard Earnshaw):
>>
>>    * The A2 encoding should only be applied to PUSH/POP mnemonics.
>>    * Added more test cases.
>>    * Some simplifications.
>>
>> Changes since v1 (Improvements suggested by Matthew Gretton-Dann):
>>
>>    * Use 'ffs' instead of manual loop to see if a bit is set.
>>    * Use macros instead of magic number bit patterns.
>>
>> 2012-04-02  Jie Zhang  <jie@codesourcery.com>
>>             Meador Inge  <meadori@codesourcery.com>
>>
>> 	* config/tc-arm.c (only_one_reg_in_list): New function.
>> 	(encode_ldmstm): Ditto.
>> 	(do_ldmstm): Use a different encoding when pushing or poping
>> 	a single register.
>> 	(A_COND_MASK): New macro.
>> 	(A_PUSH_POP_OP_MASK): Ditto.
>> 	(A1_OPCODE_PUSH): Ditto.
>> 	(A2_OPCODE_PUSH): Ditto.
>> 	(A2_OPCODE_POP): Ditto.
>>
>> 2012-04-02  Jie Zhang  <jie@codesourcery.com>
>>             Meador Inge  <meadori@codesourcery.com>
>>
>> 	* gas/arm/push-pop.d: New testcase.
>> 	* gas/arm/push-pop.s: Ditto.
>> 	* gas/arm/stm-ldm.d: Ditto.
>> 	* gas/arm/stm-ldm.s: Ditto.
>>
> 
> This is OK.

Thanks.

> It won't hold up this patch, but I'll note here for completeness that
> this exposes the fact that the disassembly of a single-register ldm/stm
> from SP as pop/push is incorrect and that these really should be printed
> out as ldm/stm operations.

I will put together a patch for that too.

If someone could commit this patch for me, that would be great.  I don't have
write access.

-- 
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]