Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2042611ybk; Mon, 11 May 2020 10:27:44 -0700 (PDT) X-Google-Smtp-Source: APiQypJiz/VXypaxF7cW52VI3BUxMTAZMk5P/q/gXmDmi4omWjpuPxDGtihtK4TyjGbmPiY95rMI X-Received: by 2002:aa7:d2d7:: with SMTP id k23mr7363234edr.358.1589218064074; Mon, 11 May 2020 10:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589218064; cv=none; d=google.com; s=arc-20160816; b=NmNBnIbFfX7JK3rr6HgvkE+iBnwSymbwEhWwVi1+8EYMbFSUqia+pEarOPmFAVsO0f 8VjRsjy8HdHyQXEaw7EGoHOoSpnMyFQRYFrTNdEPzLC0Ur2vpoh3vK9xqaqGyhuzUFZb zCYT0cMaHYtD2/ip+DQoCGBXN89m9ohbqp/0dRi60KbmQ+un7/rCRX6dkr8CeF+Ku/J5 DXTm63XaoheW7dr0V1qk3LUlw/EQ5QT40GRQzpEBGXh6rABxwI18AdGtc8SpAsEDYwK1 b8ou30xElkaBujIHO8NmB2x/rQBoZSKsWSUFC+BLImidBL+YSuOCxHvNH+YXwrFmTOxY Xigw== 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=qlU0Pkz6j22HfbQ80ouXzz2uZEOYNyQ2PJlwm4Zo3WQ=; b=e7E6I9f+sZTNc3J3avpPrRKj1T72LB9F9CLCaoN4NtvnKum6vF8EZ1CszKRQmWJkHk Vn+tbA0veuLZwOS9OLShHE6ajwB2vlsRCNGYkwThx61w8AHMRKyp8xJQbx7HaUycoESo US74ffoJSXlH00JpMTJCeMfz9YlscPiGnZymTs1OvGht5HfDLwZ+cmamJ9XmISaQGPBI Ds6qCz5rmzvaYEYDmcwuiEuFfUmul+QEkaXyI8LJJx0LBiqPJkzuQn4t4IMn/bGIc66/ WPFGT2AzWxn1ApiUroSmM5iAcGMGQ8b6NuI5ec/cUCYNXs3Mk+YT+GNm+30RSvy6o4zH Ti9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rPnvvhM7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si6947233edt.371.2020.05.11.10.27.19; Mon, 11 May 2020 10:27:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rPnvvhM7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730887AbgEKRXF (ORCPT + 99 others); Mon, 11 May 2020 13:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730730AbgEKRXF (ORCPT ); Mon, 11 May 2020 13:23:05 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12EC9C061A0C for ; Mon, 11 May 2020 10:23:05 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id z1so5041817pfn.3 for ; Mon, 11 May 2020 10:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qlU0Pkz6j22HfbQ80ouXzz2uZEOYNyQ2PJlwm4Zo3WQ=; b=rPnvvhM7pnMqt96kcVjKpglyVZo17KrilC53ASlRznUT2hq5aRipQwuwIxw9iLFa0K laAZufC5GyLRiPWpjffqW3E08CTCXsiWClNyPeb2N060+P3ZDVoPxBgN6OCFDHx0J0JG c4go7yGcLP9Xf5+2+fLnboHalXp4SJWEFcgWxhljhYlVlAydacAyRPzV1k/zMNq7+r9l OAMzcnu01ah2Kt2ZycSxc/UNU2aJ4A2Ra427kpMT0ZWfNnZIs+l72hsxNKdSGMxG9wcd P1D2Cfq2HNET8q7C50DCQjuEtvKgoJs7bAUebMZmFZFIfjdpGKjLOWllEWLZxYoQXVO9 ch9A== 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=qlU0Pkz6j22HfbQ80ouXzz2uZEOYNyQ2PJlwm4Zo3WQ=; b=p9j6vammx/X1qwIvIN5M++0fKAXndvkoFPl1RPGnVj/FCz+BTA9xm8kbovsb8pHgkw sYw5RZX9coCZPsfsn2r+/cn7fvVBACHrk2+C521MxJTAeC+v7JmUbNLZGbYzmy/KE2RJ zB7tiAXkojyGO8kbrvIShAK02ojq9OJSav9TvxoWz1kO0k2o6xuLlJhDOSvMw1uLAS+n pF+PszLRLka9/2tMUdHmtSvvxy4HweQOfHYg78KRw1Ayym26IQkan3okiDElRM3w/Z8c gmK4XLri+/DlPYCfT9BhNlxjilI6Cz0+Nxb7Rqz1Tp0th9B8y/ruYNPBxa/VGHZajjOG NHhg== X-Gm-Message-State: AGi0PuZErHqAQtNf3thM8DsJMvl+kLsSw4wXiR5p9+/Lt4WzppuNUGDN QsFEw1bxlYbLyT+pZah68q1qJY2BuFKPRBSGxkMyKA== X-Received: by 2002:a63:6546:: with SMTP id z67mr15178554pgb.10.1589217784231; Mon, 11 May 2020 10:23:04 -0700 (PDT) MIME-Version: 1.0 References: <20200508182835.228107-1-ndesaulniers@google.com> <20200508183230.229464-1-ndesaulniers@google.com> In-Reply-To: From: Nick Desaulniers Date: Mon, 11 May 2020 10:22:50 -0700 Message-ID: Subject: Re: [PATCH v5] x86: bitops: fix build regression To: Andy Shevchenko Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Jesse Brandeburg , Sedat Dilek , "kernelci . org bot" , Andy Shevchenko , Brian Gerst , "H . Peter Anvin" , Ilie Halip , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Marco Elver , "Paul E. McKenney" , Andrey Ryabinin , Luc Van Oostenryck , Andrew Morton , Masahiro Yamada , Daniel Axtens , "Peter Zijlstra (Intel)" , Linux Kernel Mailing List , clang-built-linux 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 Sat, May 9, 2020 at 5:20 AM Andy Shevchenko wrote: > > On Fri, May 8, 2020 at 9:35 PM Nick Desaulniers wrote: > > > > This is easily reproducible via CC=clang+CONFIG_STAGING=y+CONFIG_VT6656=m. > > > > It turns out that if your config tickles __builtin_constant_p via > > differences in choices to inline or not, these statements produce > > invalid assembly: > > > > $ cat foo.c > > long a(long b, long c) { > > asm("orb\t%1, %0" : "+q"(c): "r"(b)); > > return c; > > } > > $ gcc foo.c > > foo.c: Assembler messages: > > foo.c:2: Error: `%rax' not allowed with `orb' > > > > Use the `%b` "x86 Operand Modifier" to instead force register allocation > > to select a lower-8-bit GPR operand. > > > > The "q" constraint only has meaning on -m32 otherwise is treated as > > "r". Not all GPRs have low-8-bit aliases for -m32. > > > > Looks very good! > One question though, does it work with minimum supported version of gcc? Yes; the oldest version of GCC in godbolt.org is GCC 4.1.2 which supports the syntax and generates the expected lower-8-bit register operands. -- Thanks, ~Nick Desaulniers