Message ID | d13be8b8-d501-4a19-a359-813fd9f2e57e@suse.com |
---|---|
State | New |
Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 07FB3384A45D for <patchwork@sourceware.org>; Fri, 6 Sep 2024 11:52:33 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 8F7C3384A44E for <binutils@sourceware.org>; Fri, 6 Sep 2024 11:51:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F7C3384A44E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8F7C3384A44E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725623518; cv=none; b=EXX8mkkHXGVTHVQ5ZXzpNI1P6GV4YrJCqcQp4A9BAk4v6HNJ9D9ziKMBI1t6cYjbn0GGUg4DITE0K9OOb95Wh+ispQW3Ib5in9TAWjOynlIqIDFxEqTrXEpGkczQpZutc4BSfFD1eL6sEtRHzUYEVydL6GUbQnbHt9fevOTXzgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725623518; c=relaxed/simple; bh=LDn4Ir7izeTjjP2/pDr87OVasRKuxiq7KwGE2LQCgB0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=q9AUAMzMpOgE46U/Fl0CeHhVjgj17d6xEFpojqTUhXNIAbMKFEgxDNH+p8B6Vr6imV57v5amtcSPnjYy6u7vyNCD6SOV4r1QbsZ/O+raCOtzkvPKht8WoEPAdw13FmaZwqEdfFX179bAUHIRu53dqabk+KUi/GeIC26NScLkRsg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a86b46c4831so267989466b.1 for <binutils@sourceware.org>; Fri, 06 Sep 2024 04:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725623515; x=1726228315; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=poM44st1ycPHTWdkczVvK97y6imQtMilv7cvoZrHuFg=; b=L1eM/snOEK9F/R/YBDOZxOL8Q/ZuUolISvtVqPKjvrdneFFTfPM1H9F6KgsaBF4tH5 uXHiJT2sAFpQsRz9PMTlDn2gjJ7pfc9aZOGUNliogwC0eJOdVbO+zqbOw74z3XHsxiRM whoN3wQK+g5C5V3F7xobC7dsMgX5o11lnjvbFLql1uPFPD8tfr1oLYpoiGUjYuthS3cm gera5I7U2MHK1g7YXx2pGsl6ygLnKJ5oYxwUtVEyNGveihedEarYK/dVGTm6+ldrTkrs 4vmTFwiS9uG7czwOlIv3vnjW3LU1BaNHQF4k/5x+DXrmVIdjHuHdxsgdRMUPgh4qtYNG NOeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725623515; x=1726228315; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=poM44st1ycPHTWdkczVvK97y6imQtMilv7cvoZrHuFg=; b=MoVfopYPZhU9MqBhaKrsrb6nlonIuZtOiCFS9rLazqIqm/Nw7fRjDRmOQW4L5hYjUe kA0JkYaiZyLh5qsYVhcMQ+KDhU8+WeshnmxDvoD0WKPFAlN5R1qXWaqHkgweEXS3iT4p dMURQEAUX7HCKdgUKMGrxEFqJLomOfGh66qFCifKY/y2UeJxSPyuae4VVJJ9Il5KrTOk pOxYbW9MlxGVHJihJ1PNiKD70TwP/DCCbka3swWkZc7vqAiWnIbibxWYNeYwIbqicBd8 x9LGuVlivczv6hIROui+6XC7VQ4p9/UpCxZJVrUgqZ9IT5s4TgqATNGbPUW90rAZ7AIR SBNw== X-Gm-Message-State: AOJu0Yyr7J7/SZe2afwK5nh0bzS4Yc4jzBaVv4MWwoT4mrDihwlcEDA3 X2TBCNLH7D9KO+hNSmI5qaA6d3khSDH0lGY4/zArRxze7uo/XKZmxBEJexHJsHscRU4wVQHd9LY = X-Google-Smtp-Source: AGHT+IHYYpg5MGTPsruoPBdZEFYTJGPRuEsfH9b/8HNGGcNHiUZ/K5LrEPqO8KEHgEAVlNsTasaEgg== X-Received: by 2002:a17:907:26ca:b0:a86:685c:742 with SMTP id a640c23a62f3a-a8a88663a24mr192837566b.28.1725623514998; Fri, 06 Sep 2024 04:51:54 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a62045832sm266425066b.75.2024.09.06.04.51.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Sep 2024 04:51:54 -0700 (PDT) Message-ID: <d13be8b8-d501-4a19-a359-813fd9f2e57e@suse.com> Date: Fri, 6 Sep 2024 13:51:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 1/5] x86: correct {,V}PEXTR{D,Q} optimization From: Jan Beulich <jbeulich@suse.com> To: Binutils <binutils@sourceware.org> Cc: "H.J. Lu" <hjl.tools@gmail.com> References: <4234e6b6-4c11-4e05-a3d9-fc8d0b29a0a6@suse.com> Content-Language: en-US Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJki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VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: <4234e6b6-4c11-4e05-a3d9-fc8d0b29a0a6@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3023.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
Series |
x86: (mainly) insert/extract optimizations
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_binutils_build--master-arm | fail | Patch failed to apply |
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | fail | Patch failed to apply |
Commit Message
Jan Beulich
Sept. 6, 2024, 11:51 a.m. UTC
A possible relocation associated with a memory operand also needs moving.
Comments
> -----Original Message----- > From: Jan Beulich <jbeulich@suse.com> > Sent: Friday, September 6, 2024 7:52 PM > To: Binutils <binutils@sourceware.org> > Cc: H.J. Lu <hjl.tools@gmail.com> > Subject: [PATCH 1/5] x86: correct {,V}PEXTR{D,Q} optimization > > A possible relocation associated with a memory operand also needs moving. > > --- a/gas/config/tc-i386.c > +++ b/gas/config/tc-i386.c > @@ -5503,6 +5503,7 @@ optimize_encoding (void) > i.op[1].regs = i.op[2].regs; > i.types[1] = i.types[2]; > i.flags[1] = i.flags[2]; > + i.reloc[1] = i.reloc[2]; /* Optimize: -O: pextrd $0, %xmmN, ... -> movd %xmmN, ... pextrq $0, %xmmN, ... -> movq %xmmN, ... vpextrd $0, %xmmN, ... -> vmovd %xmmN, ... vpextrq $0, %xmmN, ... -> vmovq %xmmN, ... */ Jan, I have a question, why do you want to add the swap of i.reloc[] here (seems they are not related to reloc)? There is no swapping of i.reloc[] elsewhere in this function. Thanks, Lili. > i.tm.operand_types[1] = i.tm.operand_types[2]; > > i.operands = 2;
On 11.09.2024 09:07, Cui, Lili wrote: >> -----Original Message----- >> From: Jan Beulich <jbeulich@suse.com> >> Sent: Friday, September 6, 2024 7:52 PM >> >> --- a/gas/config/tc-i386.c >> +++ b/gas/config/tc-i386.c >> @@ -5503,6 +5503,7 @@ optimize_encoding (void) >> i.op[1].regs = i.op[2].regs; >> i.types[1] = i.types[2]; >> i.flags[1] = i.flags[2]; >> + i.reloc[1] = i.reloc[2]; > > > /* Optimize: -O: > pextrd $0, %xmmN, ... -> movd %xmmN, ... > pextrq $0, %xmmN, ... -> movq %xmmN, ... > vpextrd $0, %xmmN, ... -> vmovd %xmmN, ... > vpextrq $0, %xmmN, ... -> vmovq %xmmN, ... > */ > > Jan, I have a question, why do you want to add the swap of i.reloc[] here (seems they are not related to reloc)? There is no swapping of i.reloc[] elsewhere in this function. In most cases of what is being optimized there are no memory operands, or the number of operands total doesn't change. That's different here. And memory operands can come with a relocation, which needs to be kept associated with the correct operands. Jan
> -----Original Message----- > From: Jan Beulich <jbeulich@suse.com> > Sent: Wednesday, September 11, 2024 3:20 PM > To: Cui, Lili <lili.cui@intel.com> > Cc: H.J. Lu <hjl.tools@gmail.com>; Binutils <binutils@sourceware.org> > Subject: Re: [PATCH 1/5] x86: correct {,V}PEXTR{D,Q} optimization > > On 11.09.2024 09:07, Cui, Lili wrote: > >> -----Original Message----- > >> From: Jan Beulich <jbeulich@suse.com> > >> Sent: Friday, September 6, 2024 7:52 PM > >> > >> --- a/gas/config/tc-i386.c > >> +++ b/gas/config/tc-i386.c > >> @@ -5503,6 +5503,7 @@ optimize_encoding (void) > >> i.op[1].regs = i.op[2].regs; > >> i.types[1] = i.types[2]; > >> i.flags[1] = i.flags[2]; > >> + i.reloc[1] = i.reloc[2]; > > > > > > /* Optimize: -O: > > pextrd $0, %xmmN, ... -> movd %xmmN, ... > > pextrq $0, %xmmN, ... -> movq %xmmN, ... > > vpextrd $0, %xmmN, ... -> vmovd %xmmN, ... > > vpextrq $0, %xmmN, ... -> vmovq %xmmN, ... > > */ > > > > Jan, I have a question, why do you want to add the swap of i.reloc[] here > (seems they are not related to reloc)? There is no swapping of i.reloc[] elsewhere > in this function. > > In most cases of what is being optimized there are no memory operands, or the > number of operands total doesn't change. That's different here. And memory > operands can come with a relocation, which needs to be kept associated with > the correct operands. > Yes, it is safer. Thanks, Lili. > Jan
--- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -5503,6 +5503,7 @@ optimize_encoding (void) i.op[1].regs = i.op[2].regs; i.types[1] = i.types[2]; i.flags[1] = i.flags[2]; + i.reloc[1] = i.reloc[2]; i.tm.operand_types[1] = i.tm.operand_types[2]; i.operands = 2;