Path: ...!weretis.net!feeder9.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail From: John Levine Newsgroups: comp.arch Subject: Re: a bit of history, Stealing a Great Idea from the 6600 Date: Sat, 4 May 2024 19:29:48 -0000 (UTC) Organization: Taughannock Networks Message-ID: References: <71acfecad198c4e9a9b14ffab7fc1cb5@www.novabbs.org> <2024May3.173347@mips.complang.tuwien.ac.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 4 May 2024 19:29:48 -0000 (UTC) Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="38979"; mail-complaints-to="abuse@iecc.com" In-Reply-To: <71acfecad198c4e9a9b14ffab7fc1cb5@www.novabbs.org> <2024May3.173347@mips.complang.tuwien.ac.at> Cleverness: some X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: johnl@iecc.com (John Levine) Bytes: 2387 Lines: 29 According to Thomas Koenig : >John Levine schrieb: > >> It is my impression that >> trapping on fixed point overflow is not very useful, and it's easier >> to do a jump on overflow in the few cases where you care, or the x86 >> INTO which you put after the arithmetic operaion to trap if the >> overflow flag is set. > >Sanitzers would benefit greatly from trapping math. > >However, this could get into murky territory - to be really >general, you would also need a version for trapping math with >unsigned numbers. Just think of doing a unsigned loop with a >lower bound that, due to some error in the code or input, has an >upper bound of 0-1... I suppose but my experience was always that the trap was the easy part. Figuring out what to do after the trap happens is much harder. I've seen designs with instructions like "trap if greater than N" so if you want to go that route, you can check for the range the programemr declared rather than whatever word size it was rounded up to. -- Regards, John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies", Please consider the environment before reading this e-mail. https://jl.ly