[Pixman] [PATCH v2] build: improve control logic for enabling MMI.

Shiyou Yin yinshiyou-hf at loongson.cn
Mon Mar 23 07:06:37 UTC 2020


>-----Original Message-----
>From: pixman-bounces at lists.freedesktop.org [mailto:pixman-bounces at lists.freedesktop.org] On Behalf
>Of Shiyou Yin
>Sent: Monday, March 9, 2020 9:43 PM
>To: 'Matt Turner'
>Cc: 'pixman'
>Subject: Re: [Pixman] [PATCH v2] build: improve control logic for enabling MMI.
>
>>-----Original Message-----
>>From: Matt Turner [mailto:mattst88 at gmail.com]
>>Sent: Monday, March 9, 2020 9:00 AM
>>To: Shiyou Yin
>>Cc: pixman
>>Subject: Re: [Pixman] [PATCH v2] build: improve control logic for enabling MMI.
>>
>>Thank you for the patch!
>>
>>On Fri, Mar 6, 2020 at 3:28 AM Shiyou Yin <yinshiyou-hf at loongson.cn> wrote:
>>>
>>> From: Yin Shiyou <yinshiyou-hf at loongson>
>>
>>Should be yinshiyou-hf at loongson*.cn*?
>
>Yes, will update.
>
>>>
>>> 1. Replace LS_CFLAGS with MMI_CFLAGS to express its intention more accurately.
>>>    LS_CFLAGS is still available, but it is not recommended.
>>
>>I'm not aware of any reasons why LS_CFLAGS needs to stay for
>>compatibility. Do we know of any distros that set it to override the
>>-march=... value?
>
>No, keep LS_CFLAGS is just considering that users may be used to it.
>
>>
>>> 2. Improve the control logic for enabling MMI.
>>>
>>> Three essential conditions for enabling MMI:
>>> 1) user have not specify --disable-loongson-mmi.
>>> 2) MMI options has been specified by MMI_CFLAGS,CC or compiler's default setting.
>>> 3) compiler supports these MMI options.
>>> ---
>>>  configure.ac | 69 ++++++++++++++++++++++++++++++++++++++++--------------------
>>
>>We should also update meson.build. I expect/hope that the autotools
>>build system will go away sometime in the future.
>
>Will update.
>
>>
>>I'm not sure I entirely understand the patch. I understand that the
>>objective is to make it possible to easily build pixman for Loongson3A
>>and use the pixman-mmx.c optimizations.
>
>It's my original goal. In my first patch, I replaced '-march=loongson2f'
>with -mloongson-mmi directly. But it raised objections, Yunqiang said it will
>cause break on 2F for the different opcode on 2F and 3A. I tried to find a 2F
>to verify this, but I havn't found yet.
>
>>I think it's currently possible to build pixman on mips without
>>specifying -march=loongson* in CFLAGS and it will enable the
>>pixman-mmx.c paths and choose them at runtime. Is part of the goal to
>>keep that working? If so, could we just use the -mloongson-mmi flag to
>>compile pixman-mmx.c?
>
>Yes, from last year, compiler has add '-mloongson-mmi' to support MMI,
>It's not recommended to use -march=* to build MMI any more.
>What we worry about is -march=loongson2f and -mloongson-mmi will generate
>different opcode.(This is not verified yet.)
>
>>Or does that flag mean the Loongson3A variants of the instructions?
>>What happens if you compile with -march=loongson2f -mloongson-mmi?
>>Does GCC generate instructions compatible with 2F or 3A?
>
>I am still trying to find out a 2F to verify this.
>If -mloongson-mmi works well on 2F, maybe we can revert to the first version of my patch.
>If -mloongson-mmi caused break of 2F, then this patch may be a suitable option.
>
Hi, Matt
I haven't found an available 2F environment(hardware+ os+ buildtools) to verify yet.
But according to the compiler team of loongson, opcode of MMI are consitant on 2F and 3a.
So far, I have submitted two proposals:
Proposal A: just replace '-march=loongson2f' with '-mloongson-mmi'.
Proposal B: improve the hole control logic for enabling MMI.

In fact, Proposal B is equivalent to deleting the default settings for LS_CFLAGS directly.
So, I have simplified it。Both patch are in the attachment.

Considering loongson compiler team has said that opcode of MMI are
consitant on 2F and 3a, I prefer to choose proposal A. 

please help to merge this patch. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proposal_A_0001-configure.ac-use-mloongson-mmi-for-Loongson-MMI.patch
Type: application/octet-stream
Size: 1209 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20200323/08578bc5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proposal_B_0001-configure.ac-Delete-the-default-setting-of-LS_CFLAGS.patch
Type: application/octet-stream
Size: 1779 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20200323/08578bc5/attachment-0001.obj>


More information about the Pixman mailing list