public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Jiang, Haochen" <haochen.jiang@intel.com>
To: "Beulich, Jan" <JBeulich@suse.com>, Binutils <binutils@sourceware.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>, "Cui, Lili" <lili.cui@intel.com>
Subject: RE: [PATCH 0/6] x86: a few more optimizations
Date: Mon, 17 Jun 2024 02:51:10 +0000	[thread overview]
Message-ID: <SA1PR11MB5946989457F3E39E73E454E7ECCD2@SA1PR11MB5946.namprd11.prod.outlook.com> (raw)
In-Reply-To: <fb59590d-8f40-4a79-b7ab-d99581a52715@suse.com>

> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Friday, June 14, 2024 8:11 PM
> To: Binutils <binutils@sourceware.org>
> Cc: H.J. Lu <hjl.tools@gmail.com>; Cui, Lili <lili.cui@intel.com>
> Subject: [PATCH 0/6] x86: a few more optimizations
> 
> APX {nf} insn forms present a number of interesting optimization
> opportunities, often mostly for size. There are a few more that I'm
> aware of, but where I'm less convinced that input code would really
> ever be written like this:
> 
> 1) Quite a few operations could be converted to plain MOV. For example
> 
> 	{nf} xor %cl, %cl
> 	{nf} sub %cl, %cl
> 	{nf} and $0, %cl
> 
> can all be replaced by the much shorter
> 
> 	mov	$0, %cl
> 
> 2) Certain forms of IMUL{,ZU} with a power-of-2 immediate could be
> converted to SHL. This could be beneficial even when size doesn't
> shrink, for SHL still having better latency/throughput.
> 

Hi Jan,

I suppose the first optimization is ok whether for compiler to do that or
assembler to do that. I don't see problems from the first glance since the
behavior seems the same.

The imul -> shl optimization should be done in compiler since it is
latency/throughput related.

Thx,
Haochen

  parent reply	other threads:[~2024-06-17  2:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 12:10 Jan Beulich
2024-06-14 12:12 ` [PATCH 1/6] x86: optimize left-shift-by-1 Jan Beulich
2024-06-17  2:56   ` Jiang, Haochen
2024-06-17  8:40     ` Jan Beulich
2024-06-14 12:12 ` [PATCH 2/6] x86/APX: optimize {nf} forms of ADD/SUB with immediate of 0x80 Jan Beulich
2024-06-14 12:13 ` [PATCH 3/6] x86/APX: optimize {nf}-form rotate-by-width-less-1 Jan Beulich
2024-06-14 12:13 ` [PATCH 4/6] x86/APX: optimize certain {nf}-form insns to LEA Jan Beulich
2024-06-14 12:14 ` [PATCH 5/6] x86/APX: optimize certain {nf}-form insns to BMI2 ones Jan Beulich
2024-06-17  6:36   ` Jiang, Haochen
2024-06-14 12:14 ` [PATCH 6/6] x86: optimize {,V}PEXTR{D,Q} with immediate of 0 Jan Beulich
2024-06-17  6:49   ` Jiang, Haochen
2024-06-17  8:56     ` Jan Beulich
2024-06-18  3:25       ` Jiang, Haochen
2024-06-18  6:14         ` Jan Beulich
2024-06-18  6:23           ` Jiang, Haochen
2024-06-18 20:37             ` H.J. Lu
2024-06-19  2:01               ` Jiang, Haochen
2024-06-17  2:51 ` Jiang, Haochen [this message]
2024-06-17  8:33   ` [PATCH 0/6] x86: a few more optimizations Jan Beulich
2024-06-17  8:09 ` Cui, Lili
2024-06-17  8:37   ` Jan Beulich
2024-06-17  9:12     ` Cui, Lili

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=SA1PR11MB5946989457F3E39E73E454E7ECCD2@SA1PR11MB5946.namprd11.prod.outlook.com \
    --to=haochen.jiang@intel.com \
    --cc=JBeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    --cc=lili.cui@intel.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).