This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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 ARM] implement bswap16


On 6 September 2012 18:42, Richard Earnshaw <rearnsha@arm.com> wrote:
> On 06/09/12 17:07, Christophe Lyon wrote:
>>
>> But why are the thumb1_XXX patterns still necessary?
>> I tried removing them, but compiling the testcase with -march=armv6
>> -mthumb makes the compiler fail (internal compiler error:
>> output_operand: invalid %-code)
>>
>
> They probably aren't necessary.  It should be possible to combine these
> patterns into
>
> (define_insn "*arm_revsh"
>   [(set (match_operand:SI 0 "s_register_operand" "=l,r")
>         (sign_extend:SI (bswap:HI (match_operand:HI 1
> "s_register_operand" "l,r"))))]
>   "arm_arch6"
>   "revsh%?\t%0, %1"
>   [(set_attr "predicable" "yes")
>    (set_attr "arch" "t,32")
>    (set_attr "length" "2,4")]
>
>

Thanks for showing me the right "arch" value.
The problem with this pattern if I delete the *thumb1_revsh one, is
that %? is not accepted as a valid punctuation indicator for an
operand when in thumb1 mode.

In particular, arm_print_operand_punct_valid_p would return true in
thumb1 if the punctuation character was '_'.

However, I failed to find a '%_' operand in the ARM description: is
arm_print_operand_punct_valid_p still accurate?

Or can I replace '_' by '?' in this function?

Thanks,

Christophe.


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