From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56CC4C433FE for ; Thu, 10 Dec 2020 14:42:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B24F22065E for ; Thu, 10 Dec 2020 14:42:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B24F22065E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knN9N-000412-Gu for qemu-devel@archiver.kernel.org; Thu, 10 Dec 2020 09:42:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knN04-0004S7-SK for qemu-devel@nongnu.org; Thu, 10 Dec 2020 09:32:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1knN00-00013z-Li for qemu-devel@nongnu.org; Thu, 10 Dec 2020 09:32:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607610771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rtNjAtow8SQkrLmz8+XRRA+YtRhz+KF6e43NFXvxDSI=; b=TWjFleb5lvlkK2DaUKlbuIvAhYTHiiLwdUAgNzmAEBa4twQaCFMYCke73vmbl9Vi5UT0yZ 25MSrD3Vh2weKk/n9sZD4ASph1LNyQcNneNxvNd+lim2WsPigP1NfE/z2WT1i1uLkXNfX6 9XfC2KQff5rBV+aI3JZfKFUyIMKe6Ao= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-GXfhmJmXPiahFJ046SqmjA-1; Thu, 10 Dec 2020 09:32:49 -0500 X-MC-Unique: GXfhmJmXPiahFJ046SqmjA-1 Received: by mail-wr1-f71.google.com with SMTP id w9so739433wrt.2 for ; Thu, 10 Dec 2020 06:32:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rtNjAtow8SQkrLmz8+XRRA+YtRhz+KF6e43NFXvxDSI=; b=Vh2txgbQyc/4/cGN6GVKFDIIt49caaDraBhlFzc2Zh8USB7a9MgdpmGZUM36R0F+5q Tzahec45ZcD7uKqSk7K6Uk/BZQ3bC78U6c7rUKIYjx8Y4NdVKcRNSxFkv3vW/fHflCIB TiqVlE7WIiCWXekH/+48vIa1U0UYZByWPBqUHZj55E9RVu+nkA2FEQvNl6qS2magQcQ3 V6tCOr92qci4m+91ksV8KVVvS+0W9BoGBJR3bHD1FQYJoxUnFGZsYMoAA/OPwBQpf7iN eAybIyEHhe0a8Bu0pXbzZf0mOj7xiqfWHP8BqtJYWzKuDiLq/l7MVb9lwN+gLZYhTsFp bwJA== X-Gm-Message-State: AOAM532ohnKYfZpXgc/QdwDGO64QeybPu7fH4VZje23PmijRMDys+0Yb 7tXJbVd7zjptMrvYLKf0LHUHb4dIdJz8q9Q9GlYWTXuKPRgh+M+tyrqSG5jz+88FXPk/Qpr8IRY XxbxTV4WjgWcG3rU= X-Received: by 2002:a7b:c04c:: with SMTP id u12mr8855729wmc.185.1607610768402; Thu, 10 Dec 2020 06:32:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvghq2Cu/Yzn0V6T8HyFCC4QgkWnmvztae8ydvZyqC4LvjfyNnoaYdKanep7mP2UKqi7czEA== X-Received: by 2002:a7b:c04c:: with SMTP id u12mr8855692wmc.185.1607610768234; Thu, 10 Dec 2020 06:32:48 -0800 (PST) Received: from [192.168.1.36] (101.red-88-21-206.staticip.rima-tde.net. [88.21.206.101]) by smtp.gmail.com with ESMTPSA id z13sm9898753wmz.3.2020.12.10.06.32.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Dec 2020 06:32:47 -0800 (PST) Subject: Re: [PATCH v3 03/13] compiler.h: remove GCC < 3 __builtin_expect fallback To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org References: <20201210134752.780923-1-marcandre.lureau@redhat.com> <20201210134752.780923-4-marcandre.lureau@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Thu, 10 Dec 2020 15:32:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201210134752.780923-4-marcandre.lureau@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefano Stabellini , Paul Durrant , Richard Henderson , Laurent Vivier , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Anthony Perard , xen-devel@lists.xenproject.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 12/10/20 2:47 PM, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > Since commit efc6c07 ("configure: Add a test for the minimum compiler > version"), QEMU explicitely depends on GCC >= 4.8. > > (clang >= 3.4 advertizes itself as GCC >= 4.2 compatible and supports > __builtin_expect too) > > Signed-off-by: Marc-André Lureau > --- > include/qemu/compiler.h | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h > index c76281f354..226ead6c90 100644 > --- a/include/qemu/compiler.h > +++ b/include/qemu/compiler.h > @@ -44,10 +44,6 @@ > #endif > > #ifndef likely > -#if __GNUC__ < 3 > -#define __builtin_expect(x, n) (x) > -#endif > - > #define likely(x) __builtin_expect(!!(x), 1) > #define unlikely(x) __builtin_expect(!!(x), 0) > #endif > Trying with GCC 10: warning: implicit declaration of function ‘likely’ [-Wimplicit-function-declaration] Clang 10: warning: implicit declaration of function 'likely' is invalid in C99 [-Wimplicit-function-declaration] Shouldn't it becleaner to test in the configure script or Meson that likely() and unlikely() are not defined, and define them here unconditionally? Regards, Phil. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58DBEC433FE for ; Thu, 10 Dec 2020 14:33:12 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DFD2123E52 for ; Thu, 10 Dec 2020 14:33:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFD2123E52 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.49361.87286 (Exim 4.92) (envelope-from ) id 1knN04-00050r-At; Thu, 10 Dec 2020 14:32:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 49361.87286; Thu, 10 Dec 2020 14:32:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1knN04-00050k-7h; Thu, 10 Dec 2020 14:32:56 +0000 Received: by outflank-mailman (input) for mailman id 49361; Thu, 10 Dec 2020 14:32:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1knN02-00050f-D5 for xen-devel@lists.xenproject.org; Thu, 10 Dec 2020 14:32:54 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [63.128.21.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 614244d8-b27b-4c1e-a11a-c37b5ae26ba0; Thu, 10 Dec 2020 14:32:53 +0000 (UTC) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-32-cvAPxXi3PPiANXlANUmJMw-1; Thu, 10 Dec 2020 09:32:49 -0500 Received: by mail-wr1-f72.google.com with SMTP id p18so1988321wro.9 for ; Thu, 10 Dec 2020 06:32:49 -0800 (PST) Received: from [192.168.1.36] (101.red-88-21-206.staticip.rima-tde.net. [88.21.206.101]) by smtp.gmail.com with ESMTPSA id z13sm9898753wmz.3.2020.12.10.06.32.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Dec 2020 06:32:47 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 614244d8-b27b-4c1e-a11a-c37b5ae26ba0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607610773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rtNjAtow8SQkrLmz8+XRRA+YtRhz+KF6e43NFXvxDSI=; b=IW7tPMlmxQR+yENluLsy7ds+4O4Kpa2rm00nb1e2dPQ2WrjKDHQtXCilEQR20GCK8q36d0 OzKai3LzdY7y0rsQtU/kW8+YOydsR/GTQRouG4q41UGrkADjxSDtk6XZnbrfg7b6RSd0qG ddT5RqSII1iMcRPgt86rE0HPWag78Rg= X-MC-Unique: cvAPxXi3PPiANXlANUmJMw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rtNjAtow8SQkrLmz8+XRRA+YtRhz+KF6e43NFXvxDSI=; b=ZQTKNK8Ey7j9E0rhjzOQbsyxVyJg5L+Lpa1WQJUtLz9Q8AKlbk+VCtRR2ihZHVLI6t hTH+5TvBPfxI/q3Jh2Nt10m2gQuzHklgWP0a1ywhcYVbiBmUH8cKHK/hzMlpiuAcb5aX 9BXdm/+VHZfm2l+/uCn8QAv3iEe9UEWo25G5auj9qA224m38HgU3vYg77fa55eLIwnEg jvdSLebOA+veb/iTdomx0FX5ZwjBSNOBT1fcWk8nY4qfh26VzePU6Ak4j/7NZ86tk5mj YMtVzYyvn27vitgsdgg0BVhTnU/SZaZjFBYJVaM18Qq0kpxPEBxTCizPawQfBJmcc4gw NTgw== X-Gm-Message-State: AOAM531YQw7ZrZL6q+B601pDUso+HpFd766SO46ynrjVsqkWZY0AaiU4 0Og+9CmHigbj7KlKeum/6i9C3Jj9DdCFuDrLlap8SVRcInBwjqq9bIefU4bBQB2ze3bjdTr22MH Yni+EEkw8BGF0GdU8HlT05sJpM+w= X-Received: by 2002:a7b:c04c:: with SMTP id u12mr8855716wmc.185.1607610768368; Thu, 10 Dec 2020 06:32:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvghq2Cu/Yzn0V6T8HyFCC4QgkWnmvztae8ydvZyqC4LvjfyNnoaYdKanep7mP2UKqi7czEA== X-Received: by 2002:a7b:c04c:: with SMTP id u12mr8855692wmc.185.1607610768234; Thu, 10 Dec 2020 06:32:48 -0800 (PST) Subject: Re: [PATCH v3 03/13] compiler.h: remove GCC < 3 __builtin_expect fallback To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: Richard Henderson , Laurent Vivier , Paul Durrant , xen-devel@lists.xenproject.org, Stefan Hajnoczi , Gerd Hoffmann , Stefano Stabellini , Anthony Perard , "Dr. David Alan Gilbert" , qemu-arm@nongnu.org, Paolo Bonzini , Peter Maydell References: <20201210134752.780923-1-marcandre.lureau@redhat.com> <20201210134752.780923-4-marcandre.lureau@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Thu, 10 Dec 2020 15:32:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201210134752.780923-4-marcandre.lureau@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 12/10/20 2:47 PM, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > Since commit efc6c07 ("configure: Add a test for the minimum compiler > version"), QEMU explicitely depends on GCC >= 4.8. > > (clang >= 3.4 advertizes itself as GCC >= 4.2 compatible and supports > __builtin_expect too) > > Signed-off-by: Marc-André Lureau > --- > include/qemu/compiler.h | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h > index c76281f354..226ead6c90 100644 > --- a/include/qemu/compiler.h > +++ b/include/qemu/compiler.h > @@ -44,10 +44,6 @@ > #endif > > #ifndef likely > -#if __GNUC__ < 3 > -#define __builtin_expect(x, n) (x) > -#endif > - > #define likely(x) __builtin_expect(!!(x), 1) > #define unlikely(x) __builtin_expect(!!(x), 0) > #endif > Trying with GCC 10: warning: implicit declaration of function ‘likely’ [-Wimplicit-function-declaration] Clang 10: warning: implicit declaration of function 'likely' is invalid in C99 [-Wimplicit-function-declaration] Shouldn't it becleaner to test in the configure script or Meson that likely() and unlikely() are not defined, and define them here unconditionally? Regards, Phil.