mklarqvist / positional-popcount Goto Github PK
View Code? Open in Web Editor NEWFast C functions for the computing the positional popcount (pospopcnt).
License: Apache License 2.0
Fast C functions for the computing the positional popcount (pospopcnt).
License: Apache License 2.0
I'm thinking about doing a rewrite, here are some random thoughts:
pospopcnt_csa_sse()
implies two unnecessary temp variables. It could be rewritten as:
b ^= a;
a ^= c;
c ^= b; // xor sum
b |= a;
b ^= c; // carry
The throughput of a CSA is better than its latency. So it is probably best to keep two independent CSAs executing in parallel. Specifically, passing v1
as a [in/out] parameter
to every bottom tier CSA may create a serial dependency.
At least two passes through the CSA Unit are required for the CSA Unit to pay for itself.
So we may be able to better space loads inside the loop body...
If we process half a loop, before before initially dropping into the loop body, then we can spend the back half of the loop pre-loading for the next pass.
Assuming two loads per cycle on AVX2 machines… It may be better to trade out instructions for more i/o? Maybe spill the output of the CSA Unit into a buffer, then we could go back and do another --or several more-- passes of 16:1 reductions before accumulating.
The latest commit broke build on MinGW, but it seems to be some compiler-related problem: "Error: invalid register for .seh_savexmm".
For reference, so we can appreciate the speeds.
If this project wants to collect all possible methods, here is another one:
https://gist.github.com/aqrit/c729815b0165c139d0bac642ab7ee104
Expected to be 37.5% slower than sse2_sad.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.