[lkml]   [2020]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [GIT PULL] x86/asm updates for v5.10
+ 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 <> 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


 \ /
  Last update: 2020-10-12 21:00    [W:0.125 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site