3 ms·
Are there any 'finished' language giving access to the whole machinery ?
by agumonkey 12y ago
Are there any 'finished' language giving access to the whole machinery ?
- pjmlp 12y agoAs far as I know, no. Hence why even if C looks like a portable high level Assembler, there are many modern CPU features not available. Even most common extensions just cover part of them.
- selckin 12y agoSo who uses these features then?
- agumonkey 12y agoWild guess: libs (intel cilk?), compiler intrisics through reified assembly.
- bhouston 12y agoI've used a lot of SSE2 and prefetch instincs in Visual C++ for math / data heavy high performance computing applications. It can make a fairly big different -- like more than 50% performance improvements for key parts of the code.
- vardump 12y agoThat depends heavily on with CPU and memory subsystem combination you're running it on. You need to know how far to prefetch and how to order your data in memory.
- kabdib 12y agoGames on consoles, where the hardware architecture is frozen and you can optimize to the metal all you want. Not all titles do this, since most titles are cross-platform and you're not going to do tons of optimization for a specific one unless there is a huge payoff.
- tarpherder 12y agoIt is done on PC as well, but we can't assume very recent instruction sets. We'll have to do with semi recent instruction sets.
- TallGuyShort 12y agoSpecialized HPC workloads
- lgeek 12y agoMany of the capabilities described in the article are just hardware features which don't need any control from application developers, but their effectiveness can be improved if the developers are aware of them (e.g. caches, TLBs). Others properties are exploited automatically by compilers (e.g. instruction scheduling for improving throughput in a superscalar processor) Instruction set extensions (which I believe might be what you were thinking of) are used via intrinsics and assembly programming by pretty much any performance-oriented code. For example look at the dozens of architecture-specific implementations of glibc functions: x86-64[0], arm[1]. [0] https://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/x86_64/multiarch https://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/x86... [1] https://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/arm/armv7/multiarch https://sourceware.org/git/?p=glibc.git;a=tree;f=sysdeps/arm...
- bhouston 12y ago> Even most common extensions just cover part of them. The headers I linked to here: https://news.ycombinator.com/item?id=8873764 https://news.ycombinator.com/item?id=8873764 Cover most useful Intel CPU extensions. And you can use them easily in code, it just sucks when you have to do CPU feature detection and have different code paths for different CPUs.
- bluetomcat 12y ago> it just sucks when you have to do CPU feature detection and have different code paths for different CPUs. In the Linux kernel they went so far as to actually replacing instructions at boot-time at known locations, based on the capabilities of the CPU the code is executing on. This prevents them from maintaining many paths in the compiled code.
- pjmlp 12y agoYes, but as I answered they are compiler specific and cover only part of the CPU.