Giter Club home page Giter Club logo

ctrychta.github.io's People

Contributors

ctrychta avatar

Watchers

 avatar

ctrychta.github.io's Issues

If likely unlikely

I like the general idea a lot but I think it should be less narrow in scope. For instance instead of just indicating the branch hints it should be a general attribute that can give compilers hints about how we want our code generated. This allows us to tailor the hints for CPUs that have concepts beyond the core CPU sets.
For this I'll use cpphint which could be replaced by cpuhint or any other better name (ch if the other is too long). The idea is to describe to the optimizer within the compiler hints about how to optimize the code. Branching is just one aspect but it could also describe how to layout the objects within cache lines. It could also indicate that we want to hold onto this object in a L1 cache since we will be depending on this variable a lot within our algorithm.
The optimizer will of course take these as hints and will not force its' use unless a specific compiler option overrides the internal state. This allows all the hints or none of the hints or even some of the hints to be used. This would allow for performance comparisons during optimization testing. This would help determine if the hints are in the best places and that they are achieving better performance.
These examples can be expanded but it should attempt to be a general platform where we can use cpp to completely describe not just the solution but how we are thinking about the problem. It jumps to the next level by providing the optimizer with contextual information that can not be determined by the code alone.

Some examples:


// If statement using hint to indicate that this if is most likely.
if [cpphint: likely] b < c
{
  a = 6;
} else {
  a = 9;
}

// Data structure where some of the values are used enough that it should stay in the
// fastest cache
struct
{
 int counter;  [cpphint: L1cache]
 int data;
 int important; [cpphint: L1cache]
};

// Data structure where this value is read from a network recv
// and should be placed in a way to get the data quickly from the network bus. 
struct
{
  int index; [cpphint: NetworkRead]
};

// Data structure where the data is a network value where the regular endian is not the same
// as the default for the cpu.
struct
{
  int value; [cpphint: bigendian]
};

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.