From patchwork Mon Aug 29 10:41:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 663582 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 3sN7Vz2WSNz9s9W for ; Mon, 29 Aug 2016 20:41:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=iCSxcrXK; 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:subject:to:references:from:date:mime-version :in-reply-to:content-type:content-transfer-encoding:message-id; q=dns; s=default; b=dht3XH3KbJe44k8IO6dauJTBITM3Eh3zu9BhDfdDRCK ROPfHuOdWlBbK3r82bMYquI2yp6Y3RVLy+GN32Pa7g3JSDaQLMyFi1LJZ9BeNTG1 9Xq9xifOl6JETw+nrUxuYIvGzTOqo25Ksl/Mpn672aMz4kAQWkbQPSLEM3c6F+8I = 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:subject:to:references:from:date:mime-version :in-reply-to:content-type:content-transfer-encoding:message-id; s=default; bh=cubLlQLHGLzLXxemw/Efm1S19EY=; b=iCSxcrXKuXFL4uyVL ZxZhQAwEA31Nc/oe5PxUwDlQQ86XaOSJVSCvRAPpmjrW41ZI8RukvZ4j+kixbXA9 ry2zEq3szR6X0w0AcjtXGr595F2Vq2ORpqRlSBBNqjUvtCmi/qxJVjFIHgyL2dZ/ 7ABa3Ro3RpQhyyuY348n1MkxjA= Received: (qmail 11744 invoked by alias); 29 Aug 2016 10:41:41 -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 11728 invoked by uid 89); 29 Aug 2016 10:41:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=Hx-languages-length:1425, s390, s390x X-HELO: mx0a-001b2d01.pphosted.com X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: stli@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org Subject: Re: Add fetestexceptflag To: libc-alpha@sourceware.org References: From: Stefan Liebler Date: Mon, 29 Aug 2016 12:41:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16082910-0028-0000-0000-00000208E42D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16082910-0029-0000-0000-000020177A1F Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-29_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608290109 On 08/26/2016 07:37 PM, Joseph Myers wrote: > TS 18661-1 defines an fetestexceptflag function to test the exception > state saved in an fexcept_t object by fegetexceptflag. > > This patch implements this function for glibc. Almost all > architectures save exception state in such a way that it can be > directly ANDed with exception flag bits, so rather than having lots of > fetestexceptflag implementations that all do the same thing, the math/ > implementation is made to use this generic logic (which is also OK in > the fallback case where FE_ALL_EXCEPT is zero). The only architecture > that seems to need anything different is s390. Hi Joseph, the s390-version of fetestexceptflag is okay. The testcase passes on s390/s390x and I verified that the content of dxc-byte is used. Please add the following comment: & FE_ALL_EXCEPT); Thanks, Stefan diff --git a/sysdeps/s390/fpu/fetestexceptflag.c b/sysdeps/s390/fpu/fetestexceptflag.c index b7e64ab..d5646c5 100644 --- a/sysdeps/s390/fpu/fetestexceptflag.c +++ b/sysdeps/s390/fpu/fetestexceptflag.c @@ -22,6 +22,9 @@ int fetestexceptflag (const fexcept_t *flagp, int excepts) { + /* As *flagp is obtained by an earlier call of fegetexceptflag the bits 0-5 + of dxc-byte are either zero or correspond to the flag-bits. + Evaluate flags and last dxc-exception-code. */ return (((*flagp >> FPC_FLAGS_SHIFT) | (*flagp >> FPC_DXC_SHIFT)) & excepts