Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Most portable library for dynamic code generation?

I'm looking for the most portable assembler library, like asmjit or jitasm.

When I say 'most portable' I mean, that has the most support for a wide verity of architectures. Language doesn't matter so much, but C++ would be the best solution, especially when coupled with GCC.

Important architectures for me, are x86/64, PowerPC and ARM.

like image 751
LiraNuna Avatar asked Sep 11 '09 23:09

LiraNuna


4 Answers

DynASM, used by LuaJIT, supports x86, x64, ARM, MIPS and PowerPC.

like image 164
Vladimir Panteleev Avatar answered Oct 22 '22 09:10

Vladimir Panteleev


After extensive searching and research, I found LLVM to be the best JIT library. All of them support only x86/x86_64, and LLVM is the only one with x86/x86_64 and PPC/PPC64.

So I hereby declare it the most portable... If anyone finds a better one, please - oh please share.

like image 7
LiraNuna Avatar answered Oct 22 '22 08:10

LiraNuna


Well GNU offers you libjit. Highly portable to your architectures of choice, well documented and offering a C++ interface. Being GCC your compiler, I can't think of a better offer.

like image 4
Alexandre Bell Avatar answered Oct 22 '22 10:10

Alexandre Bell


You might find NanoJit interesting. It's lighter than LLVM, although horribly underdocumented (there's a nice tutorial here...and that's about it). Supported architectures:

  • x86
  • x64
  • ARM
  • MIPS
  • PowerPC
like image 2
kirbyfan64sos Avatar answered Oct 22 '22 08:10

kirbyfan64sos