Finding an isolated 1-bit can be done in 4 ops even without andnot:
shr1 = x >> 1
t = x ^ shr1
# bit is different from left neighbor. Remains to check it is 1 and right neighbor is 0.
e = t & (t - shr1)
12.01.2025 10:34 β π 1 π 0 π¬ 0 π 0
Sorry, wouldn't know anything, I'd be interested too...
31.12.2024 10:30 β π 1 π 0 π¬ 0 π 0
As Harold mentions, Prefix-Or is just v | -v. Segment-scan-or can also be simplified, for example uint64_t s = (v | m) >> 1; return s ^ (s - v) (4 instructions instead of 7).
30.12.2024 10:41 β π 2 π 1 π¬ 1 π 0
Aspiring computer scientist
Compose papers faster: Focus on your text and let Typst take care of layout and formatting.
Professor of Operations Research at DEI, University of Padova.
www.dei.unipd.it/~fisch
Gurobi developer, former CPLEX and SCIP developer, mixed integer programming
Competitive Machine Learning director at NVIDIA, 3x Kaggle Grandmaster CPMP, ENS ULM alumni. Kaggle profile: https://www.kaggle.com/cpmpml
Works at Optibus, previous developer of high performance optimization software at CPLEX/IBM., MOSEK and SULUM. Opinions are my own.
professor of operations research at RWTH Aachen university, I like mathematical optimization in theory and practice; #orms
Dean, Carnegie Mellon in Qatar. Operations Research, Sports Scheduling
Neurodiverse Trans Geek Girl π§ββοΈ
Queer Kinky Poly Mess π³οΈβπ π³οΈββ§οΈ
CTO @YosysHQ πΊ RISC-V, SMT π©βπ»
Opinions are my Ceti eel's π
ACAB BLM β I am Antifa π΄π©
Vienna, Austria π she/her π§ββοΈ
SAT Solver Hacker, Professor, University of Freiburg
KI-Professorin an der RPTU in Kaiserslautern. Leitet das Algorithm Accountability Lab und den Studiengang Sozioinformatik. Bestsellerautorin mit "Ein Algorithmus hat kein TaktgefΓΌhl" und "Die KI war's", beides im Heyne-Verlag.
x86/x64, SIMD, #AVX512, "Aha!" moments.
I have been writing code since 1986.
Budapest, Europe
https://instlatx64.github.io/InstLatx64/
https://mastodon.gamedev.place/@harold | http://haroldbot.nl
Asst. Prof of CS@Technion, program synthesis is all about correctness. PL/SE/HCI, she/her