Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3166598imm; Sun, 14 Oct 2018 13:15:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV63nBPf3T1v+V8epKaj3UKLM0JD+ZyDnAKse3lImbwAhCWOUbwDg+jYgio4kxVmhmDU+B+Qh X-Received: by 2002:a62:7501:: with SMTP id q1-v6mr14557153pfc.225.1539548151004; Sun, 14 Oct 2018 13:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539548150; cv=none; d=google.com; s=arc-20160816; b=A8WGSmr+HchcUAqlEztQ/TFaZgE3vI7k/IIGVr4OsdrseBJ+bEgS9IPt8a5CHEQBek dRvX+KAavJvbhIZXqNEIgpFauves1rKdygDf8zfl7Wjc6l9M2cWT0WSJEgvOoioS20mH MaaINgmxQ7Ii7siDIDWd96c+gPaqcgxpRpE0AFo27uKoC6SI0DLlGBP6JYaAqpGeRhJa VR8mYTPuCD0sL7RWAV1LjhYE5L2IsucrCvQBtRKCVfTrjuo5UxP8QoN6+o09O18Fl2oD cN8CXAgCvTrHru4obBnKwIvK2IU5RcN3/dTSSr6+bl9QCHPAZVZJmsYRKOrHKjRJq0wO X/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=RAQ38ah8uCjsVHqzg+gh4nwD8zCj5gMLSbXY2BCKheA=; b=uQE2pp5N+e8pNiZoK7HtR8eBe9GOGFkOJpwrRd1GqXZQXld2F/rbFRU8LfRjlFXUWa YNi0PVOZFpdajX2k7klc9WnYcmtysy5pFIG2yobDDdOv7gjHawRKO7Nth1F9ljTCbtFQ GlbnbDm54uZLalwW26SXkOzuhq8PA8aTjsk0jvULoFmZF1ElgINpqDNFeth3YBd04007 XftbGzVvZiXhusB3Hx0LHst1hcMXkJWUMDa3KNn/Y+IaZ2Ig/hH5ubCJV1bESGWmV9z2 8pfC7C5uEM/4yZo9Siy3ZgcFBXu0LAehsSgMVhPHKeyPub9ibnvCmNns9RjJ/wE48Vf2 XKIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="U1/XKBdO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4-v6si8314232pfg.90.2018.10.14.13.15.22; Sun, 14 Oct 2018 13:15:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="U1/XKBdO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbeJOD45 (ORCPT + 99 others); Sun, 14 Oct 2018 23:56:57 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:37693 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbeJOD44 (ORCPT ); Sun, 14 Oct 2018 23:56:56 -0400 Received: by mail-it1-f196.google.com with SMTP id e74-v6so24842699ita.2 for ; Sun, 14 Oct 2018 13:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RAQ38ah8uCjsVHqzg+gh4nwD8zCj5gMLSbXY2BCKheA=; b=U1/XKBdO0Vtv5kmRktMewrWS9PdXwME0wFtHkEAjLvEsC7HmxZSHeXUWhvft9SHALi vEztysjO0uT87XW3T8OisLxqAiUuRbi+c5XPgiL+MjAGKVG4jpe7LLo2CEvX0cyBjqpm 55ufkTmEgvL6z1WFbWst6AdKMcE5ls1WvWY+Bfzx4VG6U8BSI0wd2lEgl9HusSagonqW RYuxgK/NwN1Ee8jiCiZMPDSwCCpm5GYlPKTv5Jorr7Ro04M8FJxRNM5oplyeDfE1CKV0 W/UXFQ9Pq4Hw2/7HQrZgAj9RhT14YQFbZmiq3/FVm7OsFF01SfA9XCEEPoqtL85aQbhk M3+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RAQ38ah8uCjsVHqzg+gh4nwD8zCj5gMLSbXY2BCKheA=; b=gpq2RPwYboyZMwXsp80EmsnKX+lUaZdV7nhrDDhdpDaKzn/H4E87TDvZ5LfLMk4NKg NBSK2qjAj2g4DRoUpAAcov19oDEf34Tjxi8zFpau8oNE9zlE+QDdgXKQbn4sgWhX15ei L92G/AAOsaeBD7B0rbItBTevipmVWRM+kClsyNAm5YPbOpop9E7/DfIZrX9Owo5rBy+q U5QeoVMz/xcIImE/Ml6rHUCJnfp8YCz3u6JJo/vwSkF2laFKCVR5/VDlbkOMKEW3uEZP 8YnufNHlEs6ms2ErRZ7of6sXv2KlF8ij7aWF5SjlzHf9XPGCCZCWu8dY6fMhBCRnz0oD cbrQ== X-Gm-Message-State: ABuFfogjR+dlSmooJ1BV+hV7RCJpiZuOLXjxT0y/pQZga4o7X0wfrheU 0JdjJkECjQ3kgK+98nuwr+VdUs6Ynik0EikjZJoQ8w== X-Received: by 2002:a02:85a3:: with SMTP id d32-v6mr11904073jai.69.1539548087190; Sun, 14 Oct 2018 13:14:47 -0700 (PDT) MIME-Version: 1.0 References: <20181014183510.18908-1-ubizjak@gmail.com> <20181014184735.GC7667@zn.tnic> <20181014200241.GD7667@zn.tnic> In-Reply-To: <20181014200241.GD7667@zn.tnic> From: Uros Bizjak Date: Sun, 14 Oct 2018 22:14:35 +0200 Message-ID: Subject: Re: [PATCH] x86: Use assembly instruction mnemonics instead of .byte streams in arch_hweight.h To: bp@alien8.de Cc: x86@kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 14, 2018 at 10:02 PM Borislav Petkov wrote: > > On Sun, Oct 14, 2018 at 09:15:00PM +0200, Uros Bizjak wrote: > > The ChangeLog says "real INSTRUCTION mnemonics", e.g. POPCNTQ and POPCNTL. > > Right, INSTRUCTION. > > > 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 > > The __arch_hweightXX functions already enforce the proper type and > the inline asm() operands already place the arguments in the proper > registers where the instruction encoding expects them. > > So if you're going to relax this, then you could relax the inline asm > operand specifications too. I say you "could" because then you need to > fix arch/x86/lib/hweight.S too, which would be at least ugly. So I think > we're stuck with %xDI/xAX and %xAX as operands, where 'x' is either 'r' > or 'e'. > > > And there will be a couple of ugly #defines less. > > That's the only advantage of this change AFAICT. How about you reflect > that in your commit message? No problem, will send v2 with amended message. Uros.