From patchwork Sat Mar 8 18:50:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 328230 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 957FD2C0091 for ; Sun, 9 Mar 2014 05:51:11 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=aZsOaT1l79K+A6p1yCjOYVcdalnzmMDi3uGK7bdXBaoilc LDzKS3Oo9hfjNUwcTIbQTEIeYD27ENAof/NHwLWYy+yW2D1m8IFlGSTzDMyKqhZA ONmwqZ2qMFLmVuvSz7L/QLcIQaVVRmbD59TFEB6sSA6qEOTmNhc8FJsVkJ+nY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=otb4z310wxrnKzjBtEoJKVJgV88=; b=gy6QnGStf8qfWybj7oOE 6FM8Pcnr1muFZSV0hH92VdXX4IbmL8CrIOZjJQ6ZCanQWOnSma6CfTXLw/XcqIr6 uGhs4azUCDaDu/ccZDFldp7d4NmpIkjWqTXCiA8oO9xWcpUZroyIyAv4MOdeqaWD boswQhVtix4hWQw/Lv5nvMA= Received: (qmail 13614 invoked by alias); 8 Mar 2014 18:50:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 13595 invoked by uid 89); 8 Mar 2014 18:50:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx02.qsc.de Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 08 Mar 2014 18:50:57 +0000 Received: from tux.net-b.de (port-92-194-14-144.dynamic.qsc.de [92.194.14.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPSA id 65D6827663; Sat, 8 Mar 2014 19:50:53 +0100 (CET) Message-ID: <531B668D.8050301@net-b.de> Date: Sat, 08 Mar 2014 19:50:53 +0100 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: gcc-patches , gfortran Subject: [Patch, libgfortran] Add a comment to libgfortran.h explaining what the (un)likely() macros do OK for the trunk? Tobias diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index d7e15ad..2664e1f 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -97,6 +97,16 @@ typedef off_t gfc_offset; #define NULL (void *) 0 #endif + +/* The following macros can be used to annotate conditions which are likely or + unlikely to be true. Avoid using them when a condition is only slightly + more likely/less unlikely than average to avoid the performance penalties of + branch misprediction. In addition, as __builtin_expect overrides the compiler + heuristic, do not use in conditions where one of the branches ends with a + call to a function with __attributee__((noreturn)): the compiler internal + heuristic will mark this branch as much less likely as unlikely() would + do. */ + #ifndef __GNUC__ #define __attribute__(x) #define likely(x) (x)