[PATCH v2] ARM: asm: rename logical shift macros push pull into lspush lspull

Victor Kamensky victor.kamensky at linaro.org
Tue Feb 11 14:52:19 EST 2014


On 11 February 2014 11:36, Victor Kamensky <victor.kamensky at linaro.org> wrote:
> On 11 February 2014 09:58, Nicolas Pitre <nicolas.pitre at linaro.org> wrote:
>> On Tue, 11 Feb 2014, Dave Martin wrote:
>>
>>> On Tue, Feb 11, 2014 at 12:09:35PM -0500, Nicolas Pitre wrote:
>>> > On Tue, 11 Feb 2014, Dave Martin wrote:
>>> >
>>> > > On Mon, Feb 10, 2014 at 04:30:01PM -0500, Nicolas Pitre wrote:
>>> > > > On Mon, 10 Feb 2014, Victor Kamensky wrote:
>>> > > >
>>> > > > > Renames logical shift macros, 'push' and 'pull', defined in
>>> > > > > arch/arm/include/asm/assembler.h, into 'lspush' and 'lspull'.
>>> > > >
>>> > > > I don't have any fundamental objection to the idea, except maybe for the
>>> > > > actual names.  I just can't come up with anything better though.
>>> > >
>>> > > For consistency with the get_byte_ stuff, how about:
>>> > >
>>> > >   push -> towards_byte_0
>>> > >   pull -> from_byte_0
>>> > >
>>> > > That may make the purpose a little clearer, too.
>>> >
>>> > I don't know if
>>> >
>>> >     mov     r0, r1, from_byte_0 #8
>>> >
>>> > is that much clearer though.
>>> >
>>> > > (Assuming I've got them the right way around...)
>>> >
>>> > As you later noticed you got it wrong.  :-)
>>> > Most likely because "full from" and "push towards" are common english
>>> > constructs.
>>>
>>> No more so than "pull towards" and "push from".
>>
>> OK.  I'll trust you on that account.
>>
>>> I'll blame it on the fact that the get_byte_ macros have wrong-
>>> endian numbering, which I didn't look at carefully enough ;)
>>>
>>> But I think we proved that my suggestion didn't really make things
>>> easier to understand...
>>
>> What about:
>>
>>         push -> next
>>         pull -> prev
>>
>> ?
>>
>> That would make:
>>
>>         mov     r0, r1, next #8
>
> I am not native English speaker, so subtle details of your
> discussion go above my head :). For me those tokens
> were just symbols with specific meaning of logical shifts
> and selected endianness. I'll do as you decide. Quick
> grep over .S files under arch/arm seems 'next' and 'prev'
> will be OK and I did build that confirms that.

Forgot to mention one detail. There is a case in
./nwfpe/entry.S file where 'next' is used as label name. I guess,
it should work if macro would rename it into lsl or lsr label
name. And/or we could rename the label.

Wondering ... whether idea to have those macros
name in way that coincides with English words would lead
us to some conflict earlier or latter. With this respect lspull
and lspush IMHO are somewhat better because they are
sort of abbreviations.

Thanks,
Victor

> One nit/question though: there are some cases where
> 'push' and 'pull' macros were used in macros and macro
> parameters were also called 'push' and 'pull'. I.e something
> like this:
>
> mov     r3, lr, pull #\pull
>
> with rename 'pull' to 'lspull' I did not bother to rename
> macro parameters because they are separate, have
> just local context and 'lspull' is close to 'pull'. Resulting
> proposed diff was:
> -               mov     r3, lr, pull #\pull
> +               mov     r3, lr, lspull #\pull
>
> I assume that if we change 'push -> next' and 'pull -> prev' I
> will need to rename macro parameters in the same way.
> So it will be:
> +               mov     r3, lr, prev #\prev
> Is it correct?
>
> Thanks,
> Victor
>
>>
>> Nicolas



More information about the linux-arm-kernel mailing list