From patchwork Mon Nov 16 10:44:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 544961 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 D8395141460 for ; Mon, 16 Nov 2015 21:44:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=ow9V9NL9; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=y5JBXZPFZQF/ZVaNU/1zPw9KQS4/6b18ZSZ2QaZdrQCUaxbA2axdH gtr81ECYKyb6SgmSaRD8LboBrqY0/AVqQOgvhUZFV0IM2AVtvQSVjtNEEiNeYNyB nX+n8z9Xvwna5t15Nz7Wb7w5hbKWCAYAUWy1UN5C+qJI6YFDzqrm8I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type:content-transfer-encoding; s=default; bh=VrOAzvtXX1P7sH3OTytX99FOTvE=; b=ow9V9NL9k+4MKQkxySZ3W9QlyYq0 mxQ+cQLnbdFYMkFlVQWB8I3j/oAVsaMnNCiYP1tC3bTaKsYUuKf/UM9oDhcYkjbS DeqXyO91l8ta/4HRC+QdtW5OAQYYsi9DfBXe7elkMZ7HngNL1QkCp6zS4i5AfwcW chjYZ8qCiCzVd7o= Received: (qmail 105236 invoked by alias); 16 Nov 2015 10:44:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 105226 invoked by uid 89); 16 Nov 2015 10:44:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: hr2.samba.org Date: Mon, 16 Nov 2015 21:44:13 +1100 From: Anton Blanchard To: joseph@codesourcery.com, tuliom@linux.vnet.ibm.com, cseo@linux.vnet.ibm.com, sjmunroe@us.ibm.com Cc: libc-alpha@sourceware.org Subject: [PATCH] Eliminate redundant sign extensions in pow() Message-ID: <20151116214413.26babb5f@kryten> MIME-Version: 1.0 When looking at the code generated for pow() on ppc64 I noticed quite a few sign extensions. Making the array indices unsigned reduces the number of sign extensions from 24 to 7. diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c index 3b0bbe3..adbd5b8 100644 --- a/sysdeps/ieee754/dbl-64/e_pow.c +++ b/sysdeps/ieee754/dbl-64/e_pow.c @@ -245,7 +245,8 @@ static double SECTION log1 (double x, double *delta, double *error) { - int i, j, m; + unsigned int i, j; + int m; double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0; mynumber u, v; #ifdef BIG_ENDI @@ -344,7 +345,8 @@ static double SECTION my_log2 (double x, double *delta, double *error) { - int i, j, m; + unsigned int i, j; + int m; double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0; double ou1, ou2, lu1, lu2, ov, lv1, lv2, a, a1, a2; double y, yy, z, zz, j1, j2, j7, j8;