public inbox for [email protected]
 help / color / mirror / Atom feed
From: Kanna Scarlet <[email protected]>
To: David Laight <[email protected]>
Cc: Borislav Petkov <[email protected]>,
	Thomas Gleixner <[email protected]>,
	Ingo Molnar <[email protected]>,
	Dave Hansen <[email protected]>,
	"H. Peter Anvin" <[email protected]>,
	"[email protected]" <[email protected]>,
	Ard Biesheuvel <[email protected]>,
	Bill Metzenthen <[email protected]>,
	Brijesh Singh <[email protected]>,
	Joerg Roedel <[email protected]>,
	Josh Poimboeuf <[email protected]>,
	"Kirill A. Shutemov" <[email protected]>,
	Mark Rutland <[email protected]>,
	Michael Roth <[email protected]>,
	Peter Zijlstra <[email protected]>,
	Sean Christopherson <[email protected]>,
	Steven Rostedt <[email protected]>,
	Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	Linux Kernel Mailing List <[email protected]>
Subject: Re: [PATCH 1/1] x86: Change mov $0, %reg with xor %reg, %reg
Date: Mon, 8 Aug 2022 23:38:34 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 8/5/22 4:26 PM, David Laight wrote:
> Use "xor %rax,%rax" instead of "xor %eax,%eax" to save
> the 'reg' prefix.

hello David Laight

"xor %rax,%rax" is bigger because of rex prefix, "xor %eax,%eax" is smaller
because it doesn't need rex prefix.

asm:
    0:   48 31 c0  xor    %rax,%rax
    3:   31 c0     xor    %eax,%eax

so i think to save from rex prefix, use xor %eax,%eax instead of xor %rax,%rax.

Best regards,
-- 
Kanna Scarlet


  parent reply	other threads:[~2022-08-08 16:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 15:26 [PATCH 0/1] x86 change mov 0, %reg to xor %reg, %reg Kanna Scarlet
2022-08-04 15:26 ` [PATCH 1/1] x86: Change mov $0, %reg with " Kanna Scarlet
2022-08-04 15:53   ` Borislav Petkov
2022-08-04 18:08     ` Kanna Scarlet
2022-08-05  9:26       ` David Laight
2022-08-05  9:42         ` Joerg Roedel
2022-08-08 16:45           ` Kanna Scarlet
2022-08-08 18:59             ` H. Peter Anvin
2022-08-08 16:38         ` Kanna Scarlet [this message]
2022-08-08 18:59         ` H. Peter Anvin
2022-08-09  7:38           ` David Laight
2022-08-05  9:54       ` Borislav Petkov
2022-08-08 16:57         ` Kanna Scarlet

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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