From patchwork Thu Oct 23 17:35:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco X-Patchwork-Id: 402611 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 EF3FD14009A for ; Fri, 24 Oct 2014 04:36:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=YQv NIZpenyqQypS+F0ZnT1NkY1OcsSwnMS030WyMk9niZEMAk8O+2KqYXxF7OhNE3Ky 2s5ZqGSLwd0Pj31DvGxh9r776r+nqCFTe0XSi1Tl5576wGUQ2YfOkPEF/RWYja8s Yt2+yOZl0u+XGZwsYrPFjVIQFhVjg0ByYj35gUDk= 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:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=jusjbn9v+ m59MQHOR/M5QmPItPM=; b=Kwx5a8i29Q2DdGLdAbJBW1v86bztGQ/vBuhZPHAcq wO790uohHSdcZuIWpJFb/2uUzifJKtEEeTDpnaSRMGc3PNSObZrLYZWSnKMfadDR RNB9qG5G40eSfMeZZ8bHfNLLVFWzlnO/pZCO12Cq8ALAUyd8oHa/ur3Le4O1V0sh mQ= Received: (qmail 2079 invoked by alias); 23 Oct 2014 17:35:57 -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 2069 invoked by uid 89); 23 Oct 2014 17:35:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com From: "Wilco Dijkstra" To: Subject: [PATCH 9/13] AArch64: Cleanup fenv implementation Date: Thu, 23 Oct 2014 18:35:49 +0100 Message-ID: <001301cfeee7$c9632dd0$5c298970$@com> MIME-Version: 1.0 X-MC-Unique: 114102318355004201 Call libc_fesetround_aarch64 from math_private.h rather than duplicating functionality. ChangeLog: 2014-10-23 Wilco Dijkstra * sysdeps/aarch64/fpu/fesetround.c (fesetround): Call libc_fesetround_aarch64. --- sysdeps/aarch64/fpu/fesetround.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/sysdeps/aarch64/fpu/fesetround.c b/sysdeps/aarch64/fpu/fesetround.c index d34706d..540ef48 100644 --- a/sysdeps/aarch64/fpu/fesetround.c +++ b/sysdeps/aarch64/fpu/fesetround.c @@ -16,32 +16,16 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include int fesetround (int round) { - fpu_control_t fpcr; - fpu_control_t fpcr_new; + if (round & ~_FPU_FPCR_RM_MASK) + return 1; - switch (round) - { - case FE_TONEAREST: - case FE_UPWARD: - case FE_DOWNWARD: - case FE_TOWARDZERO: - _FPU_GETCW (fpcr); - fpcr_new = (fpcr & ~FE_TOWARDZERO) | round; - - if (fpcr != fpcr_new) - _FPU_SETCW (fpcr_new); - return 0; - - default: - return 1; - } - - return 1; + libc_fesetround_aarch64 (round); + return 0; } libm_hidden_def (fesetround)