public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/6] x86: a few more optimizations
@ 2024-06-14 12:10 Jan Beulich
  2024-06-14 12:12 ` [PATCH 1/6] x86: optimize left-shift-by-1 Jan Beulich
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Jan Beulich @ 2024-06-14 12:10 UTC (permalink / raw)
  To: Binutils; +Cc: H.J. Lu, Lili Cui

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.

Thoughts?

Plus: Since, even if leaving out the further ones above, there are
quite a few {nf}-specific ones, I was wondering whether it would make
sense to put those in a separate optimize_nf_encoding() function, to
somewhat limit optimize_encoding()'s growth.

Two non-{nf} ones are here in addition, as I came to think of them
while doing the preparations / work.

1: optimize left-shift-by-1
2: optimize {nf} forms of ADD/SUB with immediate of 0x80
3: optimize {nf}-form rotate-by-width-less-1
4: optimize certain {nf}-form insns to LEA
5: optimize certain {nf}-form insns to BMI2 ones
6: optimize {,V}PEXTR{D,Q} with immediate of 0

Jan

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-06-19  2:01 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-14 12:10 [PATCH 0/6] x86: a few more optimizations 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 ` [PATCH 0/6] x86: a few more optimizations Jiang, Haochen
2024-06-17  8:33   ` Jan Beulich
2024-06-17  8:09 ` Cui, Lili
2024-06-17  8:37   ` Jan Beulich
2024-06-17  9:12     ` Cui, Lili

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).