From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82473 invoked by alias); 10 Oct 2016 12:00:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 82184 invoked by uid 89); 10 Oct 2016 12:00:22 -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=ordered, sysdeps, fpu X-HELO: mx0a-001b2d01.pphosted.com To: libc-alpha@sourceware.org From: Stefan Liebler Subject: [PATCH] S390: Fix fp comparison not raising FE_INVALID. Date: Mon, 10 Oct 2016 12:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------8F89AEB1FC41732983B4FA31" X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101011-0040-0000-0000-000002EB165D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101011-0041-0000-0000-00001D68DF91 Message-Id: <89815f2b-a22c-4100-9362-600c8fc3917a@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-10_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610100202 X-SW-Source: 2016-10/txt/msg00183.txt.bz2 This is a multi-part message in MIME format. --------------8F89AEB1FC41732983B4FA31 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 284 Hi, As gcc is using unordered comparison instructions which do not raise invalid exception if any operand is quiet NAN, FIX_COMPARE_INVALID is defined to 1. Thus iseqsig is calling feraiseexcept as workaround. ChangeLog: * sysdeps/s390/fpu/fix-fp-int-compare-invalid.h: New file. --------------8F89AEB1FC41732983B4FA31 Content-Type: text/x-patch; name="20161010_iseqsig_invalid_exception.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="20161010_iseqsig_invalid_exception.patch" Content-length: 2485 commit 2aa18f963deed0ae455b00b75e773a2972fe2071 Author: Stefan Liebler Date: Mon Oct 10 08:35:54 2016 +0200 S390: Fix fp comparison not raising FE_INVALID. As gcc is using unordered comparison instructions which do not raise invalid exception if any operand is quiet NAN, FIX_COMPARE_INVALID is defined to 1. Thus iseqsig is calling feraiseexcept as workaround. ChangeLog: * sysdeps/s390/fpu/fix-fp-int-compare-invalid.h: New file. diff --git a/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h b/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h new file mode 100644 index 0000000..c4c119f --- /dev/null +++ b/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h @@ -0,0 +1,36 @@ +/* Fix for missing "invalid" exceptions from floating-point + comparisons. s390 version. + Copyright (C) 2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef FIX_FP_INT_COMPARE_INVALID_H +#define FIX_FP_INT_COMPARE_INVALID_H 1 + +/* GCC uses unordered comparison instructions like cebr (Short BFP COMPARE) + when it should use ordered comparison instructions like kebr + (Short BFP COMPARE AND SIGNAL) in order to raise invalid exceptions if + any operand is quiet (or signaling) NAN. See gcc bugzilla: + . + There exists an equivalent gcc bugzilla for Intel: + . + Once the s390 gcc bug is fixed, the definition of FIX_COMPARE_INVALID + should have a __GNUC_PREREQ conditional added so that e.g. the workaround + to call feraiseexcept (FE_INVALID) in math/s_iseqsig_template.c can be + avoided. */ +#define FIX_COMPARE_INVALID 1 + +#endif /* fix-fp-int-compare-invalid.h */ --------------8F89AEB1FC41732983B4FA31--