Re: [PATCH v2 1/4] ARC: allow to override default mcpu compiler flag

From: Vineet Gupta
Date: Tue Jun 16 2020 - 18:12:40 EST


On 6/5/20 3:47 AM, Alexey Brodkin wrote:
> Hi Eugeniy,
>
> A couple of minor notes below.
>
>> -----Original Message-----
>> From: Eugeniy Paltsev <Eugeniy.Paltsev@xxxxxxxxxxxx>
>> Sent: Thursday, June 4, 2020 8:39 PM
>> To: linux-snps-arc@xxxxxxxxxxxxxxxxxxx; Vineet Gupta <vgupta@xxxxxxxxxxxx>
>> Cc: linux-kernel@xxxxxxxxxxxxxxx; Alexey Brodkin <abrodkin@xxxxxxxxxxxx>; Eugeniy Paltsev
>> <paltsev@xxxxxxxxxxxx>
>> Subject: [PATCH v2 1/4] ARC: allow to override default mcpu compiler flag
>>
>> Kernel builds set their own default -mcpu for a given ISA build.
>
> We used to use a default "-mcpu" per ARC ISA version (one for ARCompact
> and one for ARCv2).
>
>> But that gets in the way of "custom" -mcpu flags from propagating
>> into kernel build.
>
> But with more versions of CPUs & SoCs becoming available we want to
> be able to fine-tune generated code more precise.
>
>> This will also be used in next patches for HSDK-4xD board support which
>> uses a different -mcpu to effect dual issue scheduling.
>
> "...for utilization of the new CPU's dual-issue capabilities"?
>
>> +++ b/arch/arc/Makefile
>> @@ -10,8 +10,25 @@ CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux-)
>> endif
>>
>> cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
>> -cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
>> -cflags-$(CONFIG_ISA_ARCV2) += -mcpu=hs38
>> +
>> +tune-mcpu-def-$(CONFIG_ISA_ARCOMPACT) := -mA7
>
> I'd suggest to either swap "-mA7" which is being obsoleted with "-mcpu=arc700"
> right here or as a separate change, otherwise we may soon get ATC700 builds
> broken with newer compilers.

FWIW I've added a modified variant of this patch to for-curr as we need it for
ongoing ARC64 port as well.

-Vineet