public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH] x86: fix AVX* dependencies of ".arch .nosse*"
Date: Thu, 13 Feb 2020 16:03:00 -0000	[thread overview]
Message-ID: <eb7ce662-657a-5e93-fd72-a03e53f5dc6f@suse.com> (raw)
In-Reply-To: <CAMe9rOoisFZJeO4kjqZWisV_uN7RPB9EV+3tgS1GtRArjU0T0Q@mail.gmail.com>

On 13.02.2020 16:56, H.J. Lu wrote:
> On Thu, Feb 13, 2020 at 6:52 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 13.02.2020 15:17, H.J. Lu wrote:
>>> On Thu, Feb 13, 2020 at 5:44 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>
>>>> On 13.02.2020 12:50, H.J. Lu wrote:
>>>>> On Thu, Feb 13, 2020 at 1:23 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>>>
>>>>>> Since ".arch .avx*" enables SSE*, disabling SSE* should also disable
>>>>>> AVX*. Together with 7deea9aad866 ('x86: fix SSE4a dependencies of
>>>>>> ".arch .nosse*"') I think this makes clear that the whole .arch logic
>>>>>> needs an overhaul, such that the mechanism to enable features implies
>>>>>> the reverse operation when disabling any, without having to modify two
>>>>>> places. Arm64's approach may be worthwhile to consider cloning.
>>>>>>
>>>>>> Note that while commit 1848e567343e ("Update x86 CPU_XXX_FLAGS
>>>>>> handling") introducing the testcase which needs fixing here explicitly
>>>>>> says "Don't disable AVX nor AVX512 when disabling SSE", I don't see why
>>>>>> this would be. Furthermore it also says "Don't disable AVX512 when
>>>>>> disabling AVX", which too has been undone meanwhile (commit 89199bb5a027
>>>>>> ["ix86: Disable AVX512F when disabling AVX2"], PR gas/24359). The only
>>>>>> sensible (consistent) alternative therefore would be to avoid enabling
>>>>>> SSE* with ".arch .avx*", like is done for SSE* wrt MMX (in turn leading
>>>>>> to inconsistencies with SSE insns accessing MMX registers).
>>>>>>
>>>>>
>>>>> The intended usages are to build an object:
>>>>>
>>>>> 1. Without MMX, but with SSE, AVX and AVX512.
>>>>> 2. Without SEE nor MMX, but with AVX and AVX512.
>>>>> 3. Without SSE, MMX, AVX, but with AVX512.
>>>>>
>>>>> enforced by assembler.
>>>>
>>>> For one - this isn't spelled out anywhere in the docs. And then it's
>>>> also counter-intuitive. Plus your point 3 isn't true afaict, as per
>>>> commit 89199bb5a027 mentioned above.
>>>
>>> We should revisit it.
>>
>> What is the point of a mode like what you outline in 3 above
> 
> We can use it to build a pure AVX512 object.

But that's not something to be achieved by .arch directives. I
can see the (at least theoretical) usefulness of such a mode,
but it should be controlled by something other than .arch, much
like SSE2AVX mode or SSE insn checking modes also can't be
controlled this way.

Jan

>> anyway? Such a mode is even contrary to -O converting EVEX to
>> VEX where possible.
> 
> Well, we should check if AVX is enabled when doing it.
> 

  reply	other threads:[~2020-02-13 16:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13  9:23 Jan Beulich
2020-02-13 11:51 ` H.J. Lu
2020-02-13 13:44   ` Jan Beulich
2020-02-13 14:18     ` H.J. Lu
2020-02-13 14:52       ` Jan Beulich
2020-02-13 15:57         ` H.J. Lu
2020-02-13 16:03           ` Jan Beulich [this message]
2020-02-13 16:37             ` H.J. Lu
2020-02-13 16:46               ` Jan Beulich
2020-02-13 16:59                 ` H.J. Lu
2020-02-13 17:03                   ` Jan Beulich
2020-02-13 18:11                     ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb7ce662-657a-5e93-fd72-a03e53f5dc6f@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).