lkml.org 
[lkml]   [2020]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 4/5] ARC: add support for DSP-enabled userspace applications
Date
Hi Vineet,

>From: Vineet Gupta <vgupta@synopsys.com>
>Sent: Tuesday, January 7, 2020 21:25
>To: Eugeniy Paltsev; linux-snps-arc@lists.infradead.org
>Cc: linux-kernel@vger.kernel.org; Alexey Brodkin
>Subject: Re: [PATCH 4/5] ARC: add support for DSP-enabled userspace applications
>> +/*
>> + * As we save new and restore old AUX register value in the same place we
>> + * can optimize a bit and use AEX instruction (swap contents of an auxiliary
>> + * register with a core register) instead of LR + SR pair.
>> + */
>> +#define AUX_SAVE_RESTORE(_saveto, _readfrom, _offt, _aux, _scratch) \
>> +do { \
>> + __asm__ __volatile__( \
>> + "ld %0, [%2, %4] \n" \
>> + "aex %0, [%3] \n" \
>> + "st %0, [%1, %4] \n" \
>> + : \
>> + "=&r" (_scratch) /* must be early clobber */ \
>> + : \
>> + "r" (_saveto), \
>> + "r" (_readfrom), \
>> + "I" (_aux), \
>> + "I" (_offt) \
>> + : \
>
>AEX with "I" constraint will likely be an 8 byte instructions always. Best to give
>compiler wiggle room with "Ir"

Could you please explain how "Ir" will work in this case?
Does this mean that compiler can pass the value either as constant ('I') or
via register ('r')?

Note that in this case both _aux and _offt are compile-time constants -
_aux comes from define and _offt comes from offsetof().

>> + "memory" \
>> + ); \
>> +} while (0)
>> +
\
 
 \ /
  Last update: 2020-03-04 12:52    [W:0.134 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site