From patchwork Thu Jan 24 09:40:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 31201 Received: (qmail 66991 invoked by alias); 24 Jan 2019 09:40:52 -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 66980 invoked by uid 89); 24 Jan 2019 09:40:51 -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= X-HELO: mail-io1-f49.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=usb8OZbeT6CEcl2VURLfdR1nYYrRf71ioM2nRuqama0=; b=XfuN3lEB0kDp99HicQ7NftEKfCi5kSoE/qjALR9JcWppCam7yu2bPD/cPjccg2BqcO EOOHhlUaygcEgiAakS2AeSghjNjsGuu/4J3wpxdA2rc3B/yWjVaqaFYF59yKiG0lEfN/ CowWUSPwUJRtl5Xa1xitv5eBw1fL+PTnmPCwsCck/rw+DbREM618ovwT2cXQupvUd5lu MKxG1IH66zPJMZnDiaiUdSzP733vmexJDVAuBh3tQmbLIoK+4HxXqgJk8ySMMvbYztiZ YI2aAhUIMR3weQa7iJDXvY2LBshR/XQ1hHcFMbIdjbPJBRPiXRF+eZtU+qTt7AoW0r+N /JPg== MIME-Version: 1.0 From: Uros Bizjak Date: Thu, 24 Jan 2019 10:40:37 +0100 Message-ID: Subject: [PATCH, alpha, v2]: Fix sysdeps/alpha/remqu.S clobbering $f3 reg To: libc-alpha@sourceware.org Cc: Richard Henderson Attached patch fixes sysdeps/alpha/remqu.S clobbering $f3 register via $y_is_neg path. There was missing restore of $f3 before the return from the function. Without the patch, math/big testcase from Go-1.11 testsuite (that includes lots of corner cases that exercise remqu) FAIL, with patched function, the testcase PASSes without problems. Signed-off-by: Uros Bizjak 2019-24-01 Uroš Bizjak * sysdeps/alpha/remqu.S (__remqu): Add missing restore of $f3 register on $y_is_neg path. Uros. diff --git a/sysdeps/alpha/remqu.S b/sysdeps/alpha/remqu.S index c2c5caf3c20..a240ee97358 100644 --- a/sysdeps/alpha/remqu.S +++ b/sysdeps/alpha/remqu.S @@ -246,12 +246,16 @@ $y_is_neg: quotient must be either 0 or 1, so the remainder must be X or X-Y, so just compute it directly. */ cmpule Y, X, AT + excb + mt_fpcr $f3 subq X, Y, RV ldt $f0, 0(sp) + ldt $f3, 48(sp) cmoveq AT, X, RV lda sp, FRAME(sp) cfi_restore ($f0) + cfi_restore ($f3) cfi_def_cfa_offset (0) ret $31, (RA), 1