From patchwork Wed Feb 27 19:54:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1049132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100308-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="p+9HMaET"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LeGaG8V5"; dkim-atps=neutral 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 448mbv3dB9z9s4Y for ; Thu, 28 Feb 2019 06:54:35 +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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=iLhi f+giQ+BSfNwTEgZj0BWfct7APff8TP/J4vPWZLgx9XFDwJ+Jk002OCNS0egvZDtX 43bPOp70kidqOGwLjVOty46U6TrX/5gfzU/m6cK/3jvYCbzFT8XiYDQMT+G0YzSt Qot5PGFGk1dx8WH4BO4dht2owniOi0OK/aJ5SPM= 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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; s=default; bh=DGvEqgEN6X Av+RSF1jAdNDiYZjM=; b=p+9HMaETCS0qZOL5XF1FiBk/iGvAufZbHCmZMRFMtU DSyQGOhlnJ3+OasgoKnC19InzNKJudnsErMv4brqNaVCl0x2uFP6xLJg4RZaGBEO DTtI8jn8pINyoQJvVxvGBLsXz7uwLlkNTAdQslX+pWJ1MoNi80SV9U+H9o5/kSlV Y= Received: (qmail 38546 invoked by alias); 27 Feb 2019 19:54:29 -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 38232 invoked by uid 89); 27 Feb 2019 19:54:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=ubizjak@gmail.com, ubizjakgmailcom, U*ubizjak, sk:ubizjak X-HELO: mail-it1-f176.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GtgN+OOJ7wmVBLXVstlUm+Y5a5Agka7DdZqj5Q79VE8=; b=LeGaG8V5nu1PcBwdBYzqX6U2lmg9nLTAPnlWgthdm/mgOUCNRapq/lr61+cExvjQcn PBcJxnwYVm2d3yyNejRqvOZxj4d2G4JvxifE0la3o8k40eNhlqqXIoX7isDnBCDkKomV OCWXYy1fFF15DE72c0VGjbXkbjVEvuQnCL5veG92CwSBl/7SMpj47UNfjGEhHbI2vcAQ TLu/LJfV47JJhLrcLD4cN9EwPL+//Ap6VY4sKhszA2gbe4zO6frGxOl01voiSeAwnzyf EodiZOQZDJMyqZBAw74UvvNFdY2mI6ZW7DOPmK2BxOZjV9YEnxAqP2rrt3FpHzctnT6l yOlw== MIME-Version: 1.0 References: <4b9fbc74-e05e-da71-5e8b-61af289a9f70@twiddle.net> In-Reply-To: <4b9fbc74-e05e-da71-5e8b-61af289a9f70@twiddle.net> From: Uros Bizjak Date: Wed, 27 Feb 2019 20:54:14 +0100 Message-ID: Subject: [PATCH, alpha]: Improve sysdeps/alpha/divqu.S and sysdeps/alpha/remqu.S To: Richard Henderson Cc: libc-alpha@sourceware.org Attached patch improves and unifies sysdeps/alpha/divqu.S and sysdeps/alpha/remqu.S. * sysdeps/alpha/divqu.S (__divqu): Move save of $f0 and excb after conditional branch to DIVBYZERO. Fix unwind info. * sysdeps/alpha/remqu.S (__remqu): Move saves of $f0, $f1, $f2 and excb after conditional branch to $powerof2. Add missing unop instructions and .align directives and reorder instructions to match __divqu. Signed-off-by: Uroš Bizjak Patch was tested on alphaev68-linux-gnu, also by running complete libgo testsuite. Uros. diff --git a/sysdeps/alpha/divqu.S b/sysdeps/alpha/divqu.S index f5cedd0716..3165374b6d 100644 --- a/sysdeps/alpha/divqu.S +++ b/sysdeps/alpha/divqu.S @@ -56,10 +56,10 @@ __divqu: that's done, we have at least 22 cycles until its results are ready -- all the time in the world to figure out how we're going to use the results. */ - stt $f0, 0(sp) - excb beq Y, DIVBYZERO + stt $f0, 0(sp) + excb stt $f1, 8(sp) stt $f3, 48(sp) cfi_rel_offset ($f0, 0) @@ -70,6 +70,7 @@ __divqu: _ITOFT2 X, $f0, 16, Y, $f1, 24 cvtqt $f0, $f0 cvtqt $f1, $f1 + blt X, $x_is_neg divt/c $f0, $f1, $f0 @@ -90,12 +91,12 @@ __divqu: ldt $f0, 0(sp) ldt $f3, 48(sp) + lda sp, FRAME(sp) cfi_remember_state cfi_restore ($f0) cfi_restore ($f1) cfi_restore ($f3) cfi_def_cfa_offset (0) - lda sp, FRAME(sp) ret $31, (RA), 1 .align 4 diff --git a/sysdeps/alpha/remqu.S b/sysdeps/alpha/remqu.S index a240ee9735..3b6a62dd88 100644 --- a/sysdeps/alpha/remqu.S +++ b/sysdeps/alpha/remqu.S @@ -57,19 +57,19 @@ __remqu: ready -- all the time in the world to figure out how we're going to use the results. */ subq Y, 1, AT - stt $f0, 0(sp) and Y, AT, AT + beq AT, $powerof2 - stt $f1, 8(sp) + stt $f0, 0(sp) excb + stt $f1, 8(sp) stt $f3, 48(sp) - beq AT, $powerof2 cfi_rel_offset ($f0, 0) cfi_rel_offset ($f1, 8) cfi_rel_offset ($f3, 48) + mf_fpcr $f3 _ITOFT2 X, $f0, 16, Y, $f1, 24 - mf_fpcr $f3 cvtqt $f0, $f0 cvtqt $f1, $f1 @@ -116,11 +116,13 @@ $x_is_neg: cfi_rel_offset ($f2, 24) _ITOFS AT, $f2, 16 + .align 4 addt $f0, $f2, $f0 + unop divt/c $f0, $f1, $f0 + unop /* Ok, we've now the divide issued. Continue with other checks. */ - .align 4 ldt $f1, 8(sp) unop ldt $f2, 24(sp)