🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2689

C code optimization for a = (b < c); (correction)

#2689
From: WILCOX
Date: Sat, 27 May 1989 21:46
12 lines
693 bytes
Wooops!  I was thinking of the signed form and got put "c - b" instead
of "b - c".  Unsigned form should be:

a = (b < c); ==>

a = (unsigned)((b - c) >> (WIDTH_OF_INT_IN_BITS - 1));

     --Dwight Wilcox
       Code 412
       Naval Ocean Systems Center
       San Diego, CA  92152-5000
Technical Details
Message-ID: <8905272147.AA28465@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!NOSC-TECR.ARPA!WILCOX

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!NOSC-TECR.ARPA!WILCOX
From: WILCOX@NOSC-TECR.ARPA
Newsgroups: gnu.gcc.bug
Subject: C code optimization for a = (b < c); (correction)
Message-ID: <8905272147.AA28465@life.ai.mit.edu>
Date: 27 May 89 21:46:29 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 12