2 ms·
Some LLVM compilers produce code that (possible with GCC too) can jit itself on a per function on first execution e.g. -march=native so no branches required. T
by mhh__ 7y ago
Some LLVM compilers produce code that (possible with GCC too) can jit itself on a per function on first execution e.g. -march=native so no branches required.
This requires good planning of the game, i.e. this reduces inlining so one needs to be careful with putting the important bits in the JITted code
- Tuna-Fish 7y agoPractically no-one in the industry uses this, or the icc system that builds multiple versions of functions in the same exe. It might work in theory, but it increases the cost of testing too much for it to be worth it.
- mhh__ 7y agoI'm just saying that it exists. I saw it the other day and was amazed I hadn't seen it before.
- floatboth 7y agoIf you're referring to ifuncs, they aren't doing anything like "JIT itself": your rtld simply calls your function to decide which version of the function you want to call and updates the PLT. FreeBSD kernel uses ifuncs for SMAP, XSAVE, ERMS (Enhanced REP MOVSB/STOSB), RDSEED.
- mhh__ 7y agoI don't know what they call it normally, but I noticed a magic symbol attribute in the LLVM d compiler that invoked a jit at runtime (-dynamic* something like that) Edit: I checked and they're not ifuncs