Linux-Toolchains Archive at lore.kernel.org
 help / color / Atom feed
* Re: [GIT PULL] x86/asm updates for v5.10
       [not found]     ` <CAHk-=whbEhjSHR7D=8Q_xARd=UKHGcz750LoT1BeRdgTR+6uSw@mail.gmail.com>
@ 2020-10-12 18:59       ` Borislav Petkov
  0 siblings, 0 replies; only message in thread
From: Borislav Petkov @ 2020-10-12 18:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Uros Bizjak, x86-ml, lkml, linux-toolchains

+ linux-toolchains@vger.kernel.org for clang folks...

On Mon, Oct 12, 2020 at 11:56:45AM -0700, Linus Torvalds wrote:
> On Mon, Oct 12, 2020 at 11:41 AM Uros Bizjak <ubizjak@gmail.com> wrote:
> >
> > GCC does not distinguish between %ah and %al and it is not possible to pass "%ah" to the assembly. To access the high part of the %ax register, %h modifier has to be used in the assembly template.
> 
> Do you know whether that's true for clang too, for example?
> 
> Also note that even if the _asm_ might get "%al", maybe the compiler
> decided to use "%ah" for something else?
> 
> I have memories of gcc using the high registers at some point, but it
> might have been some special case code - and it might also be very
> historical.
> 
> [ Goes off and checks ]
> 
> In fact, I can still find gcc generating high register code, although
> it's quite possible that yes, it's only peephole bit extract
> instruction kind of use..
> 
> I also find that clang generates code that uses the high byte
> registers, although again, that's not from any knowledge of clang
> internals, and just by looking at my kernel image disassembly.
> 
> So yes, it _may_ all be just peepholes, but it's not obvious that this
> is all safe.
> 
>                    Linus

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201012110557.GK25311@zn.tnic>
     [not found] ` <CAHk-=wiVoLoZS1v9SCQzH4mkpz6akE3pPrHPxM2hamOXPcaW9w@mail.gmail.com>
     [not found]   ` <CAFULd4Z1_UKN6haGbNJMi0_tGddPZcawRDfoYnLdn-Qe6UR3-Q@mail.gmail.com>
     [not found]     ` <CAHk-=whbEhjSHR7D=8Q_xARd=UKHGcz750LoT1BeRdgTR+6uSw@mail.gmail.com>
2020-10-12 18:59       ` [GIT PULL] x86/asm updates for v5.10 Borislav Petkov

Linux-Toolchains Archive at lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-toolchains/0 linux-toolchains/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-toolchains linux-toolchains/ https://lore.kernel.org/linux-toolchains \
		linux-toolchains@vger.kernel.org
	public-inbox-index linux-toolchains

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-toolchains


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git