From nobody Tue Oct 04 19:46:33 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mhp9q53mFz4V9DX; Tue, 4 Oct 2022 19:46:39 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mhp9p2T9fz4NNG; Tue, 4 Oct 2022 19:46:38 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from [10.36.2.155] (unknown [178.232.223.95]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 058752600F3; Tue, 4 Oct 2022 21:46:34 +0200 (CEST) Message-ID: <3d8cc143-23ea-2ae9-8e08-dbc36b18369b@freebsd.org> Date: Tue, 4 Oct 2022 21:46:33 +0200 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: 1024bb26337b - main - qdivrem: Predict division by zero as false. To: Ravi Pokala , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202210041153.294Br2JP011500@gitrepo.freebsd.org> <3D44E023-8220-4B65-89A1-B5B8BB77EBD5@panasas.com> Content-Language: en-US From: Hans Petter Selasky In-Reply-To: <3D44E023-8220-4B65-89A1-B5B8BB77EBD5@panasas.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Mhp9p2T9fz4NNG X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 2a01:4f8:c17:6c4b::2 is neither permitted nor denied by domain of hselasky@freebsd.org) smtp.mailfrom=hselasky@freebsd.org X-Spamd-Result: default: False [-3.06 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.961]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[freebsd.org]; FREEFALL_USER(0.00)[hselasky]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 10/4/22 18:38, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Hans Petter Selasky > Date: 2022-10-04, Tuesday at 04:53 > To: , , > Subject: git: 1024bb26337b - main - qdivrem: Predict division by zero as false. > > The branch main has been updated by hselasky: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1024bb26337bdc6679af477977247e9155d502bc > > commit 1024bb26337bdc6679af477977247e9155d502bc > Author: Hans Petter Selasky > AuthorDate: 2022-10-04 10:28:25 +0000 > Commit: Hans Petter Selasky > CommitDate: 2022-10-04 11:51:06 +0000 > > qdivrem: Predict division by zero as false. > > Division by zero triggers an arithmetic exception and should not be very > common. Predict this. > > Looking at this change with a little more context, I see that (static volatile const unsigned int) 'zero' is set to 0... and then used as the denominator for division. Since these are all integers, I would expect that to cause a fatal divide-by-zero exception. And yet, there's more code after that divide-by-zero. > > What am I missing? > Hi, I know some rare CPU's continue executing after division by zero, but the ones the FreeBSD support doesn't. Maybe it's something we've inherited. I have no good explanation for that extra code. --HPS