Re: [Myjit-devel] MyJit questions
Status: Beta
Brought to you by:
pkrajca
|
From: Petr K. <pk...@io...> - 2016-09-23 21:41:44
|
On Wed, 21 Sep 2016 23:20:22 +0200, Adam Cimarosti <cim...@gm...> wrote: > Wonderful project! > > Myjit is a breath of fresh air, and it is very easy to get started. Thank you for your appreciation. > > I have two questions: > * What is the lifetime of the generated code? > * My requirement is for ephemeral code, generated on the fly from user > requests and cleaned-up soon after. > * Will `jit_free` clean this up or is the use case unsupported? Yes. However, keep in mind that the code generation itself has some overhead. For your use case it will be wise to turn optimizations off. > * I will (eventually) have a need to generate AVX code, I've noticed the > `jit_data_*` class of functions to inject bytes, can you think of an > alternative? Well, this is going to be an issue since there's no native support for SIMD instructions. These instructions are too CPU/model-specific and we want to keep MyJIT as vendor and platform independent as possible. Furthermore, on i386 and AMD64 XMM* registers are dedicated for floating point arithmetics. Of course, you can directly insert code for AVX but this have to be done carefully. Code have to PIC and you have take care of XMM* registers, i.e., save/restore their values before entering/leaving AVX code. Best regards, Petr |