Deutsch   English   Français   Italiano  
<2025Apr23.200928@mips.complang.tuwien.ac.at>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: auto predicating branches
Date: Wed, 23 Apr 2025 18:09:28 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 14
Message-ID: <2025Apr23.200928@mips.complang.tuwien.ac.at>
References: <vbgdms$152jq$1@dont-email.me> <vtsbga$1tu26$1@dont-email.me> <b8859e8d6b909a4505c0f487a6a0fe35@www.novabbs.org> <vu2542$38qev$1@dont-email.me> <vu46su$1170i$1@dont-email.me> <2025Apr21.080532@mips.complang.tuwien.ac.at> <d47cdad26528b4d2309ac9df60120315@www.novabbs.org> <2025Apr22.071010@mips.complang.tuwien.ac.at> <DwONP.2213540$eNx6.1757109@fx14.iad> <2025Apr22.193103@mips.complang.tuwien.ac.at> <f5e5bf81ac2c7e2066d2a181c5a70baf@www.novabbs.org> <jwvcyd338k2.fsf-monnier+comp.arch@gnu.org>
Injection-Date: Wed, 23 Apr 2025 20:11:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="65d91472a7cddc6d4f9bae1a9a480ab9";
	logging-data="3782457"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18bI3oXWmwcjNYGYl3YjrTv"
Cancel-Lock: sha1:0joq6Z9qAz8hy8mQNGaqiaAoFhM=
X-newsreader: xrn 10.11

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>Of course, nothing prevents a CPU from doing "predicate prediction":
>instead of waiting for an answer to `needle < *base[middle]`, it could
>try and guess whether it will be true or false and thus choose to send
>one of the two addresses (or both) to the memory (and later check the
>prediction and rollback, just like we do with normal branches).

That would subvert the use of predication for getting constant-time
code for avoiding timing side channels.  I.e., not a good idea.

- anton
-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>