GithubHelp home page GithubHelp logo

lhmouse / mcf Goto Github PK

View Code? Open in Web Editor NEW
187.0 24.0 28.0 12.43 MB

Meta-purpose C++ Foundation

Home Page: https://gcc-mcf.lhmouse.com/

C 26.37% C++ 71.14% Makefile 1.41% M4 0.06% Shell 1.02%
c-plus-plus windows crt c-plus-plus-game c-plus-plus-17

mcf's People

Contributors

lhmouse avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcf's Issues

3 suggestions for optimizing strlen further

  1. Use _mm_setzero_si128() instead of _mm_set1_epi8(0)( when 0 cannot be recognised as a constant ), which means don't forward strlen to memchr and friends.
    _mm_set1_epi8(c) means movd followed by pshufd or even worse. _mm_setzero_si128() simply means pxor.
    Yes GCC 7.1 does generate two functions for _mm_set1_epi8(0) as a special case, which was a surprise. But ( I suppose ) most compilers won't.

  2. Use _mm_loadu_si128 for aligning pointers
    You may load unaligned 16-n bytes completely using _mm_loadu_si128 instead of writing a loop. This improves performance greatly when the buffer is unaligned and small. It helps more after migrating to avx.

  3. Unroll loops manually.
    It's worth doing to make CPU executes them in parallel. Note twice is enough because in this case, 2 masks generated by _mm_movemask_epi8 ( 2 bytes once ) can be stored into one register (-m32) and then being scanned by bsf or tzcnt ( aka rep bsf ).

Test cases (use online compiler for fair):

  1. https://ideone.com/1vwHi3
    Aligned large buffer: about 10% improvement.

  2. https://ideone.com/5UExGr
    Unaligned small buffer: huge improvement.

  3. https://ideone.com/vc8QIF
    Unaligned small buffer ( only 1 byte to scan ): almost the same, but still better.

File 实现的问题

NtDelayExecution 的第二个参数为nullptr 在Win10 上会返回无效的内存访问错误

mingw32-make

Hello lhmouse :)

Could you also include mingw32-make into your GCC-MCF distribution, please?

Thanks,
Arlen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.