🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1752

Re: does an expression in a logical statement need parenthesis for proper evaluation?

#1752
From: David Brown
Date: Sat, 21 Nov 2026 14:06
45 lines
3811 bytes
On 21/11/2026 13:48, Tristan Wibberley wrote:
> On 15/11/2026 12:09, David Brown wrote:
>> As I said, there is no benefit in using bitwise operators when logical
>> operators are appropriate.
> 
> Thank you for reasserting your authority. It is worthless in the effort
> to stop me from recounting accurate truths based around the fact that,
> extensionally, bitwise operators are SIMD logical operators in which '&'
> consequently has a special utility in dimension reduction (selecting one
> of the multiple data using a mask, for instance) and in which '!' serves
> as negation with dimension reduction in the special case that only bit 0
> is needed (SISD). Also that the "logical operators" are actually
> conditional sequencing operators being merely logical in special cases
> because of their conditional aspect, and that each has side-effect
> benefits as I described making even bitwise operators a better choice
> for logic sometimes.
> 

Logical operators are not directly suitable for SIMD, whereas bitwise 
operators obviously can be used for "anding" and "oring" multiple bits 
in parallel.  There was no indication that SIMD operations were remotely 
relevant to the discussion, which was about logic operations on booleans 
and/or 0/1 int values resulting from relational operators.  Such 
evaluations can rarely be handled with parallel SIMD operations without 
significant re-arrangements.

Of course if you have calculations that can be re-arranged to be SIMD 
friendly, auto-vectorised or manually handled, and you are running on 
targets with SIMD and the code can benefit significantly from the 
speedup, then you should re-write the code to take advantage of that.

Otherwise do logical operations using logic operators, and bitwise 
operations using bitwise operators.

> You probably got used to the conditional sequencing operators because
> you're so used to doing things with side-effects and the people who kept
> the SIMD logic in mind stopped interacting here.
> 

You probably haven't the faintest idea what I am "used to".

I am not at all clear why you seem to be trying to turn a discussion 
into a conflict.  But maybe we should leave it be.

Technical Details
Message-ID: <11ds8go$3uj9$2@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11cj4a0$23796$1@dont-email.me> <11cj8ch$24f93$1@dont-email.me> <11cj9he$24mi0$1@dont-email.me> <11d54u2$863c$1@dont-email.me> <11d5eg2$bfhu$1@dont-email.me> <11d6if2$lqnd$1@dont-email.me> <11d7a99$th7r$1@dont-email.me> <11d7f1t$1839o$1@dont-email.me> <11d82gp$1f70n$1@dont-email.me> <11dc7da$2nu91$1@dont-email.me> <11ds3uf$287k$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: does an expression in a logical statement need parenthesis for
 proper evaluation?
Date: Sat, 21 Nov 2026 15:06:16 +0100
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <11ds8go$3uj9$2@dont-email.me>
References: <11cj4a0$23796$1@dont-email.me> <11cj8ch$24f93$1@dont-email.me>
 <11cj9he$24mi0$1@dont-email.me> <11d54u2$863c$1@dont-email.me>
 <11d5eg2$bfhu$1@dont-email.me> <11d6if2$lqnd$1@dont-email.me>
 <11d7a99$th7r$1@dont-email.me> <11d7f1t$1839o$1@dont-email.me>
 <11d82gp$1f70n$1@dont-email.me> <11dc7da$2nu91$1@dont-email.me>
 <11ds3uf$287k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 21 Nov 2026 14:06:17 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="129641"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX193E45sdJLQj29CKpHqEDvfuchZhikC20w="; posting-host="e9cc8568760c122c84a8bb7d362e291d"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:owVFn636RaSf8MRrfEKsZMLPFCc= sha256:VppetlXNLwwXXZFEI0STL1RGsQjtl4gutayjcOPYF1g=
	sha1:LKyahz4ONDn3lSKR+/Z8xA36hzM= sha256:SH5nvjigVSTkjPrz31VuXXic2P9ynVQR1Ez2h1C+gPs=
Content-Language: en-GB
In-Reply-To: <11ds3uf$287k$1@dont-email.me>