Re: ({

Liste des GroupesRevenir à cl c++ 
Sujet : Re: ({
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.c++
Date : 22. Mar 2025, 16:14:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrmk4n$7524$1@raubtier-asyl.eternal-september.org>
References : 1 2
User-Agent : Mozilla Thunderbird
Am 21.03.2025 um 09:58 schrieb Bonita Montero:

      ({ int y = foo (); int z;
         if (y > 0) z = y;
    else z = - y;
    z; })

If the sign of y is badly predictible you may chose:

z = (y >> sizeof(y) * CHAR_BIT - 1) * y;
Sorry, your code is more efficient since it can be substituted by
a negate i a second register and a conditional move. But some archi-
tectures like RISC-V don't have conditional moves and my code would
be the most efficient way to handle this.

Date Sujet#  Auteur
20 Mar 25 * ({13Alan Mackenzie
21 Mar 25 +* Re: ({2Bonita Montero
22 Mar 25 i`- Re: ({1Bonita Montero
21 Mar 25 `* Re: ({10Paavo Helde
21 Mar 25  +* Re: ({4Keith Thompson
22 Mar 25  i+* Re: ({2Bonita Montero
22 Mar 25  ii`- Re: ({1Alan Mackenzie
22 Mar 25  i`- Re: ({1Alan Mackenzie
22 Mar 25  +* Re: ({4Alan Mackenzie
22 Mar 25  i+* Re: ({2Paavo Helde
22 Mar 25  ii`- Re: ({1David Brown
22 Mar 25  i`- Re: ({1Alan Mackenzie
1 Apr 25  `- Re: ({1Jakob Bohm

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal