From patchwork Mon Aug 6 23:42: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: 1283841 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id DEFFEDF280 for ; Tue, 7 Aug 2012 07:21:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F14329F377 for ; Tue, 7 Aug 2012 00:21:40 -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 E3A759E7D5 for ; Mon, 6 Aug 2012 16:42:28 -0700 (PDT) Received: by yenr9 with SMTP id r9so3398699yen.36 for ; Mon, 06 Aug 2012 16:42:28 -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; bh=0c23LxIgrn4F2W737eDdUaW5qBT/H1ZLnDMmk8x6/uA=; b=aaMzggZjVjB0VD8oVa1ZiRn6NjsWYBNVBB8mBhQrbzDVnVO74jt1/gerni+RRXZiD/ sJYYnsAyrKXpv0BmGEF1fEDd9S5T09kDUiYui3lfpNnKmxG5ZSst2Cnps7CBQQkbN2t8 FQS3KYRaCtFQlLZl02Gk3kKQ2EzreUsm0rWRpCPk/k6Gq87kzsCFioCxNCeAClerVVhk 0dio83ZuJG7WsH+KxrJmvXsCpnLLtfiUaSP0vs5vXsaZRDX3Bkmx+XxeUQjAWazXoxn5 BGlBEDQrbIlKGTJ4/tKrSl1ocICwYtPNdURdMUoTdHMwkXo7SkJ8FmvOYuuGxdGIVubU Vigw== Received: by 10.66.87.138 with SMTP id ay10mr21649714pab.38.1344296548111; Mon, 06 Aug 2012 16:42:28 -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 oj8sm6434674pbb.54.2012.08.06.16.42.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 16:42:27 -0700 (PDT) From: Steven Fuerst To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/3] Annotate int2float() as being a pure function. Date: Mon, 6 Aug 2012 16:42:16 -0700 Message-Id: <1344296536-27985-1-git-send-email-svfuerst@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-Mailman-Approved-At: Mon, 06 Aug 2012 22:56:08 -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. --- 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 7c748ba..e3c2d48 100644 --- a/drivers/gpu/drm/radeon/r600_blit.c +++ b/drivers/gpu/drm/radeon/r600_blit.c @@ -501,7 +501,7 @@ set_default_state(drm_radeon_private_t *dev_priv) * This routine depends on the mod(32) behaviour of the rotate instructions * on x86. */ -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