Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp493719img; Mon, 18 Mar 2019 07:44:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZsZPwsNm8Iivn69VLeheEsHqFUysDd0JAR7ODsZTOHbfDgec3Cdxjpcio9TwgVYM9AB9E X-Received: by 2002:a17:902:801:: with SMTP id 1mr19616196plk.299.1552920251239; Mon, 18 Mar 2019 07:44:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552920251; cv=none; d=google.com; s=arc-20160816; b=GOdP8SZSFLxEJjyiobGCck6eI81EaAyZSjBw8KPVUgpG04lracmc4V+w5vFxqv+832 0sRxyqIsTfDGlNQwvqvt/vACaqhrmjNYePLojwsr83zgvv8yGI/LohtV/9Q49fRnOcBy Qa6kDnviAvYumUplC5cVHlrW+Fs9RTEOCmZBMP/GfAEmW68IqfvyywAAySOpAOFdLm3b Xxns2Ety9jhDTXmM+oWTWmolCe3zaUOb/WaM+saXiKUSxP3EGdGCEF7vjyP7o4C0BlF7 wQG9vfYt2qOUJrHZKMnEXxbCLAh5JY8x8h8XWS2UmQHEMk/gwSlhc9X8//B/1M768dZb NmgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=f0BI9ljRcfuM/eqF9TNuFpEoetXHsGAXD7tf5I0WZHY=; b=LOTmqZ4jp6lLTmWtuGBDgqgCzrMFf170n/104kaaP4vbXuOnDK/E2ZojgADLH5nCaE eHOQmjBDK5OZpcRYtnwzyNvKvV8Qg6uMcATrbCzy7Dk6/luDP4ztnIGXNR7aLXzVY8uZ 4wTKPtbF1HNBmKat8h4aoLYv5e8H/IRQCdEvPYbho4NBTZ5EP5xodyM09qyexatlLbe2 dIDRyh3WsrtqF7Dblyb26t6OS27m4FGev6GwrI2nzkg2gQpLy3aIJ3R4lzYd7MU8TnHf 2Wb0qoGr6nHCwP4bqA4b2xGHusNAuQXkGEAH+1hSwRgMsLkqxcMxWMD+4kNwWJJVlo0L d5YQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si2370979plo.92.2019.03.18.07.43.55; Mon, 18 Mar 2019 07:44:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727779AbfCROmr convert rfc822-to-8bit (ORCPT + 99 others); Mon, 18 Mar 2019 10:42:47 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:31393 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727368AbfCROmq (ORCPT ); Mon, 18 Mar 2019 10:42:46 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-95-H_8JvVFWPVmTL6SCSVCYcg-1; Mon, 18 Mar 2019 14:42:40 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 18 Mar 2019 14:43:42 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 18 Mar 2019 14:43:42 +0000 From: David Laight To: 'Peter Zijlstra' , Nick Desaulniers CC: Matthias Kaehlcke , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , "x86@kernel.org" , LKML , "Manoj Gupta" , Tiancong Wang , "Stephen Hines" , "clang-built-linux@googlegroups.com" , Miguel Ojeda Subject: RE: [PATCH] lib: Add shared copy of __lshrti3 from libgcc Thread-Topic: [PATCH] lib: Add shared copy of __lshrti3 from libgcc Thread-Index: AQHU3WswxUtxiFmvqk+nSxWryUVjeqYRdfkw Date: Mon, 18 Mar 2019 14:43:41 +0000 Message-ID: References: <20190318091428.GI6058@hirez.programming.kicks-ass.net> In-Reply-To: <20190318091428.GI6058@hirez.programming.kicks-ass.net> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: H_8JvVFWPVmTL6SCSVCYcg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra > Sent: 18 March 2019 09:14 > On Fri, Mar 15, 2019 at 03:06:37PM -0700, Nick Desaulniers wrote: > > On Fri, Mar 15, 2019 at 1:54 PM Matthias Kaehlcke wrote: > > > > > > The compiler may emit calls to __lshrti3 from the compiler runtime > > > library, which results in undefined references: > > > > > > arch/x86/kvm/x86.o: In function `mul_u64_u64_shr': > > > include/linux/math64.h:186: undefined reference to `__lshrti3' > > > > Looks like Clang will emit this at -Oz (but not -O2): > > https://godbolt.org/z/w1_2YC > > *OMG*, what is that compiler smoking and why do we want that? > > It doesn't even do that for "-Os". I like the way it moves %edx to %ecx, then %cl to %ecx and finally %ecx back to %edx. I'm guessing this is all made worse by the prototype containing 'char' not 'int'. I'm sure the register tracking gets worse in every version of gcc. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)