lkml.org 
[lkml]   [2018]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86: Use assembly instruction mnemonics instead of .byte streams in arch_hweight.h
On Sun, Oct 14, 2018 at 8:47 PM Borislav Petkov <bp@alien8.de> wrote:
>
> On Sun, Oct 14, 2018 at 08:35:10PM +0200, Uros Bizjak wrote:
> > Recently the minimum required version of binutils was changed to 2.20,
> > which supports popcnt instruction mnemonics. The patch removes
> > all .byte #defines and uses real instruction mnemonics instead.
>
> What is "real insertion mnemonics" ?

The ChangeLog says "real INSTRUCTION mnemonics", e.g. POPCNTQ and POPCNTL.

> To me it looks like this patch replaces our defines with binutils'
> defines and frankly, if it ain't broke, why fix it...

The compiler will generate the register name with the correct implied
width (e.g. %rax for long, %eax for int), so the assembler will be
able to cross check if operands fit the instruction (this issue
happened in KVM, see [1]). And there will be a couple of ugly #defines
less.

[1] https://www.spinics.net/lists/kvm/msg176184.html

Uros.

\
 
 \ /
  Last update: 2018-10-14 21:15    [W:1.734 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site