mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jan Beulich <JBeulich@suse.com>, mingo@elte.hu, tglx@linutronix.de
Cc: davem@davemloft.net, dborkman@redhat.com, ffusco@redhat.com,
	tgraf@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] x86/hash: fix build failure with older binutils
Date: Fri, 21 Feb 2014 04:51:53 -0800	[thread overview]
Message-ID: <68ae560f-8cf7-4083-816f-3fa78aed9a87@email.android.com> (raw)
In-Reply-To: <53073962020000780011E2DE@nat28.tlf.novell.com>

How old?

On February 21, 2014 2:32:50 AM PST, Jan Beulich <JBeulich@suse.com> wrote:
>Just like for other ISA extension instruction uses we should check
>whether the assembler actually supports them. The fallback here simply
>is to encode an instruction  with fixed operands (%eax and %ecx).
>
>Signed-off-by: Jan Beulich <jbeulich@suse.com>
>Cc: Francesco Fusco <ffusco@redhat.com>
>Cc: Daniel Borkmann <dborkman@redhat.com>
>Cc: Thomas Graf <tgraf@redhat.com>
>Cc: David S. Miller <davem@davemloft.net>
>---
> arch/x86/Makefile   |    1 +
> arch/x86/lib/hash.c |    4 ++++
> 2 files changed, 5 insertions(+)
>
>--- 3.14-rc3-x86-hash-crc32.orig/arch/x86/Makefile
>+++ 3.14-rc3-x86-hash-crc32/arch/x86/Makefile
>@@ -152,6 +152,7 @@ cfi-sections := $(call as-instr,.cfi_sec
> 
> # does binutils support specific instructions?
> asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1)
>+asinstr += $(call as-instr,crc32l
>%eax$(comma)%eax,-DCONFIG_AS_CRC32=1)
>avx_instr := $(call as-instr,vxorps
>%ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1)
>avx2_instr :=$(call as-instr,vpbroadcastb
>%xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1)
> 
>--- 3.14-rc3-x86-hash-crc32.orig/arch/x86/lib/hash.c
>+++ 3.14-rc3-x86-hash-crc32/arch/x86/lib/hash.c
>@@ -39,7 +39,11 @@
> 
> static inline u32 crc32_u32(u32 crc, u32 val)
> {
>+#ifdef CONFIG_AS_CRC32
> 	asm ("crc32l %1,%0\n" : "+r" (crc) : "rm" (val));
>+#else
>+	asm (".byte 0xf2, 0x0f, 0x38, 0xf1, 0xc1" : "+a" (crc) : "c" (val));
>+#endif
> 	return crc;
> }
> 

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

  reply	other threads:[~2014-02-21 12:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 10:32 Jan Beulich
2014-02-21 12:51 ` H. Peter Anvin [this message]
2014-02-21 14:16   ` Jan Beulich
2014-02-21 19:17     ` H. Peter Anvin
2014-02-24  7:56       ` Jan Beulich
2014-02-24 11:57         ` H. Peter Anvin

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 \
    --in-reply-to=68ae560f-8cf7-4083-816f-3fa78aed9a87@email.android.com \
    --to=hpa@zytor.com \
    --cc=JBeulich@suse.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=ffusco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=tgraf@redhat.com \
    /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

Powered by JetHome