From patchwork Wed Aug 15 22:07:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Fuerst X-Patchwork-Id: 1330211 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 29C7440210 for ; Thu, 16 Aug 2012 07:46:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E42D09F3C5 for ; Thu, 16 Aug 2012 00:46:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yx0-f177.google.com (mail-yx0-f177.google.com [209.85.213.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B1959ECEF for ; Wed, 15 Aug 2012 15:07:35 -0700 (PDT) Received: by yenq9 with SMTP id q9so2479786yen.36 for ; Wed, 15 Aug 2012 15:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=XU9tAUgAYUPlUCpJ3zU7NXJB/IvBMC0gdQwJNdWclqE=; b=k5LGAASbcHpmdgGDsKSiaX30fbbOTQQ5qEZc9Og7bD+7NFKyscySNV/Iuy4jWWC5ty /3TnSIRSlkdOWJVzZwUXY7Dc3qLeKiuH+zxwE2Dk7iQbUQTEYmT5fBDx94CBgPj9td4A SuCIDN9rPCTc4I7hd556J27YGeD+RzXDgrGvb+MPZpT3DV8uajtMu5QhWUSbDccXtmcV JIOHEqNLgLCF3YPpza64QISlvXJ4+T5LmSVFK6UF8AOLig/4uoT8myq/5ZEJxq26MDz9 TrPo+uhbqpP0sAOwNddV8Og9NnjThdWwurZ7XzCNn5jCPQLz4Z7LPUtpgdUvY9WDWov7 4k/A== Received: by 10.66.74.37 with SMTP id q5mr34538733pav.29.1345068454348; Wed, 15 Aug 2012 15:07:34 -0700 (PDT) Received: from localhost.localdomain (c-24-18-84-54.hsd1.wa.comcast.net. [24.18.84.54]) by mx.google.com with ESMTPS id qn3sm1205977pbc.6.2012.08.15.15.07.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Aug 2012 15:07:33 -0700 (PDT) From: Steven Fuerst To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 3/3] Annotate int2float() as being a pure function. Date: Wed, 15 Aug 2012 15:07:16 -0700 Message-Id: <1345068436-19885-3-git-send-email-svfuerst@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1345068436-19885-1-git-send-email-svfuerst@gmail.com> References: <1345068436-19885-1-git-send-email-svfuerst@gmail.com> X-Mailman-Approved-At: Wed, 15 Aug 2012 22:37:15 -0700 Cc: Steven Fuerst X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org This allows gcc to fold duplicate calls into a single call. Since the current users do actually call it multiple times with the same arguments, this is an obvious win. Signed-off-by: Steven Fuerst --- drivers/gpu/drm/radeon/r600_blit.c | 2 +- drivers/gpu/drm/radeon/r600_blit_shaders.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c index 7d8ac42..661fec2 100644 --- a/drivers/gpu/drm/radeon/r600_blit.c +++ b/drivers/gpu/drm/radeon/r600_blit.c @@ -499,7 +499,7 @@ set_default_state(drm_radeon_private_t *dev_priv) * as the fractional bits will not fit in a float. (It would be better to * round towards even as the fpu does, but that is slower.) */ -uint32_t int2float(uint32_t x) +__pure uint32_t int2float(uint32_t x) { uint32_t msb, exponent, fraction; diff --git a/drivers/gpu/drm/radeon/r600_blit_shaders.h b/drivers/gpu/drm/radeon/r600_blit_shaders.h index e17c2cb..2f3ce7a 100644 --- a/drivers/gpu/drm/radeon/r600_blit_shaders.h +++ b/drivers/gpu/drm/radeon/r600_blit_shaders.h @@ -35,5 +35,5 @@ extern const u32 r6xx_default_state[]; extern const u32 r6xx_ps_size, r6xx_vs_size; extern const u32 r6xx_default_size, r7xx_default_size; -uint32_t int2float(uint32_t x); +__pure uint32_t int2float(uint32_t x); #endif